Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4256589

ClassLoader.getPackage and Package.get* methods do not work correctly?

XMLWordPrintable

    • kestrel
    • generic
    • generic
    • Verified


      On Kestrel,
      When package is defined by ClassLoader.definePackage correctly,
      1)only "name" is returned by ClassLoader.getPackage.
      2)Package information can not get by Package.get* methods and
      null is returned.
      (ex.getSpecificationTitle, getSpecificationVersion....)
      3) Package.isCompatibleWith() causes NumberFormatException


      On the other hand, package is defined as same way, on Cricket
      1)"name", "tilte" and "version" are returned by ClassLoader.getPackage
      2)Package information is get by Package.get* methods
      3) Package.isCompatibleWith() returns true


      To reproduce,

      1)Extract attached file.
      2)Run PackageTest
      3)You can see the result

      The part of the result is as below;

      *********result of ClassLoader.getPackage :package cat
      Name :cat
      --- Package.getSpecificationTitle()
      SpecificationTitle :null
      --- Package.getSpecificationVersion()
      SpecificationVersion :null
      --- Package.getSpecificationVendor()
      SpecificationVendor :null
      --- Package.getImplementationTitle()
      ImplementationTitle :null
      --- Package.getImplementationVersion()
      ImplementationVersion :null
      --- Package.getImplementationVendor()
      ImplementationVendor :null
      --- Package.isCompatibleWith()
      !!!exception : java.lang.NumberFormatException: Empty version string
      --- Package.toString()

            zlisunw Zhenghua Li (Inactive)
            eishidasunw Etsuko Ishida (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: