--- old/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java 2018-01-30 10:43:45.517279118 -0800 +++ new/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java 2018-01-30 10:43:45.149279102 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8132734 8144062 8165723 + * @bug 8132734 8144062 8165723 8194070 * @summary Test the extended API and the aliasing additions in JarFile that * support multi-release jar files * @library /lib/testlibrary/java/util/jar /test/lib @@ -152,11 +152,12 @@ public Object[][] createVersionData() throws Exception { return new Object[][]{ {JarFile.baseVersion(), 8}, - {JarFile.runtimeVersion(), Runtime.version().major()}, - {Runtime.version(), Runtime.version().major()}, + // {JarFile.runtimeVersion(), Runtime.version().major()}, + // {Runtime.version(), Runtime.version().major()}, {Runtime.Version.parse("7.1"), JarFile.baseVersion().major()}, {Runtime.Version.parse("9"), 9}, - {Runtime.Version.parse("9.1.5-ea+200"), 9} + {Runtime.Version.parse("9.1.5-ea+200"), 9}, + {Runtime.Version.parse("10"), 10}, }; } --- old/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarHttpProperties.java 2018-01-30 10:43:46.177279147 -0800 +++ new/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarHttpProperties.java 2018-01-30 10:43:45.809279131 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8132734 + * @bug 8132734 8194070 * @summary Test the System properties for JarFile that support multi-release jar files * @library /lib/testlibrary/java/util/jar * @modules jdk.jartool @@ -31,17 +31,17 @@ * jdk.httpserver * @build Compiler JarBuilder CreateMultiReleaseTestJars SimpleHttpServer * @run testng MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=0 MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=8 MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=9 MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=10 MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=0 MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=8 MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=9 MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=10 MultiReleaseJarHttpProperties * @run testng/othervm -Djdk.util.jar.version=100 MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=8 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=9 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=10 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=8 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=9 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarHttpProperties - * @run testng/othervm -Djdk.util.jar.version=10 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=8 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=9 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=10 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=8 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=9 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarHttpProperties + * @run testng/othervm -Djdk.util.jar.version=10 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarHttpProperties * @run testng/othervm -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarHttpProperties * @run testng/othervm -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarHttpProperties */ --- old/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarProperties.java 2018-01-30 10:43:46.853279177 -0800 +++ new/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarProperties.java 2018-01-30 10:43:46.497279161 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,22 +23,22 @@ /* * @test - * @bug 8132734 8144062 + * @bug 8132734 8144062 8194070 * @summary Test the System properties for JarFile that support multi-release jar files * @library /lib/testlibrary/java/util/jar * @build Compiler JarBuilder CreateMultiReleaseTestJars * @run testng MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=0 MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=8 MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=9 MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=10 MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=0 MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=8 MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=9 MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=10 MultiReleaseJarProperties * @run testng/othervm -Djdk.util.jar.version=100 MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=8 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=9 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=10 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=8 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=9 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarProperties - * @run testng/othervm -Djdk.util.jar.version=10 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=8 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=9 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=10 -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=8 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=9 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarProperties + * @run testng/othervm -Djdk.util.jar.version=10 -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarProperties * @run testng/othervm -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarProperties * @run testng/othervm -Djdk.util.jar.enableMultiRelease=force MultiReleaseJarProperties */ @@ -86,6 +86,7 @@ } else if (rtVersion > RUNTIME_VERSION) { rtVersion = RUNTIME_VERSION; } + rtVersion = Math.min(rtVersion, 10); // Tests should be augmented for later releases force = mrprop.equals("force"); initializeClassLoader(); --- old/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarSecurity.java 2018-01-30 10:43:47.533279207 -0800 +++ new/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarSecurity.java 2018-01-30 10:43:47.169279191 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8132734 8144062 + * @bug 8132734 8144062 8194070 * @summary Test potential security related issues * @library /lib/testlibrary/java/util/jar * @build Compiler JarBuilder CreateMultiReleaseTestJars @@ -48,7 +48,7 @@ public class MultiReleaseJarSecurity { - static final int MAJOR_VERSION = Runtime.version().major(); + static final int MAJOR_VERSION = Math.min(Runtime.version().major(), 10); String userdir = System.getProperty("user.dir","."); File multirelease = new File(userdir, "multi-release.jar"); --- old/test/jdk/jdk/nio/zipfs/MultiReleaseJarTest.java 2018-01-30 10:43:48.317279241 -0800 +++ new/test/jdk/jdk/nio/zipfs/MultiReleaseJarTest.java 2018-01-30 10:43:47.925279224 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8144355 8144062 8176709 + * @bug 8144355 8144062 8176709 8194070 * @summary Test aliasing additions to ZipFileSystem for multi-release jar files * @library /lib/testlibrary/java/util/jar * @build Compiler JarBuilder CreateMultiReleaseTestJars @@ -48,7 +48,7 @@ import org.testng.annotations.*; public class MultiReleaseJarTest { - final private int MAJOR_VERSION = Runtime.version().major(); + final private int MAJOR_VERSION = Math.min(Runtime.version().major(), 10); final private String userdir = System.getProperty("user.dir","."); final private CreateMultiReleaseTestJars creator = new CreateMultiReleaseTestJars(); --- old/test/jdk/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java 2018-01-30 10:43:48.989279271 -0800 +++ new/test/jdk/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java 2018-01-30 10:43:48.625279255 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8132734 8144062 8159785 + * @bug 8132734 8144062 8159785 8194070 * @summary Test that URL connections to multi-release jars can be runtime versioned * @library /lib/testlibrary/java/util/jar * @modules jdk.compiler @@ -96,7 +96,7 @@ public void testRuntimeVersioning(String style, String file) throws Exception { String urlFile = "jar:file:" + file + "!/"; String baseUrlEntry = urlFile + "version/Version.java"; - String rtreturn = "return " + Runtime.version().major(); + String rtreturn = "return " + Math.min(Runtime.version().major(), 10); Assert.assertTrue(readAndCompare(new URL(baseUrlEntry), "return 8")); // #runtime is "magic" for a multi-release jar, but not for unversioned jar @@ -108,21 +108,23 @@ Assert.assertTrue(readAndCompare(new URL(baseUrlEntry), "return 8")); // the following tests will not work with unversioned jars - if (style.equals("unversioned")) return; + if (style.equals("unversioned")) + return; // direct access to versioned entry - String versUrlEntry = urlFile + "META-INF/versions/" + Runtime.version().major() + String versUrlEntry = urlFile + "META-INF/versions/" + + Math.min(Runtime.version().major(), 10) + "/version/Version.java"; Assert.assertTrue(readAndCompare(new URL(versUrlEntry), rtreturn)); // adding any fragment does not change things Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#runtime"), rtreturn)); Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#fragment"), rtreturn)); - + // it really doesn't change things - versUrlEntry = urlFile + "META-INF/versions/10/version/Version.java"; - Assert.assertTrue(readAndCompare(new URL(versUrlEntry), "return 10")); - Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#runtime"), "return 10")); - Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#fragment"), "return 10")); + // versUrlEntry = urlFile + "META-INF/versions/10/version/Version.java"; + // Assert.assertTrue(readAndCompare(new URL(versUrlEntry), "return 10")); + // Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#runtime"), "return 10")); + // Assert.assertTrue(readAndCompare(new URL(versUrlEntry + "#fragment"), "return 10")); } @Test(dataProvider = "data") @@ -189,7 +191,9 @@ MethodType mt = MethodType.methodType(int.class); MethodHandle mh = MethodHandles.lookup().findVirtual(vcls, "getVersion", mt); Assert.assertEquals((int)mh.invoke(vcls.newInstance()), - style.equals("unversioned") ? 8 : Runtime.version().major()); + style.equals("unversioned") ? + 8 : + Math.min(Runtime.version().major(), 10)); // now get a resource and verify that we don't have a fragment attached Enumeration vclsUrlEnum = cldr.getResources("version/Version.class"); @@ -217,7 +221,7 @@ if (style.equals("unversioned")) { suffix = ".jar!/version/Version.class"; } else { - suffix = ".jar!/META-INF/versions/" + Runtime.version().major() + suffix = ".jar!/META-INF/versions/" + Math.min(Runtime.version().major(), 10) + "/version/Version.class"; } Assert.assertTrue(rep.endsWith(suffix)); --- old/test/jdk/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java 2018-01-30 10:43:49.673279301 -0800 +++ new/test/jdk/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java 2018-01-30 10:43:49.293279284 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8047305 8075618 + * @bug 8047305 8075618 8194070 * @summary Tests jarsigner tool and JarSigner API work with multi-release JAR files. * @library /test/lib * @build jdk.test.lib.compiler.CompilerUtils @@ -81,7 +81,7 @@ private static final String KEYPASS = "changeit"; private static final String SIGNED_JAR = "Signed.jar"; private static final String POLICY_FILE = "SignedJar.policy"; - private static final String VERSION = "" + Runtime.version().major(); + private static final String VERSION = "" + Math.min(Runtime.version().major(), 10); private static final String VERSION_MESSAGE = "I am running on version " + VERSION; public static void main(String[] args) throws Throwable {