Merge
authorlana
Thu, 14 Oct 2010 11:07:15 -0700
changeset 6893 cc3460420e3d
parent 6892 d954b585d3a1 (current diff)
parent 6891 f8a528363fa5 (diff)
child 6894 361524087cdb
Merge
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java	Wed Oct 13 17:51:41 2010 -0700
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java	Thu Oct 14 11:07:15 2010 -0700
@@ -216,7 +216,9 @@
 
     // Returns the Max Version String of this implementation
     static String getVersionString() {
-        return "Pack200, Vendor: Sun Microsystems, Version: " +
+        return "Pack200, Vendor: " +
+            System.getProperty("java.vendor") +
+            ", Version: " +
             Constants.JAVA6_PACKAGE_MAJOR_VERSION + "." +
             Constants.JAVA6_PACKAGE_MINOR_VERSION;
     }
--- a/jdk/test/tools/pack200/PackageVersionTest.java	Wed Oct 13 17:51:41 2010 -0700
+++ b/jdk/test/tools/pack200/PackageVersionTest.java	Thu Oct 14 11:07:15 2010 -0700
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @bug 6712743
+ * @bug 6712743 6991164
  * @summary verify package versions
  * @compile -XDignore.symbol.file Utils.java PackageVersionTest.java
  * @run main PackageVersionTest
@@ -40,6 +40,7 @@
 import java.util.jar.JarFile;
 import java.util.jar.Pack200;
 import java.util.jar.Pack200.Packer;
+import java.util.jar.Pack200.Unpacker;
 
 public class PackageVersionTest {
     private static final File  javaHome = new File(System.getProperty("java.home"));
@@ -60,6 +61,7 @@
         createClassFile("Test6");
         createClassFile("Test7");
 
+        verify6991164();
         verifyPack("Test5.class", JAVA5_PACKAGE_MAJOR_VERSION,
                 JAVA5_PACKAGE_MINOR_VERSION);
 
@@ -75,6 +77,18 @@
                 JAVA5_PACKAGE_MINOR_VERSION);
     }
 
+    static void verify6991164() {
+        Unpacker unpacker = Pack200.newUnpacker();
+        String versionStr = unpacker.toString();
+        String expected = "Pack200, Vendor: " +
+                System.getProperty("java.vendor") + ", Version: " +
+                JAVA6_PACKAGE_MAJOR_VERSION + "." + JAVA6_PACKAGE_MINOR_VERSION;
+        if (!versionStr.equals(expected)) {
+            System.out.println("Expected: " + expected);
+            System.out.println("Obtained: " + versionStr);
+            throw new RuntimeException("did not get expected string " + expected);
+        }
+    }
 
     static void createClassFile(String name) {
         createJavaFile(name);