Bug 38513 JavaModel not updated when creating an "empty" IClasspathContainer [package explorer]
I have implemented IClasspathContainer. When I add my container to a java project via Project Properties > JavaBuild Path > Libraries > Add Library wizard, the Package Explorer view is not updated if my container resolves to an empty classpath and the container does not appear in the view. If I then close and then reopen the java project the container appears in the Package Explorer view correctly, even if the container resolves to an empty classpath. This problem can be reproduced in Eclipse 2.1 as follows: 1. Open the Java Perspective, Package Explorer view. 2. Create a new Java Project. 3. Right-click the project and select Properties > Java Build Path > Libraries (tab). 4. Note the default JRE System Libraries container should appear in the list. 5. Select the Add Library button and then select the Required Plug-ins container from the Add Library page. 6. Then select Next and then Finish to return to the Properties page. 7. In the Properties page select OK to return to the Package Explorer view. 8. Note the Package Explorer view has not updated and the Required Plug-ins container is not displayed. 9. Right-click on the java project and select Close Project form the menu. 10. Then right-click on the java project and select Open Project form the menu. 11. Note the Package Explorer view has now updated and the Required Plug-ins container is now displayed. I believe the JavaModel is not being updated if a newly added container resolves to an empty classpath. This is probably incorrect or lacking functionality in the special case of an "empty" IClasspathContainer and therefore some notification to update the JavaModel, under these circumstances, may be required. This problem was recreated under Windows 2000 SP1, Eclipse 2.1 Build 200303272130, and Sun Java 2 SDK Standard Edition v1.3.1. Regards, Joss Wright
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java
/**
	 * Process resource deltas.
	 *
	 * @return true if the parent got refreshed
	 */
	private boolean processResourceDeltas(IResourceDelta[] deltas, Object parent) {
		if (deltas == null)
			return false;
		
		if (deltas.length > 1) {
			
			postRefresh(parent);
			return true;
		}
		for (int i= 0; i < deltas.length; i++) {
			if (processResourceDelta(deltas[i], parent))
				return true;
		}
		return false;
	}
	
	private void postRefresh(Object root) {
		
		
		if (isParent(root, fInput)) 
			root= fInput;
		postRefresh(root, true);
	}
	
	boolean isParent(Object root, Object child) {