Hello,
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 <http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html> 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 <http://java.sun.com/docs/books/jvms/second_edition/ClassFileFormat-Java5.pdf>) indicating:
"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 versions:
com.sun.istack.internal.package-info
com.sun.xml.internal.bind.api.package-info
com.sun.xml.internal.bind.v2.package-info
com.sun.xml.internal.bind.v2.runtime.output.package-info
com.sun.xml.internal.bind.v2.schemagen.package-info
com.sun.xml.internal.ws.api.message.package-info
com.sun.xml.internal.ws.api.package-info
com.sun.xml.internal.ws.api.pipe.helper.package-info
com.sun.xml.internal.ws.api.pipe.package-info
com.sun.xml.internal.ws.api.server.package-info
com.sun.xml.internal.ws.api.wsdl.parser.package-info
com.sun.xml.internal.ws.client.package-info
com.sun.xml.internal.ws.developer.package-info
com.sun.xml.internal.ws.message.jaxb.package-info
com.sun.xml.internal.ws.message.package-info
com.sun.xml.internal.ws.package-info
com.sun.xml.internal.ws.server.package-info

Best regards

Reply via email to