8189331: java/io/Serializable/maskSyntheticModifier/MaskSyntheticModifierTest.java failed incorrect serialVersionUID
authorrriggs
Thu, 30 Nov 2017 16:38:31 -0500
changeset 48033 47b764e0a38a
parent 48032 9240097e2821
child 48034 81b5e3f70d98
8189331: java/io/Serializable/maskSyntheticModifier/MaskSyntheticModifierTest.java failed incorrect serialVersionUID Reviewed-by: lancea
test/jdk/java/io/Serializable/maskSyntheticModifier/MaskSyntheticModifierTest.java
--- a/test/jdk/java/io/Serializable/maskSyntheticModifier/MaskSyntheticModifierTest.java	Thu Nov 30 13:29:50 2017 -0800
+++ b/test/jdk/java/io/Serializable/maskSyntheticModifier/MaskSyntheticModifierTest.java	Thu Nov 30 16:38:31 2017 -0500
@@ -30,6 +30,7 @@
  *          serialVersionUID calculation.
  */
 
+import java.io.File;
 import java.io.ObjectStreamClass;
 import java.nio.file.Files;
 import java.nio.file.Paths;
@@ -46,7 +47,10 @@
     }
 
     private static void setup() throws Exception {
+        // Copy the class file to the first component of the class path
+        String cp = System.getProperty("java.class.path");
+        String cp1 = cp.substring(0, cp.indexOf(File.pathSeparatorChar));
         Files.copy(Paths.get(System.getProperty("test.src"), "Foo.class"),
-                Paths.get("Foo.class"), StandardCopyOption.REPLACE_EXISTING);
+                Paths.get(cp1, "Foo.class"), StandardCopyOption.REPLACE_EXISTING);
     }
 }