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
}
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
		}
		return null;
	}
	
	private Object filterParent(Object parent) {
		if (fFoldPackages && (parent!=null)) {
			try {
				if (parent instanceof IPackageFragment) {
					IPackageFragment fragment = (IPackageFragment) parent;
					if (isEmpty(fragment) && hasSingleChild(fragment)) {
						return filterParent(getActualParent(fragment));
					}
				}
			} catch (JavaModelException e) {
				JavaPlugin.log(e);
			}
		}
		return parent;
	}
	private boolean hasSingleChild(IPackageFragment fragment) {
		return getChildren(fragment).length==1;
	}
	private Object findNextLevelChildrenByElementName(IJavaElement child, IJavaElement parent) {
		String name= child.getElementName();
		
		if(name.indexOf(".")==-1) 
			return parent;