Bug 166465 [Undo] NPE in undo code when deleting folder and subfolder
I20061129-1340 - in a CVS project, create a folder f1 and a folder f2 inside f1 - in the Synchronize view (change sets, compressed folders mode), select both f1 and f1/f2 - press Delete key and confirm dialog org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:517) at org.eclipse.ui.actions.DeleteResourceAction$3.run(DeleteResourceAction.java:488) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.NullPointerException at org.eclipse.ui.internal.ide.undo.ContainerDescription.recordStateFromHistory(ContainerDescription.java:182) at org.eclipse.ui.ide.undo.WorkspaceUndoUtil.delete(WorkspaceUndoUtil.java:597) at org.eclipse.ui.ide.undo.WorkspaceUndoUtil.delete(WorkspaceUndoUtil.java:177) at org.eclipse.ui.ide.undo.AbstractResourcesOperation.delete(AbstractResourcesOperation.java:103) at org.eclipse.ui.ide.undo.DeleteResourcesOperation.doExecute(DeleteResourcesOperation.java:68) at org.eclipse.ui.ide.undo.AbstractWorkspaceOperation$1.run(AbstractWorkspaceOperation.java:210) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1743) at org.eclipse.ui.ide.undo.AbstractWorkspaceOperation.execute(AbstractWorkspaceOperation.java:208) at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:509) ... 2 more
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/undo/ContainerDescription.java
* (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.internal.ide.undo.ResourceDescription#recordStateFromHistory(org.eclipse.core.resources.IResource,
	 *      org.eclipse.core.runtime.IProgressMonitor)
	 */
	public void recordStateFromHistory(IResource resource,
			IProgressMonitor monitor) throws CoreException {
		monitor.beginTask(
				UndoMessages.FolderDescription_SavingUndoInfoProgress, 100);
		for (int i = 0; i < members.length; i++) {
			if (members[i] instanceof FileDescription) {
				IPath path = resource.getFullPath().append(
						((FileDescription) members[i]).name);
				IFile fileHandle = resource.getWorkspace().getRoot().getFile(
						path);
				members[i].recordStateFromHistory(fileHandle,
						new SubProgressMonitor(monitor, 100 / members.length));
			} else if (members[i] instanceof FolderDescription) {
				IPath path = resource.getFullPath().append(
						((FolderDescription) members[i]).name);
				IFolder folderHandle = resource.getWorkspace().getRoot()
						.getFolder(path);
				members[i].recordStateFromHistory(folderHandle,
						new SubProgressMonitor(monitor, 100 / members.length));
			}
		}
		monitor.done();
	}
	/**
	 * Return the name of the container described by this ContainerDescription.