Sponsored Link •
|
Advertisement
|
CONSTANT_Methodref_info
EntriesTo resolve a constant pool entry of type CONSTANT_Methodref_info
, the
virtual machine must first resolve the CONSTANT_Class_info
entry specified in the
class_index
item. Therefore, any error that can be thrown because of the resolution
of a CONSTANT_Class_info
can be thrown during the resolution of a
CONSTANT_Methodref_info
. If the resolution of the
CONSTANT_Class_info
entry succeeds, the virtual machine searches for the
indicated method in the type and its supertypes. If it finds the indicated method, the virtual machine checks
to make sure the current class has permission to access the method.
If resolution to the CONSTANT_Class_info
completes successfully, the virtual
machine performs method resolution using these steps:
IncompatibleClassChangeError
.
If the virtual machine discovers there is no method with the proper name, return type, and number and
types of parameters in the referenced class or any of its supertypes (if method lookup fails), the virtual
machine throws NoSuchMethodError
. Otherwise, if the method exists, but the
method is abstract, the virtual machine throws AbstractMethodError
. Otherwise,
if the method exists, but the current class doesn't have permission to access the method, the virtual machine
throws IllegalAccessError
.
Otherwise, the virtual machine marks the entry as resolved and places a direct reference to the method in the data for the constant pool entry.
Sponsored Links
|