Bug 27264 opening/closing java files in presence of hiearchical package explorer is slow
will attach profiles
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageFragmentProvider.java
}
		return fragment;
	}
	
	private boolean isEmpty(IPackageFragment fragment) throws JavaModelException {
		return (!fragment.containsJavaResources()) && (fragment.getNonJavaResources().length==0);
	}
	
	private Object[] findNextLevelChildrenByElementName(IPackageFragmentRoot parent, IPackageFragment fragment) {
		List list= new ArrayList();
		try {
			IJavaElement[] children= parent.getChildren();
			String fragmentname= fragment.getElementName();
			for (int i= 0; i < children.length; i++) {
				IJavaElement element= children[i];
				if (element instanceof IPackageFragment) {
					IPackageFragment frag= (IPackageFragment) element;
					String name= element.getElementName();
					if (!"".equals(fragmentname) && name.startsWith(fragmentname) && !name.equals(fragmentname)) { 
						String tail= name.substring(fragmentname.length() + 1);
						if (!"".equals(tail) && (tail.indexOf(".") == -1)) {
							list.add(frag);
						}
					}
				}
			}
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
		}
		return list.toArray();