src/jdk.compiler/share/classes/com/sun/tools/javac/platform/JDKPlatformProvider.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
111 |
111 |
112 static { |
112 static { |
113 SUPPORTED_JAVA_PLATFORM_VERSIONS = new TreeSet<>(NUMERICAL_COMPARATOR); |
113 SUPPORTED_JAVA_PLATFORM_VERSIONS = new TreeSet<>(NUMERICAL_COMPARATOR); |
114 Path ctSymFile = findCtSym(); |
114 Path ctSymFile = findCtSym(); |
115 if (Files.exists(ctSymFile)) { |
115 if (Files.exists(ctSymFile)) { |
116 try (FileSystem fs = FileSystems.newFileSystem(ctSymFile, null); |
116 try (FileSystem fs = FileSystems.newFileSystem(ctSymFile, (ClassLoader)null); |
117 DirectoryStream<Path> dir = |
117 DirectoryStream<Path> dir = |
118 Files.newDirectoryStream(fs.getRootDirectories().iterator().next())) { |
118 Files.newDirectoryStream(fs.getRootDirectories().iterator().next())) { |
119 for (Path section : dir) { |
119 for (Path section : dir) { |
120 if (section.getFileName().toString().contains("-")) |
120 if (section.getFileName().toString().contains("-")) |
121 continue; |
121 continue; |
250 // file == ${jdk.home}/lib/ct.sym |
250 // file == ${jdk.home}/lib/ct.sym |
251 if (Files.exists(file)) { |
251 if (Files.exists(file)) { |
252 try { |
252 try { |
253 FileSystem fs = ctSym2FileSystem.get(file); |
253 FileSystem fs = ctSym2FileSystem.get(file); |
254 if (fs == null) { |
254 if (fs == null) { |
255 ctSym2FileSystem.put(file, fs = FileSystems.newFileSystem(file, null)); |
255 ctSym2FileSystem.put(file, fs = FileSystems.newFileSystem(file, (ClassLoader)null)); |
256 } |
256 } |
257 |
257 |
258 Path root = fs.getRootDirectories().iterator().next(); |
258 Path root = fs.getRootDirectories().iterator().next(); |
259 boolean hasModules = |
259 boolean hasModules = |
260 Feature.MODULES.allowedInSource(Source.lookup(sourceVersion)); |
260 Feature.MODULES.allowedInSource(Source.lookup(sourceVersion)); |