Top Description Inners Fields Constructors Methods
java.lang.invoke

pack-priv final Class MemberName

extends Object
implements Member, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.lang.reflect.Member
Imports
sun.invoke.util.VerifyAccess, java.lang.reflect.Constructor, .Field, .Member, .Method, .Modifier, java.util.Objects

A MemberName is a compact symbolic datum which fully characterizes a method or field reference. A member name refers to a field, method, constructor, or member type. Every member name has a simple name (a string) and a type (either a Class or MethodType). A member name may also have a non-null declaring class, or it may be simply a naked name/type pair. A member name may also have non-zero modifier flags. Finally, a member name may be either resolved or unresolved. If it is resolved, the existence of the named member has been determined by the JVM.

Whether resolved or not, a member name provides no access rights or invocation capability to its possessor. It is merely a compact representation of all symbolic information necessary to link to and properly use the named member.

When resolved, a member name's internal implementation may include references to JVM metadata. This representation is stateless and only descriptive. It provides no private information and no capability to use the member.

By contrast, a java.lang.reflect.Method contains fuller information about the internals of a method (except its bytecodes) and also allows invocation. A MemberName is much lighter than a Method, since it contains about 7 fields to the 16 of Method (plus its sub-arrays), and those seven fields omit much of the information in Method.

Author
jrose

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
MemberName.Factory

A factory type for resolving member names with the help of the VM.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
private Class<?>
pack-priv static final String
pack-priv static final int
private int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
private ResolvedMethodName
private static final int
private String
pack-priv static final int
pack-priv Object
pack-priv static final int
pack-priv static final int
private Object
pack-priv static final int

Constructor Summary

AccessConstructor and Description
public
MemberName(Method m)

Create a name for the given reflected method.

public
MemberName(Method m, boolean wantSpecial)

public
MemberName(Constructor<?> ctor)

Create a name for the given reflected constructor.

public
MemberName(Field fld)

Create a name for the given reflected field.

public
MemberName(Field fld, boolean makeSetter)

public
MemberName(Class<?> type)

Create a name for the given class.

pack-priv
public
MemberName(Class<?> defClass, String name, Class<?> type, byte refKind)

Create a field or type name from the given components: Declaring class, name, type, reference kind.

public
MemberName(Class<?> defClass, String name, MethodType type, byte refKind)

Create a method or constructor name from the given components: Declaring class, name, type, reference kind.

public
MemberName(byte refKind, Class<?> defClass, String name, Object type)

Create a method, constructor, or field name from the given components: Reference kind, declaring class, name, type.

Method Summary

Modifier and TypeMethod and Description
private boolean
allFlagsSet(int flags)

private boolean
anyFlagSet(int flags)

public MemberName
asConstructor()

If this MN is not REF_newInvokeSpecial, return a clone with that ref.

public MemberName
asNormalOriginal()

If this MN is a REF_invokeSpecial, return a clone with the "normal" kind REF_invokeVirtual; also switch either to REF_invokeInterface if clazz.isInterface.

public MemberName
public boolean
canBeStaticallyBound()

Utility method to query whether this member or its defining class is final.

private MemberName
changeReferenceKind(byte refKind, byte oldKind)

protected MemberName
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

