1 /* |
1 /* |
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2018, 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 |
75 import javax.tools.JavaFileObject; |
75 import javax.tools.JavaFileObject; |
76 import javax.tools.StandardJavaFileManager; |
76 import javax.tools.StandardJavaFileManager; |
77 import javax.tools.StandardJavaFileManager.PathFactory; |
77 import javax.tools.StandardJavaFileManager.PathFactory; |
78 import javax.tools.StandardLocation; |
78 import javax.tools.StandardLocation; |
79 |
79 |
|
80 import jdk.internal.jmod.JmodFile; |
|
81 |
80 import com.sun.tools.javac.code.Lint; |
82 import com.sun.tools.javac.code.Lint; |
81 import com.sun.tools.javac.code.Lint.LintCategory; |
83 import com.sun.tools.javac.code.Lint.LintCategory; |
82 import com.sun.tools.javac.main.Option; |
84 import com.sun.tools.javac.main.Option; |
83 import com.sun.tools.javac.resources.CompilerProperties.Errors; |
85 import com.sun.tools.javac.resources.CompilerProperties.Errors; |
84 import com.sun.tools.javac.resources.CompilerProperties.Warnings; |
86 import com.sun.tools.javac.resources.CompilerProperties.Warnings; |
85 import com.sun.tools.javac.util.DefinedBy; |
87 import com.sun.tools.javac.util.DefinedBy; |
86 import com.sun.tools.javac.util.DefinedBy.Api; |
88 import com.sun.tools.javac.util.DefinedBy.Api; |
87 import com.sun.tools.javac.util.JDK9Wrappers; |
|
88 import com.sun.tools.javac.util.ListBuffer; |
89 import com.sun.tools.javac.util.ListBuffer; |
89 import com.sun.tools.javac.util.Log; |
90 import com.sun.tools.javac.util.Log; |
90 import com.sun.tools.javac.jvm.ModuleNameReader; |
91 import com.sun.tools.javac.jvm.ModuleNameReader; |
91 import com.sun.tools.javac.util.Iterators; |
92 import com.sun.tools.javac.util.Iterators; |
92 import com.sun.tools.javac.util.Pair; |
93 import com.sun.tools.javac.util.Pair; |
1449 } |
1450 } |
1450 |
1451 |
1451 if (p.getFileName().toString().endsWith(".jmod")) { |
1452 if (p.getFileName().toString().endsWith(".jmod")) { |
1452 try { |
1453 try { |
1453 // check if the JMOD file is valid |
1454 // check if the JMOD file is valid |
1454 JDK9Wrappers.JmodFile.checkMagic(p); |
1455 JmodFile.checkMagic(p); |
1455 |
1456 |
1456 // No JMOD file system. Use JarFileSystem to |
1457 // No JMOD file system. Use JarFileSystem to |
1457 // workaround for now |
1458 // workaround for now |
1458 FileSystem fs = fileSystems.get(p); |
1459 FileSystem fs = fileSystems.get(p); |
1459 if (fs == null) { |
1460 if (fs == null) { |