Bug 79087 CME on startup in JavaWorkingSetUpdater.elementChanged()
I200411170800 with ZRH plugin export 20041119_1119 Found the following exception after startup. Show -> Working Sets is enabled in the Package Explorer but I do not remember having opened the Package Explorer before the exception occured. Two editors were opened from the previous sesssion. Error 2004-11-19 17:43:35.407 Problems occurred when invoking code from plug-in: "org.eclipse.core.runtime". java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:448) at java.util.AbstractList$Itr.next(AbstractList.java:419) at org.eclipse.jdt.internal.ui.workingsets.JavaWorkingSetUpdater.elementChanged(JavaWorkingSetUpdater.java:117) at org.eclipse.jdt.internal.core.DeltaProcessor$2.run(DeltaProcessor.java:1426) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616) at org.eclipse.core.runtime.Platform.run(Platform.java:747) at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1421) at org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1269) at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1248) at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1791) at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:414) at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:283) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616) at org.eclipse.core.runtime.Platform.run(Platform.java:747) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:277) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:188) at org.eclipse.core.internal.resources.SavedState.processResourceChangeEvents(SavedState.java:75) at org.eclipse.jdt.core.JavaCore$7.run(JavaCore.java:4115) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1676) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1696) at org.eclipse.jdt.core.JavaCore$6.run(JavaCore.java:4107) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/JavaWorkingSetUpdater.java
}
		IResourceDelta[] resourceDeltas= delta.getResourceDeltas();
		if (resourceDeltas != null) {
			for (int i= 0; i < resourceDeltas.length; i++) {
				processResourceDelta(result, resourceDeltas[i]);
			}
		}
		IJavaElementDelta[] children= delta.getAffectedChildren();
		for (int i= 0; i < children.length; i++) {
			processJavaDelta(result, children[i]);
		}
	}
	
	private void processResourceDelta(WorkingSetDelta result, IResourceDelta delta) {
		IResource resource= delta.getResource();
		int type= resource.getType();
		int index= result.indexOf(resource);
		int kind= delta.getKind();
		int flags= delta.getFlags();
		if (kind == IResourceDelta.CHANGED && type == IResource.PROJECT && index != -1) {
			if ((flags & IResourceDelta.OPEN) != 0) {
				result.set(index, resource);
			}
		}
		if (index != -1 && kind == IResourceDelta.REMOVED) {
			if ((flags & IResourceDelta.MOVED_TO) != 0) {
				result.set(index, 
					ResourcesPlugin.getWorkspace().getRoot().findMember(delta.getMovedToPath()));
			} else {
				result.remove(index);