pack-priv void
public boolean
equals(Object
the reference object with which to compare.
that
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public boolean
equals(MemberName that)

Decide if two member names have exactly the same symbolic content.

private void
expandFromVM()

Calls down to the VM to fill in the fields.

private static int
flagsMods(int flags, int mods, byte refKind)

public ClassLoader
getClassLoader()

Utility method producing the class loader of the declaring class.

public Class<?>
getDeclaringClass()

Implements java.lang.reflect.Member.getDeclaringClass.

Return the declaring class of this member.

public MemberName
getDefinition()

Get the definition of this member name.

pack-priv static MemberName.Factory
getFactory()

Actually making a query requires an access check.

public Class<?>
getFieldType()

Return the declared type of this member, which must be a field or type.

public MethodType
getInvocationType()

Return the actual type under which this method or constructor must be invoked.

pack-priv String
getMethodDescriptor()

Return the descriptor of this member, which must be a method or constructor.

public MethodType
public MethodType
getMethodType()

Return the declared type of this member, which must be a method or constructor.

public int
getModifiers()

Implements java.lang.reflect.Member.getModifiers.

Return the modifier flags of this member.

public String
getName()

Implements java.lang.reflect.Member.getName.

Return the simple name of this member.

private static String
public byte
getReferenceKind()

Return the reference kind of this member, or zero if none.

public Object
getType()

Utility method to produce either the method type or field type of this member.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

private void
init(Class<?> defClass, String name, Object type, int flags)

Initialize a query.

pack-priv void
initResolved(boolean isResolved)

public boolean
isAbstract()

Utility method to query the modifier flags of this member.

public boolean
isBridge()

Utility method to query the modifier flags of this member; returns false if the member is not a method.

public boolean
isCallerSensitive()

Query whether this member has a CallerSensitive annotation.

public boolean
isConstructor()

Query whether this member is a constructor.

public boolean
isField()

Query whether this member is a field.

public boolean
isFinal()

Utility method to query the modifier flags of this member.

public boolean
public boolean
isInvocable()

Utility method to query whether this member is a method or constructor.

public boolean
isMethod()

Query whether this member is a method.

public boolean
isMethodHandleInvoke()

Utility method to query if this member is a method handle invocation (invoke or invokeExact).

public static boolean
public boolean
isNative()

Utility method to query the modifier flags of this member.

private boolean
public boolean
isPackage()

Utility method to query whether this member is neither public, private, nor protected.

public boolean
isPrivate()

Utility method to query the modifier flags of this member.

public boolean
isProtected()

Utility method to query the modifier flags of this member.

public boolean
isPublic()

Utility method to query the modifier flags of this member.

public boolean
isResolved()

Query whether this member name is resolved.

public boolean
public boolean
isStatic()

Utility method to query the modifier flags of this member.

public boolean
isSynthetic()

Implements java.lang.reflect.Member.isSynthetic.

Utility method to query the modifier flags of this member; returns false if the member is not a method.

public boolean
isTrustedFinalField()

Query whether this member is a trusted final field.

public boolean
isType()

Query whether this member is a type.

public boolean
isVarargs()

Utility method to query the modifier flags of this member; returns false if the member is not a method.

public boolean
public static boolean
public boolean
isVolatile()

Utility method to query the modifier flags of this member.

public IllegalAccessException
public ReflectiveOperationException
pack-priv static MemberName
makeMethodHandleInvoke(String name, MethodType type)

Create a name for a signature-polymorphic invoker.

pack-priv static MemberName
pack-priv static MemberName
pack-priv static MemberName
private boolean
matchingFlagsSet(int mask, int flags)

private String
private boolean
pack-priv boolean
referenceKindIsConsistentWith(int originalRefKind)

public boolean
refersTo(Class<?> declc, String n)

Check if MemberName is a call to a method named name in class declaredClass.

private boolean
public String
toString()

Overrides java.lang.Object.toString.

Produce a string form of this member name.

private boolean
Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

ALL_ACCESSback to summary
pack-priv static final int ALL_ACCESS
ALL_KINDSback to summary
pack-priv static final int ALL_KINDS
ANNOTATIONback to summary
pack-priv static final int ANNOTATION
BRIDGEback to summary
pack-priv static final int BRIDGE
CALLER_SENSITIVEback to summary
pack-priv static final int CALLER_SENSITIVE
clazzback to summary
private Class<?> clazz
CONSTRUCTOR_NAMEback to summary
pack-priv static final String CONSTRUCTOR_NAME
ENUMback to summary
pack-priv static final int ENUM
flagsback to summary
private int flags
IS_CONSTRUCTORback to summary
pack-priv static final int IS_CONSTRUCTOR
IS_FIELDback to summary
pack-priv static final int IS_FIELD
IS_INVOCABLEback to summary
pack-priv static final int IS_INVOCABLE
IS_METHODback to summary
pack-priv static final int IS_METHOD
IS_TYPEback to summary
pack-priv static final int IS_TYPE
methodback to summary
private ResolvedMethodName method
MH_INVOKE_MODSback to summary
private static final int MH_INVOKE_MODS
nameback to summary
private String name
RECOGNIZED_MODIFIERSback to summary
pack-priv static final int RECOGNIZED_MODIFIERS
resolutionback to summary
pack-priv Object resolution
SYNTHETICback to summary
pack-priv static final int SYNTHETIC
TRUSTED_FINALback to summary
pack-priv static final int TRUSTED_FINAL
typeback to summary
private Object type
VARARGSback to summary
pack-priv static final int VARARGS

Constructor Detail

MemberNameback to summary
public MemberName(Method m)

Create a name for the given reflected method. The resulting name will be in a resolved state.

MemberNameback to summary
public MemberName(Method m, boolean wantSpecial)
Annotations
@SuppressWarnings:LeakingThisInConstructor
MemberNameback to summary
public MemberName(Constructor<?> ctor)

Create a name for the given reflected constructor. The resulting name will be in a resolved state.

Annotations
@SuppressWarnings:LeakingThisInConstructor
MemberNameback to summary
public MemberName(Field fld)

Create a name for the given reflected field. The resulting name will be in a resolved state.

MemberNameback to summary
public MemberName(Field fld, boolean makeSetter)
Annotations
@SuppressWarnings:LeakingThisInConstructor
MemberNameback to summary
public MemberName(Class<?> type)

Create a name for the given class. The resulting name will be in a resolved state.

MemberNameback to summary
pack-priv MemberName()
MemberNameback to summary
public MemberName(Class<?> defClass, String name, Class<?> type, byte refKind)

Create a field or type name from the given components: Declaring class, name, type, reference kind. The declaring class may be supplied as null if this is to be a bare name and type. The resulting name will in an unresolved state.

MemberNameback to summary
public MemberName(Class<?> defClass, String name, MethodType type, byte refKind)

Create a method or constructor name from the given components: Declaring class, name, type, reference kind. It will be a constructor if and only if the name is "<init>". The declaring class may be supplied as null if this is to be a bare name and type. The last argument is optional, a boolean which requests REF_invokeSpecial. The resulting name will in an unresolved state.

MemberNameback to summary
public MemberName(byte refKind, Class<?> defClass, String name, Object type)

Create a method, constructor, or field name from the given components: Reference kind, declaring class, name, type.

Method Detail

allFlagsSetback to summary
private boolean allFlagsSet(int flags)
anyFlagSetback to summary
private boolean anyFlagSet(int flags)
asConstructorback to summary
public MemberName asConstructor()

If this MN is not REF_newInvokeSpecial, return a clone with that ref. kind. In that case it must already be REF_invokeSpecial.

asNormalOriginalback to summary
public MemberName asNormalOriginal()

If this MN is a REF_invokeSpecial, return a clone with the "normal" kind REF_invokeVirtual; also switch either to REF_invokeInterface if clazz.isInterface. The end result is to get a fully virtualized version of the MN. (Note that resolving in the JVM will sometimes devirtualize, changing REF_invokeVirtual of a final to REF_invokeSpecial, and REF_invokeInterface in some corner cases to either of the previous two; this transform undoes that change under the assumption that it occurred.)

asSpecialback to summary
public MemberName asSpecial()
canBeStaticallyBoundback to summary
public boolean canBeStaticallyBound()

Utility method to query whether this member or its defining class is final.

changeReferenceKindback to summary
private MemberName changeReferenceKind(byte refKind, byte oldKind)
cloneback to summary
protected MemberName clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:MemberName

a clone of this instance.

Annotations
@Override
ensureTypeVisibleback to summary
pack-priv void ensureTypeVisible(Class<?> refc)
equalsback to summary
public boolean equals(Object that)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
that:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
equalsback to summary
public boolean equals(MemberName that)

Decide if two member names have exactly the same symbolic content. Does not take into account any actual class members, so even if two member names resolve to the same actual member, they may be distinct references.

expandFromVMback to summary
private void expandFromVM()

Calls down to the VM to fill in the fields. This method is synchronized to avoid racing calls.

flagsModsback to summary
private static int flagsMods(int flags, int mods, byte refKind)
getClassLoaderback to summary
public ClassLoader getClassLoader()

Utility method producing the class loader of the declaring class.

getDeclaringClassback to summary
public Class<?> getDeclaringClass()

Implements java.lang.reflect.Member.getDeclaringClass.

Return the declaring class of this member. In the case of a bare name and type, the declaring class will be null.

Returns:Class<?>

Doc from java.lang.reflect.Member.getDeclaringClass.

an object representing the declaring class of the underlying member

getDefinitionback to summary
public MemberName getDefinition()

Get the definition of this member name. This may be in a super-class of the declaring class of this member.

getFactoryback to summary
pack-priv static MemberName.Factory getFactory()

Actually making a query requires an access check.

getFieldTypeback to summary
public Class<?> getFieldType()

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.

getInvocationTypeback to summary
public MethodType getInvocationType()

Return the actual type under which this method or constructor must be invoked. For non-static methods or constructors, this is the type with a leading parameter, a reference to declaring class. For static methods, it is the same as the declared type.

getMethodDescriptorback to summary
pack-priv String getMethodDescriptor()

Return the descriptor of this member, which must be a method or constructor.

getMethodOrFieldTypeback to summary
public MethodType getMethodOrFieldType()
getMethodTypeback to summary
public MethodType getMethodType()

Return the declared type of this member, which must be a method or constructor.

getModifiersback to summary
public int getModifiers()

Implements java.lang.reflect.Member.getModifiers.

Return the modifier flags of this member.

Returns:int

Doc from java.lang.reflect.Member.getModifiers.

the Java language modifiers for the underlying member

See Also
java.lang.reflect.Modifier
getNameback to summary
public String getName()

Implements java.lang.reflect.Member.getName.

Return the simple name of this member. For a type, it is the same as Class#getSimpleName. For a method or field, it is the simple name of the member. For a constructor, it is always "<init>".

Returns:String

Doc from java.lang.reflect.Member.getName.

the simple name of the underlying member

getNameback to summary
private static String getName(Object obj)
getReferenceKindback to summary
public byte getReferenceKind()

Return the reference kind of this member, or zero if none.

getTypeback to summary
public Object getType()

Utility method to produce either the method type or field type of this member.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
@SuppressWarnings:deprecation, removal
initback to summary
private void init(Class<?> defClass, String name, Object type, int flags)

Initialize a query. It is not resolved.

initResolvedback to summary
pack-priv void initResolved(boolean isResolved)
isAbstractback to summary
public boolean isAbstract()

Utility method to query the modifier flags of this member.

isBridgeback to summary
public boolean isBridge()

Utility method to query the modifier flags of this member; returns false if the member is not a method.

isCallerSensitiveback to summary
public boolean isCallerSensitive()

Query whether this member has a CallerSensitive annotation.

isConstructorback to summary
public boolean isConstructor()

Query whether this member is a constructor.

isFieldback to summary
public boolean isField()

Query whether this member is a field.

isFinalback to summary
public boolean isFinal()

Utility method to query the modifier flags of this member.

isGetterback to summary
public boolean isGetter()
isInvocableback to summary
public boolean isInvocable()

Utility method to query whether this member is a method or constructor.

isMethodback to summary
public boolean isMethod()

Query whether this member is a method.

isMethodHandleInvokeback to summary
public boolean isMethodHandleInvoke()

Utility method to query if this member is a method handle invocation (invoke or invokeExact).

isMethodHandleInvokeNameback to summary
public static boolean isMethodHandleInvokeName(String name)
isNativeback to summary
public boolean isNative()

Utility method to query the modifier flags of this member.

isObjectPublicMethodback to summary
private boolean isObjectPublicMethod()
isPackageback to summary
public boolean isPackage()

Utility method to query whether this member is neither public, private, nor protected.

isPrivateback to summary
public boolean isPrivate()

Utility method to query the modifier flags of this member.

isProtectedback to summary
public boolean isProtected()

Utility method to query the modifier flags of this member.

isPublicback to summary
public boolean isPublic()

Utility method to query the modifier flags of this member.

isResolvedback to summary
public boolean isResolved()

Query whether this member name is resolved. A resolved member name is one for which the JVM has found a method, constructor, field, or type binding corresponding exactly to the name. (Document?)

isSetterback to summary
public boolean isSetter()
isStaticback to summary
public boolean isStatic()

Utility method to query the modifier flags of this member.

isSyntheticback to summary
public boolean isSynthetic()

Implements java.lang.reflect.Member.isSynthetic.

Utility method to query the modifier flags of this member; returns false if the member is not a method.

Returns:boolean

Doc from java.lang.reflect.Member.isSynthetic.

true if and only if this member was introduced by the compiler.

isTrustedFinalFieldback to summary
public boolean isTrustedFinalField()

Query whether this member is a trusted final field.

isTypeback to summary
public boolean isType()

Query whether this member is a type.

isVarargsback to summary
public boolean isVarargs()

Utility method to query the modifier flags of this member; returns false if the member is not a method.

isVarHandleMethodInvokeback to summary
public boolean isVarHandleMethodInvoke()
isVarHandleMethodInvokeNameback to summary
public static boolean isVarHandleMethodInvokeName(String name)
isVolatileback to summary
public boolean isVolatile()

Utility method to query the modifier flags of this member.

makeAccessExceptionback to summary
public IllegalAccessException makeAccessException(String message, Object from)
makeAccessExceptionback to summary
public ReflectiveOperationException makeAccessException()
makeMethodHandleInvokeback to summary
pack-priv static MemberName makeMethodHandleInvoke(String name, MethodType type)

Create a name for a signature-polymorphic invoker. This is a placeholder for a signature-polymorphic instance (of MH.invokeExact, etc.) that the JVM does not reify. See comments on MethodHandleNatives#linkMethod.

makeMethodHandleInvokeback to summary
pack-priv static MemberName makeMethodHandleInvoke(String name, MethodType type, int mods)
makeVarHandleMethodInvokeback to summary
pack-priv static MemberName makeVarHandleMethodInvoke(String name, MethodType type)
makeVarHandleMethodInvokeback to summary
pack-priv static MemberName makeVarHandleMethodInvoke(String name, MethodType type, int mods)
matchingFlagsSetback to summary
private boolean matchingFlagsSet(int mask, int flags)
messageback to summary
private String message()
referenceKindIsConsistentback to summary
private boolean referenceKindIsConsistent()
referenceKindIsConsistentWithback to summary
pack-priv boolean referenceKindIsConsistentWith(int originalRefKind)
refersToback to summary
public boolean refersTo(Class<?> declc, String n)

Check if MemberName is a call to a method named name in class declaredClass.

staticIsConsistentback to summary
private boolean staticIsConsistent()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Produce a string form of this member name. For types, it is simply the type's own string (as reported by toString). For fields, it is "DeclaringClass.name/type". For methods and constructors, it is "DeclaringClass.name(ptype...)rtype". If the declaring class is null, the prefix "DeclaringClass." is omitted. If the member is unresolved, a prefix "*." is prepended.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@SuppressWarnings:LocalVariableHidesMemberVariable
@Override
vminfoIsConsistentback to summary
private boolean vminfoIsConsistent()
java.lang.invoke back to summary

pack-priv Class MemberName.Factory

extends Object
Class Inheritance

A factory type for resolving member names with the help of the VM. TBD: Define access-safe public constructors for this factory.

Field Summary

Modifier and TypeField and Description
pack-priv static final MemberName.Factory

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private MemberName
resolve(byte refKind, MemberName ref, Class<?> lookupClass, int allowedModes, boolean speculativeResolve)

Produce a resolved version of the given member.

public <NoSuchMemberException extends ReflectiveOperationException> MemberName
resolveOrFail(byte refKind, MemberName m, Class<?> lookupClass, int allowedModes, Class<NoSuchMemberException> nsmClass)

Produce a resolved version of the given member.

public MemberName
resolveOrNull(byte refKind, MemberName m, Class<?> lookupClass, int allowedModes)

Produce a resolved version of the given member.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
pack-priv static final MemberName.Factory INSTANCE

Constructor Detail

Factoryback to summary
private Factory()

Method Detail

resolveback to summary
private MemberName resolve(byte refKind, MemberName ref, Class<?> lookupClass, int allowedModes, boolean speculativeResolve)

Produce a resolved version of the given member. Super types are searched (for inherited members) if searchSupers is true. Access checking is performed on behalf of the given lookupClass. If lookup fails or access is not permitted, null is returned. Otherwise a fresh copy of the given member is returned, with modifier bits filled in.

resolveOrFailback to summary
public <NoSuchMemberException extends ReflectiveOperationException> MemberName resolveOrFail(byte refKind, MemberName m, Class<?> lookupClass, int allowedModes, Class<NoSuchMemberException> nsmClass) throws IllegalAccessException, Class-:NoSuchMemberException

Produce a resolved version of the given member. Super types are searched (for inherited members) if searchSupers is true. Access checking is performed on behalf of the given lookupClass. If lookup fails or access is not permitted, a ReflectiveOperationException is thrown. Otherwise a fresh copy of the given member is returned, with modifier bits filled in.

resolveOrNullback to summary
public MemberName resolveOrNull(byte refKind, MemberName m, Class<?> lookupClass, int allowedModes)

Produce a resolved version of the given member. Super types are searched (for inherited members) if searchSupers is true. Access checking is performed on behalf of the given lookupClass. If lookup fails or access is not permitted, return null. Otherwise a fresh copy of the given member is returned, with modifier bits filled in.