JDK-8237604 : [TEST_BUG] sun/security/tools/jarsigner/EntriesOrder.java not adapted for changes in JDK-7194449
  • Type: Bug
  • Component: tools
  • Affected Version: openjdk7u
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2020-01-22
  • Updated: 2020-02-26
  • Resolved: 2020-02-26
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.
Other
openjdk7u masterFixed
Related Reports
Relates :  
Relates :  
Description
The sequencing of JDK-7194449 and JDK-8031572 in OpenJDK 7 has led to the EntriesOrder.java test introduced by JDK-8031572 not being adapted to keytool and jarsigner now being in their own packages:

----------System.err:(11/541)----------
/home/andrew/projects/openjdk/upstream/jdk7/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java:78: error: cannot find symbol
        sun.security.tools.KeyTool.main(
                          ^
  symbol:   class KeyTool
  location: package sun.security.tools
/home/andrew/projects/openjdk/upstream/jdk7/jdk/test/sun/security/tools/jarsigner/EntriesOrder.java:81: error: cannot find symbol
        sun.security.tools.JarSigner.main(
                          ^
  symbol:   class JarSigner
  location: package sun.security.tools
2 errors
result: Failed. Compilation failed: Compilation failed

In 8u:

JDK-7194449 is introduced on 2012-10-14
JDK-8031572 is introduced on 2014-01-21

sun.security.tools.{keytool,jarsigner}.Main classes

In 7u:

JDK-8031572 is introduced on 2014-01-21 (as with 8u)
JDK-7194449 is introduced on 2016-13-07

so the version of 8031572 in 7u uses sun.security.tools.JarSigner & sun.security.tools.KeyTool, as this was correct for 7u in 2014, and this wasn't fixed when 7194449 was backported in 2016, because the original patch in 8u predated 8031572, being from 2012.

It's easily fixed from a diff of the 7u & 8u versions:

@@ -70,10 +75,10 @@
         if (!m.run("cvf a.jar a META-INF/inf".split(" "))) {
             throw new Exception("jar creation failed");
         }
-        sun.security.tools.KeyTool.main(
+        sun.security.tools.keytool.Main.main(
                 ("-keystore jks -storepass changeit -keypass changeit -dname" +
                         " CN=A -alias a -genkeypair -keyalg rsa").split(" "));
-        sun.security.tools.JarSigner.main(
+        sun.security.tools.jarsigner.Main.main(
                 "-keystore jks -storepass changeit a.jar a".split(" "));
         m = new sun.tools.jar.Main(System.out, System.err, "jar");
         if (!m.run("xvf a.jar".split(" "))) {

Comments
URL: https://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/99716de3d25e User: andrew Date: 2020-02-26 05:54:12 +0000
26-02-2020