Bug 127105 Package explorer hierarchical mode calls ICompilationUnit#getChildren() in PackageExplorerProblemTreeViewer#isExpandable
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
for (int i= 0; i < elements.length; i++) 
			elements[i]= convertElement(elements[i]);
		
		return new StructuredSelection(elements);
	}
	private Object convertElement(Object original) {
		if (original instanceof IJavaElement) {
			return original;
		
		} else if (original instanceof IResource) {
			IJavaElement je= JavaCore.create((IResource)original);
			if (je != null && je.exists()) 
				return je;
		
		} else if (original instanceof IAdaptable) {
			IAdaptable adaptable= (IAdaptable)original;
			IJavaElement je= (IJavaElement) adaptable.getAdapter(IJavaElement.class);
			if (je != null && je.exists())
				return je;
			
			IResource r= (IResource) adaptable.getAdapter(IResource.class);
			if (r != null) {
				je= JavaCore.create(r);
				if (je != null && je.exists()) 
					return je;
				else
					return r;
			}
		}