test/jdk/java/io/Serializable/maskSyntheticModifier/MaskSyntheticModifierTest.java
changeset 48033 47b764e0a38a
parent 47216 71c04702a3d5
equal deleted inserted replaced
48032:9240097e2821 48033:47b764e0a38a
    28  * @summary Verify that the presence of the JVM_ACC_SYNTHETIC bit in the
    28  * @summary Verify that the presence of the JVM_ACC_SYNTHETIC bit in the
    29  *          modifiers of fields and methods does not affect default
    29  *          modifiers of fields and methods does not affect default
    30  *          serialVersionUID calculation.
    30  *          serialVersionUID calculation.
    31  */
    31  */
    32 
    32 
       
    33 import java.io.File;
    33 import java.io.ObjectStreamClass;
    34 import java.io.ObjectStreamClass;
    34 import java.nio.file.Files;
    35 import java.nio.file.Files;
    35 import java.nio.file.Paths;
    36 import java.nio.file.Paths;
    36 import java.nio.file.StandardCopyOption;
    37 import java.nio.file.StandardCopyOption;
    37 
    38 
    44             throw new Error("incorrect serialVersionUID: " + suid);
    45             throw new Error("incorrect serialVersionUID: " + suid);
    45         }
    46         }
    46     }
    47     }
    47 
    48 
    48     private static void setup() throws Exception {
    49     private static void setup() throws Exception {
       
    50         // Copy the class file to the first component of the class path
       
    51         String cp = System.getProperty("java.class.path");
       
    52         String cp1 = cp.substring(0, cp.indexOf(File.pathSeparatorChar));
    49         Files.copy(Paths.get(System.getProperty("test.src"), "Foo.class"),
    53         Files.copy(Paths.get(System.getProperty("test.src"), "Foo.class"),
    50                 Paths.get("Foo.class"), StandardCopyOption.REPLACE_EXISTING);
    54                 Paths.get(cp1, "Foo.class"), StandardCopyOption.REPLACE_EXISTING);
    51     }
    55     }
    52 }
    56 }