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
IType declaringType= type.getDeclaringType();
			if (declaringType != null) {
				getTypeLabel(declaringType, T_CONTAINER_QUALIFIED, buf);
				buf.append('.');
			}
			IJavaElement parent= type.getParent();
			if (parent instanceof IMethod) {
				getMethodLabel((IMethod) parent, 0, buf);
				buf.append('.');
			}
		}
		
		String typeName= type.getElementName();
		if (typeName.length() == 0) { 
			try {
				String superclassName= Signature.getSimpleName(type.getSuperclassName());
				typeName= JavaUIMessages.getFormattedString("JavaElementLabels.anonym_type" , superclassName); 
			} catch (JavaModelException e) {
				
				typeName= JavaUIMessages.getString("JavaElementLabels.anonym"); 
			}
		}
		buf.append(typeName);
		
		
		if (getFlag(flags, T_POST_QUALIFIED)) {
			buf.append(CONCAT_STRING);
			IType declaringType= type.getDeclaringType();
			if (declaringType != null) {
				getTypeLabel(declaringType, T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf);