Name: akC45999 Date: 12/02/97
The section 6.4 "Java Virtual Machine Instruction Set" of JVM spec reads:
Next, the Java Virtual Machine determines if all of the following conditions are true:
The name of the method is not <init>, an instance initialization method (?3.8).
The method is not a private method.
The class of the method is a superclass of the class of the current method.
The ACC_SUPER flag (see Table 4.1, "Class access and modifier flags") is set for the current class.
Then it described the cases when the method is <init> and the method is protected,
but does not describe what if
- the method is public or has the default (package) access scope
- the class of the method is not a superclass of the current class
- the ACC_SUPER flag is not set for the current class
I noticed jdk1.1 allows invokespecial to invoke a method from a class which is not
a superclas of the current class, and jdk1.2 does not. Evidently, at least one of the
implementations has an error, but I cannot file a bug report because cannot find
corresponding assertion in the JVM specification, and cannot write compatibility
tests against this case.