Bug 39754 New projects being added to the TreeViewer twice [package explorer]
20030703 When the first project you create in a Workbench is a JavaProject you end up getting it added twice to the viewer. This is because the items get added both as a result of the selectReveal in the New Java Project Wizard and as a result of postAdd called due to the resource listener in the view. This extra item does not get created the second time so it appears to be something to do with the empty view case. Previously the tree viewer always called a refresh on an add so this problem was not exposed. This was a bug that had been fixed for 20030701. @see PackageExplorerContentProvider#postAdd() @see PackageExplorerPart#selectReveal() STEPS 1) Start a new workbench 2) Create aProject Fred 3) Fred will appear twice in the PackageExplorer 4) Create a project Bob 5) Bob will only appear once Note this is does not occur in the Resource Navigator
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java
return container.getPackageFragmentRoots();
	}
	private Object[] getNonJavaProjects(IJavaModel model) throws JavaModelException {
		return model.getNonJavaResources();
	}
	public Object getParent(Object child) {
		if (needsToDelegateGetParent(child)) {
			return fPackageFragmentProvider.getParent(child);
		} else
			return super.getParent(child);
	}
	protected Object internalGetParent(Object element) {
		
		
		
		
		if (element instanceof IPackageFragmentRoot) {
			IPackageFragmentRoot root= (IPackageFragmentRoot)element;
			IJavaProject project= root.getJavaProject();
			try {
				IClasspathEntry[] entries= project.getRawClasspath();
				for (int i= 0; i < entries.length; i++) {
					IClasspathEntry entry= entries[i];
					if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
						if (ClassPathContainer.contains(project, entry, root)) 
							return new ClassPathContainer(project, entry);
					}
				}
			} catch (JavaModelException e) {