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

JAR indexes should be allowed to specify JAR files that don't end in ".jar"

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
      jar
    • CPU:
      generic
    • OS:
      generic

      Description

      The current (1.4) JAR file specification lists the following grammar for JAR
      index files:

          index file : version-info blankline section*
          version-info : JarIndex-Version: version-number
          version-number : digit+{.digit+}*
          section : body blankline
          body : header name*
          header : char+.jar newline
          name : char+ newline
          char : any valid Unicode character except NULL, CR and LF
          blankline : newline newline
          newline : CR LF | LF | CR (not followed by LF)
          digit : {0-9}

      According to this grammar, each section header line must end in the characters
      ".jar". Since section headers are where JAR file names are specified in JAR
      file indexes, this means that JAR file indexes can only be used to index JAR
      files whose names end in ".jar". This is an arbitrary restriction that is not
      present elsewhere in the JDK: for instance, java.net.URLClassLoader interprets
      any URL path that doesn't end in the character '/' as referring to a jar file.
      Since the JDK does not require that jar files names end with ".jar", it seems
      overly restrictive for JAR indexes to do so.

      Furthermore, this restriction is unnecessary from the standpoint of parsing the
      JAR index file. Individual sections are already separated by blank lines, so
      each section header is clearly identifiable, even without the ".jar" suffix.

      Therefore, this RFE proposes that the JAR file specification be modified to
      allow section headers that do not end in ".jar". Specifically, the grammar
      production for "header" should be changed to:

          header : char+ newline

      Also, the sun.misc.JarIndex class, which is responsible for handling JAR file
      indexes, should be updated accordingly.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mwarressunw Michael Warres (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: