changeset 2925:5cd4f89b8339

6991164: pack source needs vendor rebranding changes (jdk7 only) Reviewed-by: ohair, jrose
author ksrini
date Thu, 14 Oct 2010 09:36:05 -0700
parents 1b430727f00d
children 078723d34a6c
files src/share/classes/com/sun/java/util/jar/pack/Utils.java test/tools/pack200/PackageVersionTest.java
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/java/util/jar/pack/Utils.java	Tue Oct 12 17:05:28 2010 -0700
+++ b/src/share/classes/com/sun/java/util/jar/pack/Utils.java	Thu Oct 14 09:36:05 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/test/tools/pack200/PackageVersionTest.java	Tue Oct 12 17:05:28 2010 -0700
+++ b/test/tools/pack200/PackageVersionTest.java	Thu Oct 14 09:36:05 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);