< prev index next >

test/java/util/jar/JarFile/MultiReleaseJarIterators.java

Print this page
rev 13794 : 8150976: JarFile and MRJAR tests should use the JDK specific Version API
Reviewed-by:

@@ -40,21 +40,24 @@
 import java.util.Map;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.stream.Collectors;
 import java.util.zip.ZipFile;
+import jdk.Version;
 
 import static java.util.jar.JarFile.Release;
-import static sun.misc.Version.jdkMajorVersion;  // fixme JEP 223 Version
 
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 
 public class MultiReleaseJarIterators {
+
+    static final int MAJOR_VERSION = Version.current().major();
+
     String userdir = System.getProperty("user.dir", ".");
     File unversioned = new File(userdir, "unversioned.jar");
     File multirelease = new File(userdir, "multi-release.jar");
     Map<String,JarEntry> uvEntries = new HashMap<>();
     Map<String,JarEntry> mrEntries = new HashMap<>();

@@ -119,11 +122,11 @@
             testStream(jf, v9Entries);
         }
 
         try (JarFile jf = new JarFile(multirelease, true, ZipFile.OPEN_READ, Release.RUNTIME)) {
             Map<String,JarEntry> expectedEntries;
-            switch (jdkMajorVersion()) {
+            switch (MAJOR_VERSION) {
                 case 9:
                     expectedEntries = v9Entries;
                     break;
                 case 10:  // won't get here until JDK 10
                     expectedEntries = v10Entries;
< prev index next >