if (element instanceof IJavaElement) return ((IJavaElement)element).getParent();
if (element instanceof IJavaElement) { IJavaElement candidate= ((IJavaElement)element).getParent();   if (candidate != null && candidate.getElementType() == IJavaElement.COMPILATION_UNIT) { ICompilationUnit unit= (ICompilationUnit)candidate; if (unit.isWorkingCopy()) candidate= unit.getOriginalElement(); } return candidate; }
	protected Object internalGetParent(Object element) {		if (element instanceof IJavaProject) {			return ((IJavaProject)element).getJavaModel();		}		// try to map resources to the containing package fragment		if (element instanceof IResource) {			IResource parent= ((IResource)element).getParent();			Object packageFragment= JavaCore.create(parent);			if (packageFragment != null) 				return packageFragment;			return parent;		}		// for package fragments that are contained in a project package fragment		// we have to skip the package fragment root as the parent.		if (element instanceof IPackageFragment) {			IPackageFragmentRoot parent= (IPackageFragmentRoot)((IPackageFragment)element).getParent();			return skipProjectPackageFragmentRoot(parent);		}		if (element instanceof IJavaElement)			return ((IJavaElement)element).getParent();		return null;	}