Bug 136830 Close Unrelated Projects closes needed projects
As I did not find a description in the help about the "Close Unrelated" menu item my guess is, that it would close all projects which are not needed for the selected one - at least this is what would make most sense for me. Under this assumption I file this bug, as in 3.2M6 "Close Unrelated" closes Projects which are needed to build the current project. How to reproduce: I start eclipse with a as unencumbered environment as possible $ mkdir /tmp/freshDirectory $ cd /tmp/freshDirectory $ HOME=/tmp/freshDirectory /usr/local/java/eclipse/eclipse -data /tmp/freshDirectory Then in eclipse enter the Workbench. Create three Java Projects named "A", "B" and "C". Select project "C" and enter Project->Properties. Select "Java Build Path" and there the "Projects" Tab. Add project "A" to the required projects list. Press "OK" to terminate the dialog. Select project "C" press the right mouse button and in the popup menu select "Close Unrelated Projects". Result: Both Projects "A" and "B" are closed. The "Problems" view shows two errors informing that the project "C" cannot be built anymore because project "A" is missed. Expected Result: Only project B, on which A does not depend, is closed. PS: If you had intended to just implement a simple "Close All Others" item like for the editor tabs, which does not care about any dependencies, then you should call it "Close All Other Projects" and not "Close Unrelated Projects". But please, don't use this as a quick fix. Implement something that is really useful.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/actions/CloseUnrelatedProjectsAction.java
for (Iterator it = selection.iterator(); it.hasNext();) {
			Object next = it.next();
			if (next instanceof IProject) {
				addRelatedProjects(relatedProjects, (IProject) next);
			}
		}
		HashSet unrelated = new HashSet();
		unrelated.addAll(Arrays.asList(ResourcesPlugin.getWorkspace().getRoot().getProjects()));
		unrelated.removeAll(relatedProjects);
		projectsToClose.clear();
		projectsToClose.addAll(unrelated);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.actions.SelectionListenerAction#getSelectedResources()
	 */
	protected List getSelectedResources() {
		if (selectionDirty) {
			List newSelection = super.getSelectedResources();
			if (!oldSelection.equals(newSelection)) {
				oldSelection = newSelection;
				computeRelated(newSelection);
			}
			selectionDirty = false;
		}
		return projectsToClose;
	}
}