test/jdk/java/lang/module/customfs/ModulesInCustomFileSystem.java
changeset 59216 47c879f478d2
parent 51977 a8862960c19f
--- a/test/jdk/java/lang/module/customfs/ModulesInCustomFileSystem.java	Thu Nov 21 23:32:11 2019 -0500
+++ b/test/jdk/java/lang/module/customfs/ModulesInCustomFileSystem.java	Fri Nov 22 09:25:09 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, 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
@@ -54,9 +54,9 @@
     private static final Path HERE = Paths.get("");
 
     /**
-     * Test exploded modules in a JAR file system.
+     * Test exploded modules in a Zip file system.
      */
-    public void testExplodedModulesInJarFileSystem() throws Exception {
+    public void testExplodedModulesInZipFileSystem() throws Exception {
         Path m1 = findModuleDirectory("m1");
         Path m2 = findModuleDirectory("m2");
         Path mlib = m1.getParent();
@@ -65,13 +65,13 @@
         // create JAR file containing m1/** and m2/**
         Path jar = Files.createTempDirectory(HERE, "mlib").resolve("modules.jar");
         JarUtils.createJarFile(jar, mlib);
-        testJarFileSystem(jar);
+        testZipFileSystem(jar);
     }
 
     /**
-     * Test modular JARs in a JAR file system
+     * Test modular JARs in a Zip file system.
      */
-    public void testModularJARsInJarFileSystem() throws Exception {
+    public void testModularJARsInZipFileSystem() throws Exception {
         Path m1 = findModuleDirectory("m1");
         Path m2 = findModuleDirectory("m2");
         Path contents = Files.createTempDirectory(HERE, "contents");
@@ -81,15 +81,14 @@
         // create JAR file containing m1.jar and m2.jar
         Path jar = Files.createTempDirectory(HERE, "mlib").resolve("modules.jar");
         JarUtils.createJarFile(jar, contents);
-        testJarFileSystem(jar);
+        testZipFileSystem(jar);
     }
 
     /**
      * Opens a JAR file as a file system
      */
-    private void testJarFileSystem(Path jar) throws Exception {
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-        try (FileSystem fs = FileSystems.newFileSystem(jar, scl)) {
+    private void testZipFileSystem(Path zip) throws Exception {
+        try (FileSystem fs = FileSystems.newFileSystem(zip)) {
             // ModuleFinder to find modules in top-level directory
             Path top = fs.getPath("/");
             ModuleFinder finder = ModuleFinder.of(top);