The specification of the synthetic attribute in JVMS 4.7.6, states:
A class member that does not appear in the source code must be marked using a Synthetic attribute.This is inaccurate with respect to both JLS 2nd edition and the reference implementation. The text should be revised to state
A class member that does not appear in the source code must be marked using a Synthetic attribute, except for the default constructor and the class initialization method.
The lookup algorithm used by the invokevirtual
instruction
(pages 291-292 of the JVMS, 2nd edition) should be revised as follows:
Let C be the class of the target of the method invocation. The actual method to be invoked is selected by the following lookup procedure:The text highlighted in red is the only change. It replaces the textIf C contains a declaration for an instance method M with the same name and descriptor as the resolved method, and M overrides the resolved method , then M is the method to be invoked, and the lookup procedure terminates.
Otherwise, if C has a superclass, this same lookup procedure is performed recursively using the direct superclass of C ; the method to be invoked is the result of the recursive invocation of this lookup procedure.
Otherwise, an AbstractMethodError is raised.
and the resolved method is accessible from C
in the current specification. See the revision
of the definition
of method override in the JLS 3rd Edition page
for more details.
The following changes to the Java Virtual Machine Specification
Second Edition are planned were made in JDK 1.5. These changes are part
of JSR45 and
JSR 924
putfield and putstatic
instructions have slight modifications as a result of JSR133. The
changes to the specification are given in revisions
to "The Java Virtual Machine Instruction Set" (1954k PDF).
| Copyright © 1995-2005 Sun
Microsystems, Inc. All Rights Reserved. Legal Terms. Privacy Policy. |
|