diff -r b9359154240c -r 39b67170b045 langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java Fri Aug 19 13:55:26 2016 -0700 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java Mon Aug 22 09:59:43 2016 +0200 @@ -69,6 +69,7 @@ import com.sun.tools.javac.file.RelativePath.RelativeDirectory; import com.sun.tools.javac.file.RelativePath.RelativeFile; +import com.sun.tools.javac.util.Assert; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.DefinedBy; import com.sun.tools.javac.util.DefinedBy.Api; @@ -509,7 +510,9 @@ this.archivePath = archivePath; if (multiReleaseValue != null && archivePath.toString().endsWith(".jar")) { Map env = Collections.singletonMap("multi-release", multiReleaseValue); - this.fileSystem = getJarFSProvider().newFileSystem(archivePath, env); + FileSystemProvider jarFSProvider = fsInfo.getJarFSProvider(); + Assert.checkNonNull(jarFSProvider, "should have been caught before!"); + this.fileSystem = jarFSProvider.newFileSystem(archivePath, env); } else { this.fileSystem = FileSystems.newFileSystem(archivePath, null); } @@ -597,20 +600,6 @@ } } - private FileSystemProvider jarFSProvider; - - private FileSystemProvider getJarFSProvider() throws IOException { - if (jarFSProvider != null) { - return jarFSProvider; - } - for (FileSystemProvider provider: FileSystemProvider.installedProviders()) { - if (provider.getScheme().equals("jar")) { - return (jarFSProvider = provider); - } - } - throw new ProviderNotFoundException("no provider found for .jar files"); - } - /** * container is a directory, a zip file, or a non-existent path. */