Bug 48999 Anonym type can have field as parent
JavaElementLabels does only the 'is parent method' test
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLabels.java
IJavaElement parent= type.getParent();
				if (parent instanceof IMethod) {
					buf.append('.');
					getMethodLabel((IMethod) parent, 0, buf);
				}
			} else {
				getPackageFragmentLabel(type.getPackageFragment(), (flags & P_COMPRESSED), buf);
			}
		}
	}
	/**
	 * Appends the label for a declaration to a StringBuffer. Considers the D_* flags.
	 */	
	public static void getDeclararionLabel(IJavaElement declaration, int flags, StringBuffer buf) {
		if (getFlag(flags, D_QUALIFIED)) {
			IJavaElement openable= (IJavaElement) declaration.getOpenable();
			if (openable != null) {
				buf.append(getElementLabel(openable, CF_QUALIFIED | CU_QUALIFIED));
				buf.append('/');
			}	
		}
		if (declaration.getElementType() == IJavaElement.IMPORT_CONTAINER) {
			buf.append(JavaUIMessages.getString("JavaElementLabels.import_container")); 
		} else {
			buf.append(declaration.getElementName());
		}
		
		if (getFlag(flags, D_POST_QUALIFIED)) {
			IJavaElement openable= (IJavaElement) declaration.getOpenable();
			if (openable != null) {