Sponsored Link •
|
Advertisement
|
CONSTANT_Fieldref_info
EntriesTo resolve a constant pool entry of type CONSTANT_Fieldref_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_Fieldref_info
. If resolution of the
CONSTANT_Class_info
entry succeeds, the virtual machine searches for the
indicated field in the type and its supertypes. If it finds the indicated field, the virtual machine checks to
make sure the current class has permission to access the field.
If resolution to the CONSTANT_Class_info
completes successfully, the virtual
machine performs the field lookup process using these steps:
If the virtual machine discovers there is no field with the proper name and type in the referenced class or
any of its supertypes (if field lookup failed), the virtual machine throws
NoSuchFieldError
. Otherwise, if the field lookup succeeds, but the current class
doesn't have permission to access the field, the virtual machine throws
IllegalAccessError
.
Otherwise, the virtual machine marks the entry as resolved and places a direct reference to the field in the data for the constant pool entry.
Sponsored Links
|