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
buf.append(field.getElementName());
			
			if (getFlag(flags, F_APP_TYPE_SIGNATURE) && field.exists()) {
				buf.append(DECL_STRING);
				buf.append(Signature.toString(field.getTypeSignature()));
			}
			
			
			if (getFlag(flags, F_POST_QUALIFIED)) {
				buf.append(CONCAT_STRING);
				getTypeLabel(field.getDeclaringType(), T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf);
			}
			
		} catch (JavaModelException e) {
			JavaPlugin.log(e); 
		}			
	}
	
	/**
	 * Appends the label for a local variable to a StringBuffer.
	 * 
	 * @since 3.0
	 */	
	public static void getLocalVariableLabel(ILocalVariable localVariable, int flags, StringBuffer buf) {
		buf.append(Signature.toString(localVariable.getTypeSignature()));
		buf.append(' ');
		buf.append(localVariable.getElementName());
		
		buf.append(CONCAT_STRING);
		getElementLabel(localVariable.getParent(), M_PARAMETER_TYPES | M_FULLY_QUALIFIED | T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf);