langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
changeset 41155 93dad90c22c1
parent 40762 f8883aa0053c
child 41254 08f8dbf7741e
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java	Tue Sep 20 05:28:54 2016 +0530
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java	Tue Sep 20 12:12:18 2016 +0530
@@ -130,6 +130,7 @@
 
     Map<Path, FileSystem> fileSystems = new LinkedHashMap<>();
     List<Closeable> closeables = new ArrayList<>();
+    private Map<String,String> fsEnv = Collections.emptyMap();
 
     Locations() {
         initHandlers();
@@ -207,6 +208,10 @@
         return entries;
     }
 
+    public void setMultiReleaseValue(String multiReleaseValue) {
+        fsEnv = Collections.singletonMap("multi-release", multiReleaseValue);
+    }
+
     /**
      * Utility class to help evaluate a path option. Duplicate entries are ignored, jar class paths
      * can be expanded.
@@ -1047,7 +1052,8 @@
                 }
 
                 if (p.getFileName().toString().endsWith(".jar") && fsInfo.exists(p)) {
-                    try (FileSystem fs = FileSystems.newFileSystem(p, null)) {
+                    URI uri = URI.create("jar:" + p.toUri());
+                    try (FileSystem fs = FileSystems.newFileSystem(uri, fsEnv, null)) {
                         Path moduleInfoClass = fs.getPath("module-info.class");
                         if (Files.exists(moduleInfoClass)) {
                             String moduleName = readModuleName(moduleInfoClass);