/** * Return the declared type of this member, which must be a field or type. If it is a type member, * that type itself is returned. */ public Class<?> getFieldType() { if (type == null) { expandFromVM(); if (type == null) return null; } if (isInvocable()) throw newIllegalArgumentException("not a field or nested class, no simple type"); if (type instanceof Class<?>) { return (Class<?>) type; } if (type instanceof String) { String sig = (String) type; MethodType mtype = MethodType.fromMethodDescriptorString("()" + sig, getClassLoader()); Class<?> res = mtype.returnType(); this.type = res; return res; } throw new InternalError("bad field type " + type); }