JDK-8200530 : '\r' is not supported as "newline" in java.util.jar.Manifest.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-03-30
  • Updated: 2024-06-03
  • Resolved: 2018-06-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b17Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Jar Manifest Specifiction:

newline :                            CR LF | LF | CR (not followed by LF)

Test case:
-------------------------------------------------------------
    byte[] mbytes =
            ("Manifest-Version: 1.0\r\n" +
             "Created-By: 1.9.0-internal (Oracle Corporation)\r\n" +
             "key1: value1\n" +
             "key2: value2\r" +
             "key3: value3\r\n" +
             "key4: value4\n E\r\n" +
             "key5: value5\r\n E\r\n" +
             "key6: value6\r E\r\n" +
             "key7: value7\r \r\n" +
             "key8: value8 \r \r\n"
            ).getBytes();
   
        Manifest m = new Manifest(new ByteArrayInputStream(mbytes));
        Attributes attr = m.getMainAttributes();

        System.out.println("         attr:  ");
        attr.forEach((k, v) -> System.out.println("[" + k + "]  :  [" + v + "]"));
        System.out.println("          ----------------------");
----------------------------------------------------------------
Comments
URL: http://hg.openjdk.java.net/jdk/jdk/rev/1234ff7199c7 User: sherman Date: 2018-06-05 17:04:06 +0000
05-06-2018