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

Class data sharing code loses package information

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 5.0
    • 5.0
    • hotspot
    • b29
    • generic
    • generic

    Description

      When a shared archive is constructed and reloaded, the PackageInfo hash table
      contained in src/share/vm/runtime/classLoader.cpp is lost. This causes
      subsequent calls to java.lang.Package.getSystemPackage() to return null where
      they used to return a Package object.

      There are a fair number of implicit assumptions in the Package code that if a
      class is loaded from a flat file (rather than from a directory) then it is
      contained in a jar file. These assumptions will be violated if the shared
      archive's file name is placed inside the PackageInfo. However, this will not
      cause the Java-level package code to break, only to throw exceptions internally
      and return null for some values. Plausibly the shared archive should record the
      package information in one of its sections, though this is not high priority
      as null is a valid return value from Class.getPackage().

      Attachments

        Issue Links

          Activity

            People

              foliversunw Fred Oliver (Inactive)
              kbr Kenneth Russell (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: