This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
A package-info.class is not loaded from an NB module in Java 9 anymore. The internal implementaiton of Package.getAnnotation changed in Java 9 in order to support modules. In Java 9, the class package-info.class is loaded using a module name. When running old (Java 8) code an unnamed module is used and the ClassLoader's (Java 9) method loadClass(Module module, String name) delegates to findClass(String name) which is not overriden by ProxyClassLoader. As can be seen, the loadClass(String mame) method is bypassed when using Java 9.
Created attachment 165536 [details] Basic findClass implementation for JarClassLoader This patch modifies JarClassLoader such that it overrides ClassLoader#findClass(String name) method. The findClass employs doLoadClass directly. This implementation seems to be correct w.r.t. the Reflection API, since when a class is explored a class loader which loaded it is used. In the platform, this should be the class loader of the module to which the class belongs. Also the relevant package-info should belong to the same module. This implementation will probably break when the platform is modularized using Java 9 modules. But in this case, the ProxyClassLoader will break anyway since then the loading will not take code path through ProxyClassLoader#loadClass(String, boolean).