Name: akC45999 Date: 04/23/98
The description of getfield instruction in JVMS says that:
"If the field is protected, then it must be either a member of the current class
or a member of a superclass of the current class, and the class of objectref
must be either the current class or a subclass of the current class."
However, JLS (6.6.1) allows access also from within the same package:
"Otherwise, if the member or constructor is declared protected, then access is
permitted only when one of the following is true:
Access to the member or constructor occurs from within the package
containing the class in which the protected member is declared...
Access occurs within a subclass of the class in which the protected
member is declared ..."
The descriptions of getstatic, putfield, putstatic, invokespecial, invokestatic and
invokevirtual in JVMS are in quite similar contradictions with JLS.
Note that the actual behavior of the jdk VM (1.2beta3) is in compliance
with the JLS.
======================================================================
======================================================================