Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-3234

Apache NetBeans running on JDK 11 cannot access package classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 11.1
    • 11.3
    • None

    Description

      If a package-info element is defined in some package, it cannot be properly accessed at runtime:  
       
      java.lang.Package p = AnyClass.class.getPackage();
       
      should return a package object representing the actual package-info element of that package. It is, for example, used by the JAXB runtime to read XmlSchema annotations at package level. 
       
      This has been tested in oracle jdk11.0.4. Class java.lang.Package in Java 11 has a private field called "packageInfo" of type "Class<?>", which should hold a reference to the actual package-info class object, i.e. AnyPackage.package-info. In NetBeans, always wrongly references "java.lang.Package$1PackageInfoProxy", which is a fallback reference set if no actual package-info could be found. 
       
      The reason is most likely that neither 
       
      org.netbeans.JarClassLoader
      nor org.netbeans.ProxyClassLoader
      nor org.netbeans.StandardModule$OneModuleClassLoader (all in platform/o.n.bootstrap)
       
      override method "java.lang.ClassLoader.findClass(String name)". The default implementation throws an exceptions which causes the above fallback reference to be set. 
       
      This is a serious issue. If it is not fixed, the platform will not be fully comptabile, among others, with the JAXB RI and also JAX-WS RI. 

      Attachments

        Issue Links

          Activity

            People

              J Jason Clarke
              bheithecker Boris Heithecker
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m