Bug 26354 Errors Deleting packages in PackageExplorer
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageFragmentProvider.java
IJavaElement parent = fragment.getParent();
				if ((parent instanceof IPackageFragmentRoot) && parent.exists()) {
					IPackageFragmentRoot root = (IPackageFragmentRoot) parent;
					if (root.isArchive()) {
						return findNextLevelChildrenByElementName(fragment, root);
					} else {
						IResource resource = fragment.getUnderlyingResource();
						if ((resource != null) && (resource instanceof IFolder)) {
							IFolder folder = (IFolder) resource;
							IResource res = folder.getParent();
							IJavaElement el = JavaCore.create(res);
							return el;
						}
					}
					return parent;
				}
			}
		} 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));