String key= getKey(frag); Object object= fMapToCompoundElement.get(key);  if (object instanceof LogicalPackage) { LogicalPackage element= (LogicalPackage) object; element.remove(frag); if (element.getFragments().length == 1) { IPackageFragment fragment= element.getFragments()[0]; fMapToCompoundElement.put(key, fragment); postRemove(element);
if(lp != null){ lp.remove(frag);    if (lp.getFragments().length == 1) { IPackageFragment fragment= lp.getFragments()[0]; fMapToPackageFragments.put(key, fragment); fMapToLogicalPackage.remove(key);   postRemove(lp);
	private void removeElement(IPackageFragment frag) {		if (fMapToCompoundElement == null) {			postRemove(frag);			return;		}		String key= getKey(frag);		Object object= fMapToCompoundElement.get(key);		if (object instanceof LogicalPackage) {			LogicalPackage element= (LogicalPackage) object;			element.remove(frag);			if (element.getFragments().length == 1) {				IPackageFragment fragment= element.getFragments()[0];				fMapToCompoundElement.put(key, fragment);				postRemove(element);				Object parent= getParent(fragment);				if (parent instanceof IPackageFragmentRoot) {					IPackageFragmentRoot root= (IPackageFragmentRoot) parent;					parent= root.getJavaProject();				}				postAdd(fragment, parent);			}		} else if (object instanceof IPackageFragment) {			IPackageFragment fragment= (IPackageFragment) object;			if (fragment.equals(frag)) {				fMapToCompoundElement.remove(key);				postRemove(frag);			}		}	}