Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: IBM Corporation - initial API and implementation Stephan Herrmann <> - inconsistent initialization of classpath container backed by external class folder, see /
package org.eclipse.jdt.internal.core;
import  org.eclipse.core.runtime.CoreException;
import  org.eclipse.core.runtime.IPath;
import  org.eclipse.core.runtime.IProgressMonitor;
public class ExternalFolderChange {
	public ExternalFolderChange(JavaProject projectIClasspathEntry[] oldResolvedClasspath) {
		this. = project;
		this. = oldResolvedClasspath;
	 * Update external folders
	public void updateExternalFoldersIfNecessary(boolean refreshIfExistAlready, IProgressMonitor monitorthrows JavaModelException {
		HashSet oldFolders = ExternalFoldersManager.getExternalFolders(this.);
		IClasspathEntry[] newResolvedClasspath = this..getResolvedClasspath();
		HashSet newFolders = ExternalFoldersManager.getExternalFolders(newResolvedClasspath);
		if (newFolders == null)
		ExternalFoldersManager foldersManager = JavaModelManager.getExternalManager();
		Iterator iterator = newFolders.iterator();
		while (iterator.hasNext()) {
			Object folderPath =;
			if (oldFolders == null || !oldFolders.remove(folderPath) || foldersManager.removePendingFolder(folderPath)) {
				try {
					foldersManager.createLinkFolder((IPath) folderPathrefreshIfExistAlreadymonitor);
catch (CoreException e) {
					throw new JavaModelException(e);
		// removal of linked folders is done during save
	public String toString() {
		return "ExternalFolderChange: " + this..getElementName(); //$NON-NLS-1$
New to GrepCode? Check out our FAQ X