[Bug report] "invalid" class files in openjdk6
Vincent.Monfort at inria.fr
Wed Sep 14 01:21:18 PDT 2011
I preferred post this message on a bug tracker but I did not find one
for open-jdk ...
I actually working on a static analysis tool for java bytecode
(http://sawja.inria.fr/) and this tool checks some properties described
by the VM Specification on the class File Format
for the flags on a class file.
It seems that some of the class files included in the jre archive:
"rt.jar" of the open-jdk distribution do not comply with this
specification (checked on jdk 1.6 18 and 20).
The class files concerned are "package-info.class" files that could be
used for documentation and annotation on a package, but since annotation
could be used at runtime level it must respects class File Format ...
Moreover the Oracle jdk distribution does not have the same issue.
The problem is the following for these classes the flags ACC_INTERFACE
is set and not the ACC_ABSTRACT and it does not comply with the
specification (regarding the revised version of class File Format
"An interface is distinguished by its ACC_INTERFACE flag
being set. If its ACC_INTERFACE flag is not set, this class file
defines a class, not an interface.
_If the ACC_INTERFACE flag of this class file is set, its
ACC_ABSTRACT flag must also be set_ (§2.13.1) and its
ACC_PUBLIC flag may be set. Such a class file must not have any
of the other flags in Table 4.1 set.
An annotation type must have its ACC_ANNOTATION flag
set. If the ACC_ANNOTATION flag is set, the
ACC_INTERFACE flag must be set as well."
The exact class files concerned are the following in both 18 and 20
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jdk6-dev