Bug 220696 [Undo] When deleting files and externally moving files from navigator, we get an exception
Build ID: M20071023-1652 Steps To Reproduce: Delete files from navigator view. Copy files from another folder to workspace using an external shell like command on windows. Refresh workspace. Repeat More information: from time to time, you get this exception: An internal error occurred during: "Deleting resources". java.lang.ArrayIndexOutOfBoundsException: 2 at org.eclipse.ui.ide.undo.AbstractResourcesOperation.setTargetResources(AbstractResourcesOperation.java:323) at org.eclipse.ui.ide.undo.AbstractResourcesOperation.<init>(AbstractResourcesOperation.java:71) at org.eclipse.ui.ide.undo.DeleteResourcesOperation.<init>(DeleteResourcesOperation.java:53) at org.eclipse.ui.actions.DeleteResourceAction$4.run(DeleteResourceAction.java:503) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/undo/AbstractResourcesOperation.java
/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.ide.undo.AbstractWorkspaceOperation#setTargetResources(org.eclipse.core.resources.IResource[])
	 */
	protected void setTargetResources(IResource[] targetResources) {
		
		
		List subResources = new ArrayList();
		for (int i = 0; i < targetResources.length; i++) {
			IResource subResource = targetResources[i];
			for (int j = 0; j < targetResources.length; j++) {
				IResource superResource = targetResources[j];
				if (isDescendantOf(subResource, superResource))
					subResources.add(subResource);
			}
		}
		IResource[] nestedResourcesRemoved = new IResource[targetResources.length
				- subResources.size()];
		int j = 0;
		for (int i = 0; i < targetResources.length; i++) {
			if (!subResources.contains(targetResources[i])) {
				nestedResourcesRemoved[j] = targetResources[i];
				j++;
			}
		}
		super.setTargetResources(nestedResourcesRemoved);
	}
}