Bug 81421 Closing a project with open editors leaves stale elements in Package Explorer's working set layout
I20041216-0800 Closing a project with open editors leaves stale elements in Package Explorer's working sets mode. This only affects CUs not normal resources.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/HistoryWorkingSetUpdater.java
if (index == -1)
			return;
		elements.set(index, newElement);
		fOpenFiles.remove(oldElement);
		fOpenFiles.add(newElement);
		setElements(elements);
	}
	
	private void updateHistory(IAdaptable element) {
		List elements= getElements();
		int index= elements.indexOf(element);
		if (index != -1) {
			elements.remove(index);
			elements.add(0, element);
		} else {
			if (elements.size() == fMaxElements) {
				elements.remove(elements.size() - 1);
			}
			elements.add(0, element);
		}
		setElements(elements);
	}
	private List getElements() {
		return new ArrayList(Arrays.asList(fWorkingSet.getElements()));
	}
	private void setElements(List elements) {
		fWorkingSet.setElements((IAdaptable[])elements.toArray(new IAdaptable[elements.size()]));
	}
}