--- old/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java 2017-02-08 11:44:45.692921675 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java 2017-02-08 11:44:45.555920646 -0800 @@ -554,11 +554,19 @@ Location classLocn = msym.classLocation; Location sourceLocn = msym.sourceLocation; Location patchLocn = msym.patchLocation; + Location patchOutLocn = msym.patchOutputLocation; boolean prevPreferCurrent = preferCurrent; try { preferCurrent = false; + if (wantClassFiles && (patchOutLocn != null)) { + fillIn(p, patchOutLocn, + list(patchOutLocn, + p, + packageName, + classKinds)); + } if ((wantClassFiles || wantSourceFiles) && (patchLocn != null)) { Set combined = EnumSet.noneOf(JavaFileObject.Kind.class); combined.addAll(classKinds); --- old/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ModuleFinder.java 2017-02-08 11:44:46.153925139 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ModuleFinder.java 2017-02-08 11:44:46.014924095 -0800 @@ -267,6 +267,7 @@ private List scanModulePath(ModuleSymbol toFind) { ListBuffer results = new ListBuffer<>(); Map namesInSet = new HashMap<>(); + boolean multiModuleMode = fileManager.hasLocation(StandardLocation.MODULE_SOURCE_PATH); while (moduleLocationIterator.hasNext()) { Set locns = (moduleLocationIterator.next()); namesInSet.clear(); @@ -279,22 +280,39 @@ // module has already been found, so ignore this instance continue; } + if (fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH) && + msym.patchLocation == null) { + msym.patchLocation = + fileManager.getLocationForModule(StandardLocation.PATCH_MODULE_PATH, + msym.name.toString()); + checkModuleInfoOnLocation(msym.patchLocation, Kind.CLASS, Kind.SOURCE); + if (msym.patchLocation != null && + multiModuleMode && + fileManager.hasLocation(StandardLocation.CLASS_OUTPUT)) { + msym.patchOutputLocation = + fileManager.getLocationForModule(StandardLocation.CLASS_OUTPUT, + msym.name.toString()); + checkModuleInfoOnLocation(msym.patchOutputLocation, Kind.CLASS); + } + } if (moduleLocationIterator.outer == StandardLocation.MODULE_SOURCE_PATH) { - msym.sourceLocation = l; - if (fileManager.hasLocation(StandardLocation.CLASS_OUTPUT)) { - msym.classLocation = fileManager.getLocationForModule(StandardLocation.CLASS_OUTPUT, msym.name.toString()); + if (msym.patchLocation == null) { + msym.sourceLocation = l; + if (fileManager.hasLocation(StandardLocation.CLASS_OUTPUT)) { + msym.classLocation = + fileManager.getLocationForModule(StandardLocation.CLASS_OUTPUT, + msym.name.toString()); + } } } else { msym.classLocation = l; } - if (fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH)) { - msym.patchLocation = fileManager.getLocationForModule(StandardLocation.PATCH_MODULE_PATH, msym.name.toString()); - } if (moduleLocationIterator.outer == StandardLocation.SYSTEM_MODULES || moduleLocationIterator.outer == StandardLocation.UPGRADE_MODULE_PATH) { msym.flags_field |= Flags.SYSTEM_MODULE; } - if (toFind == msym || toFind == null) { + if (toFind == null || + (toFind == msym && (msym.sourceLocation != null || msym.classLocation != null))) { // Note: cannot return msym directly, because we must finish // processing this set first results.add(msym); @@ -314,6 +332,21 @@ return results.toList(); } + private void checkModuleInfoOnLocation(Location location, Kind... kinds) throws IOException { + if (location == null) + return ; + + for (Kind kind : kinds) { + JavaFileObject file = fileManager.getJavaFileForInput(location, + names.module_info.toString(), + kind); + if (file != null) { + log.error(Errors.LocnModuleInfoNotAllowedOnPatchPath(file)); + return ; + } + } + } + private void findModuleInfo(ModuleSymbol msym) { try { JavaFileObject src_fo = (msym.sourceLocation == null) ? null --- old/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java 2017-02-08 11:44:46.639928791 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java 2017-02-08 11:44:46.505927784 -0800 @@ -907,8 +907,9 @@ public Name version; public JavaFileManager.Location sourceLocation; - public JavaFileManager.Location patchLocation; public JavaFileManager.Location classLocation; + public JavaFileManager.Location patchLocation; + public JavaFileManager.Location patchOutputLocation; /** All directives, in natural order. */ public List directives; --- old/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java 2017-02-08 11:44:47.105932293 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java 2017-02-08 11:44:46.967931256 -0800 @@ -372,10 +372,19 @@ tree.sourcefile, getPackageName(tree)) : null; - if (msplocn != null) { - if (plocn != null) { - log.error(tree.pos(), Errors.FilePatchedAndMsp); + if (plocn != null) { + Name name = names.fromString(fileManager.inferModuleName(plocn)); + ModuleSymbol msym = moduleFinder.findModule(name); + tree.modle = msym; + rootModules.add(msym); + + if (msplocn != null) { + Name mspname = names.fromString(fileManager.inferModuleName(msplocn)); + if (name != mspname) { + log.error(tree.pos(), Errors.FilePatchedAndMsp(name, mspname)); + } } + } else if (msplocn != null) { Name name = names.fromString(fileManager.inferModuleName(msplocn)); ModuleSymbol msym; JCModuleDecl decl = tree.getModuleDecl(); @@ -399,11 +408,6 @@ } tree.modle = msym; rootModules.add(msym); - } else if (plocn != null) { - Name name = names.fromString(fileManager.inferModuleName(plocn)); - ModuleSymbol msym = moduleFinder.findModule(name); - tree.modle = msym; - rootModules.add(msym); } else if (c != null && c.packge().modle == syms.unnamedModule) { tree.modle = syms.unnamedModule; } else { @@ -440,6 +444,7 @@ if (legacyModuleOverride != null) { defaultModule.sourceLocation = StandardLocation.SOURCE_PATH; } + defaultModule.patchOutputLocation = StandardLocation.CLASS_OUTPUT; } else { // Question: why not do findAllModules and initVisiblePackages here? // i.e. body of unnamedModuleCompleter @@ -448,7 +453,7 @@ defaultModule.classLocation = StandardLocation.CLASS_PATH; } } else { - checkSpecifiedModule(trees, moduleOverride, Errors.ModuleInfoWithPatchedModuleClasspath); + checkSpecifiedModule(trees, moduleOverride, Errors.ModuleInfoWithPatchedModuleClassoutput); checkNoAllModulePath(); defaultModule.complete(); // Question: why not do completeModule here? --- old/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java 2017-02-08 11:44:47.612936102 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java 2017-02-08 11:44:47.447934862 -0800 @@ -1570,21 +1570,11 @@ String moduleName = v.substring(0, eq); SearchPath mPatchPath = new SearchPath() .addFiles(v.substring(eq + 1)); - boolean ok = true; - for (Path p : mPatchPath) { - Path mi = p.resolve("module-info.class"); - if (Files.exists(mi)) { - log.error(Errors.LocnModuleInfoNotAllowedOnPatchPath(mi)); - ok = false; - } - } - if (ok) { - String name = location.getName() + "[" + moduleName + "]"; - ModuleLocationHandler h = new ModuleLocationHandler(name, moduleName, mPatchPath, false); - moduleLocations.put(moduleName, h); - for (Path r : mPatchPath) { - pathLocations.put(normalize(r), h); - } + String name = location.getName() + "[" + moduleName + "]"; + ModuleLocationHandler h = new ModuleLocationHandler(name, moduleName, mPatchPath, false); + moduleLocations.put(moduleName, h); + for (Path r : mPatchPath) { + pathLocations.put(normalize(r), h); } } else { // Should not be able to get here; --- old/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties 2017-02-08 11:44:48.098939754 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties 2017-02-08 11:44:47.957938694 -0800 @@ -1292,7 +1292,7 @@ compiler.warn.outdir.is.in.exploded.module=\ the output directory is within an exploded module: {0} -# 0: path +# 0: file object compiler.err.locn.module-info.not.allowed.on.patch.path=\ module-info.class not allowed on patch path: {0} @@ -2958,17 +2958,19 @@ module declarations should be in a file named module-info.java compiler.err.module-info.with.patched.module.sourcepath=\ - compiling a patch module with module-info on sourcepath + compiling a module patch with module-info on sourcepath -compiler.err.module-info.with.patched.module.classpath=\ - compiling a patch module with module-info on classpath +compiler.err.module-info.with.patched.module.classoutput=\ + compiling a module patch with module-info on class output # 0: set of string compiler.err.too.many.patched.modules=\ too many patched modules ({0}), use --module-source-path +# 0: name, 1: name compiler.err.file.patched.and.msp=\ - file accessible from both --module-source-path and --patch-module + file accessible from both --patch-module and --module-source-path, \ + but belongs to a different module on each path: {0}, {1} compiler.err.processorpath.no.processormodulepath=\ illegal combination of -processorpath and --processor-module-path --- old/test/tools/javac/modules/XModuleTest.java 2017-02-08 11:44:48.581943383 -0800 +++ new/test/tools/javac/modules/XModuleTest.java 2017-02-08 11:44:48.443942346 -0800 @@ -40,6 +40,7 @@ import java.util.Arrays; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.RoundEnvironment; @@ -167,8 +168,7 @@ tb.createDirectories(classes); List log = new JavacTask(tb) - .options("--patch-module", "m1x=" + m1.toString(), - "--patch-module", "m2x=" + m2.toString(), + .options("--patch-module", "m1x=" + m2.toString(), "--module-source-path", src.toString(), "-XDrawDiagnostics") .outdir(classes) @@ -179,11 +179,8 @@ .getOutputLines(Task.OutputKind.DIRECT); List expectedOut = Arrays.asList( - "Test.java:1:1: compiler.err.file.patched.and.msp", - "Test.java:1:1: compiler.err.file.patched.and.msp", - "module-info.java:1:1: compiler.err.file.patched.and.msp", - "- compiler.err.cant.access: m2x.module-info, (compiler.misc.cant.resolve.modules)", - "4 errors" + "Test.java:1:1: compiler.err.file.patched.and.msp: m1x, m2x", + "1 error" ); if (!expectedOut.equals(log)) @@ -266,14 +263,15 @@ //note: avoiding use of java.base, as that gets special handling on some places: Path src = base.resolve("src"); tb.writeJavaFiles(src, + "module java.compiler {}", "package javax.lang.model.element; public interface Extra { }"); - Path srcPath = base.resolve("src-path"); - tb.writeJavaFiles(src, - "module java.compiler {}"); Path classes = base.resolve("classes"); tb.createDirectories(classes); - List log = new JavacTask(tb) + List log; + List expected; + + log = new JavacTask(tb) .options("-XDrawDiagnostics", "--patch-module", "java.compiler=" + src.toString()) .outdir(classes) @@ -282,8 +280,25 @@ .writeAll() .getOutputLines(Task.OutputKind.DIRECT); - List expected = Arrays.asList("Extra.java:1:1: compiler.err.module-info.with.patched.module.sourcepath", - "1 error"); + expected = Arrays.asList("Extra.java:1:1: compiler.err.module-info.with.patched.module.sourcepath", + "1 error"); + + if (!expected.equals(log)) + throw new Exception("expected output not found: " + log); + + //multi-module mode: + log = new JavacTask(tb) + .options("-XDrawDiagnostics", + "--patch-module", "java.compiler=" + src.toString(), + "--module-source-path", "dummy") + .outdir(classes) + .files(findJavaFiles(src)) + .run(Task.Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + expected = Arrays.asList("- compiler.err.locn.module-info.not.allowed.on.patch.path: module-info.java", + "1 error"); if (!expected.equals(log)) throw new Exception("expected output not found: " + log); @@ -295,7 +310,7 @@ Path srcMod = base.resolve("src-mod"); tb.writeJavaFiles(srcMod, "module mod {}"); - Path classes = base.resolve("classes"); + Path classes = base.resolve("classes").resolve("java.compiler"); tb.createDirectories(classes); String logMod = new JavacTask(tb) @@ -314,7 +329,10 @@ "package javax.lang.model.element; public interface Extra { }"); tb.createDirectories(classes); - List log = new JavacTask(tb) + List log; + List expected; + + log = new JavacTask(tb) .options("-XDrawDiagnostics", "--patch-module", "java.compiler=" + src.toString()) .outdir(classes) @@ -323,8 +341,24 @@ .writeAll() .getOutputLines(Task.OutputKind.DIRECT); - List expected = Arrays.asList("Extra.java:1:1: compiler.err.module-info.with.patched.module.classpath", - "1 error"); + expected = Arrays.asList("Extra.java:1:1: compiler.err.module-info.with.patched.module.classoutput", + "1 error"); + + if (!expected.equals(log)) + throw new Exception("expected output not found: " + log); + + log = new JavacTask(tb) + .options("-XDrawDiagnostics", + "--patch-module", "java.compiler=" + src.toString(), + "--module-source-path", "dummy") + .outdir(classes.getParent()) + .files(findJavaFiles(src)) + .run(Task.Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + expected = Arrays.asList("- compiler.err.locn.module-info.not.allowed.on.patch.path: module-info.class", + "1 error"); if (!expected.equals(log)) throw new Exception("expected output not found: " + log); @@ -496,6 +530,160 @@ } } + @Test + public void testSingleModeIncremental(Path base) throws Exception { + //note: avoiding use of java.base, as that gets special handling on some places: + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + "package javax.lang.model.element; public interface Extra extends Element { }", + "package javax.lang.model.element; public interface Extra2 extends Extra { }"); + Path classes = base.resolve("classes"); + tb.createDirectories(classes); + + Thread.sleep(2000); //ensure newer timestamps on classfiles: + + new JavacTask(tb) + .options("--patch-module", "java.compiler=" + src.toString()) + .outdir(classes) + .files(findJavaFiles(src)) + .run() + .writeAll() + .getOutput(Task.OutputKind.DIRECT); + + List log = new JavacTask(tb) + .options("--patch-module", "java.compiler=" + src.toString(), + "-verbose") + .outdir(classes) + .files(findJavaFiles(src.resolve("javax/lang/model/element/Extra2.java" + .replace("/", src.getFileSystem().getSeparator())))) + .run() + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT) + .stream() + .filter(l -> l.contains("parsing")) + .collect(Collectors.toList()); + + boolean parsesExtra2 = log.stream() + .anyMatch(l -> l.contains("Extra2.java")); + boolean parsesExtra = log.stream() + .anyMatch(l -> l.contains("Extra.java")); + + if (!parsesExtra2 || parsesExtra) { + throw new AssertionError("Unexpected output: " + log); + } + } + + @Test + public void testComplexMSPAndPatch(Path base) throws Exception { + //note: avoiding use of java.base, as that gets special handling on some places: + Path src1 = base.resolve("src1"); + Path src1ma = src1.resolve("ma"); + tb.writeJavaFiles(src1ma, + "module ma { exports ma; }", + "package ma; public class C1 { public static void method() { } }", + "package ma.impl; public class C2 { }"); + Path src1mb = src1.resolve("mb"); + tb.writeJavaFiles(src1mb, + "module mb { requires ma; }", + "package mb.impl; public class C2 { public static void method() { } }"); + Path src1mc = src1.resolve("mc"); + tb.writeJavaFiles(src1mc, + "module mc { }"); + Path classes1 = base.resolve("classes1"); + tb.createDirectories(classes1); + tb.cleanDirectory(classes1); + + new JavacTask(tb) + .options("--module-source-path", src1.toString()) + .files(findJavaFiles(src1)) + .outdir(classes1) + .run() + .writeAll(); + + //patching: + Path src2 = base.resolve("src2"); + Path src2ma = src2.resolve("ma"); + tb.writeJavaFiles(src2ma, + "package ma.impl; public class C2 { public static void extra() { ma.C1.method(); } }", + "package ma.impl; public class C3 { public void test() { C2.extra(); } }"); + Path src2mb = src2.resolve("mb"); + tb.writeJavaFiles(src2mb, + "package mb.impl; public class C3 { public void test() { C2.method(); ma.C1.method(); ma.impl.C2.extra(); } }"); + Path src2mc = src2.resolve("mc"); + tb.writeJavaFiles(src2mc, + "package mc.impl; public class C2 { public static void test() { } }", + //will require --add-reads ma: + "package mc.impl; public class C3 { public static void test() { ma.impl.C2.extra(); } }"); + Path src2mt = src2.resolve("mt"); + tb.writeJavaFiles(src2mt, + "module mt { requires ma; requires mb; }", + "package mt.impl; public class C2 { public static void test() { mb.impl.C2.method(); ma.impl.C2.extra(); } }", + "package mt.impl; public class C3 { public static void test() { C2.test(); mc.impl.C2.test(); } }"); + Path classes2 = base.resolve("classes2"); + tb.createDirectories(classes2); + tb.cleanDirectory(classes2); + + Thread.sleep(2000); //ensure newer timestamps on classfiles: + + new JavacTask(tb) + .options("--module-path", classes1.toString(), + "--patch-module", "ma=" + src2ma.toString(), + "--patch-module", "mb=" + src2mb.toString(), + "--add-exports", "ma/ma.impl=mb", + "--patch-module", "mc=" + src2mc.toString(), + "--add-reads", "mc=ma", + "--add-exports", "ma/ma.impl=mc", + "--add-exports", "ma/ma.impl=mt", + "--add-exports", "mb/mb.impl=mt", + "--add-exports", "mc/mc.impl=mt", + "--add-reads", "mt=mc", + "--module-source-path", src2.toString()) + .outdir(classes2) + .files(findJavaFiles(src2)) + .run() + .writeAll(); + + //incremental compilation (C2 mustn't be compiled, C3 must): + tb.writeJavaFiles(src2ma, + "package ma.impl; public class C3 { public void test() { ma.C1.method(); C2.extra(); } }"); + tb.writeJavaFiles(src2mt, + "package mt.impl; public class C3 { public static void test() { mc.impl.C2.test(); C2.test(); } }"); + + List log = new JavacTask(tb) + .options("--module-path", classes1.toString(), + "--patch-module", "ma=" + src2ma.toString(), + "--patch-module", "mb=" + src2mb.toString(), + "--add-exports", "ma/ma.impl=mb", + "--patch-module", "mc=" + src2mc.toString(), + "--add-reads", "mc=ma", + "--add-exports", "ma/ma.impl=mc", + "--add-exports", "ma/ma.impl=mt", + "--add-exports", "mb/mb.impl=mt", + "--add-exports", "mc/mc.impl=mt", + "--add-reads", "mt=mc", + "--module-source-path", src2.toString(), + "--add-modules", "mc", + "-verbose") + .outdir(classes2) + .files(src2ma.resolve("ma").resolve("impl").resolve("C3.java"), + src2mt.resolve("mt").resolve("impl").resolve("C3.java")) + .run() + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT) + .stream() + .filter(l -> l.contains("parsing")) + .collect(Collectors.toList()); + + boolean parsesC3 = log.stream() + .anyMatch(l -> l.contains("C3.java")); + boolean parsesC2 = log.stream() + .anyMatch(l -> l.contains("C2.java")); + + if (!parsesC3 || parsesC2) { + throw new AssertionError("Unexpected output: " + log); + } + } + private void checkFileExists(Path dir, String path) { Path toCheck = dir.resolve(path.replace("/", dir.getFileSystem().getSeparator())); --- old/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleSourcePath/patchmodule/java.compiler/module-info.java 2017-02-08 11:44:49.179947876 -0800 +++ /dev/null 2017-01-29 01:52:59.371188621 -0800 @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -module java.compiler {} --- /dev/null 2017-01-29 01:52:59.371188621 -0800 +++ new/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleClassoutput/ModuleInfoWithPatchedModuleClassoutput.java 2017-02-08 11:44:48.954946185 -0800 @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2016, 2017, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.err.module-info.with.patched.module.classoutput --- old/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleSourcePath/patchmodule/java.compiler/module-info.java 2017-02-08 11:44:49.736952061 -0800 +++ /dev/null 2017-01-29 01:52:59.371188621 -0800 @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -module java.compiler {} --- /dev/null 2017-01-29 01:52:59.371188621 -0800 +++ new/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleClassoutput/additional/module-info.java 2017-02-08 11:44:49.508950348 -0800 @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2016, 2017, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +module mod {} --- old/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleSourcePath/patchmodule/java.compiler/javax/lang/model/element/Extra.java 2017-02-08 11:44:50.296956269 -0800 +++ /dev/null 2017-01-29 01:52:59.371188621 -0800 @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.lang.model.element; - -public interface Extra {} --- /dev/null 2017-01-29 01:52:59.371188621 -0800 +++ new/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleClassoutput/patchmodule/java.compiler/javax/lang/model/element/Extra.java 2017-02-08 11:44:50.067954548 -0800 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016, 2017, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.element; + +public interface Extra {} --- old/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleSourcePath/ModuleInfoWithPatchedModuleSourcePath.java 2017-02-08 11:44:50.694959259 -0800 +++ /dev/null 2017-01-29 01:52:59.371188621 -0800 @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// key: compiler.err.module-info.with.patched.module.sourcepath --- /dev/null 2017-01-29 01:52:59.371188621 -0800 +++ new/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleSourcepath/ModuleInfoWithPatchedModule.java 2017-02-08 11:44:50.463957524 -0800 @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2016, 2017, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.err.module-info.with.patched.module.sourcepath --- old/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleSourcePath/patchmodule/java.compiler/javax/lang/model/element/Extra.java 2017-02-08 11:44:51.087962212 -0800 +++ /dev/null 2017-01-29 01:52:59.371188621 -0800 @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.lang.model.element; - -public interface Extra {} --- /dev/null 2017-01-29 01:52:59.371188621 -0800 +++ new/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleSourcepath/patchmodule/java.compiler/javax/lang/model/element/Extra.java 2017-02-08 11:44:50.863960529 -0800 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016, 2017, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.lang.model.element; + +public interface Extra {} --- old/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleSourcePath/patchmodule/java.compiler/module-info.java 2017-02-08 11:44:51.477965142 -0800 +++ /dev/null 2017-01-29 01:52:59.371188621 -0800 @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -module java.compiler {} --- /dev/null 2017-01-29 01:52:59.371188621 -0800 +++ new/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleSourcepath/patchmodule/java.compiler/module-info.java 2017-02-08 11:44:51.254963467 -0800 @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2016, 2017, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +module java.compiler {} --- old/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleClasspath/ModuleInfoWithXmoduleClasspath.java 2017-02-08 11:44:51.784967449 -0800 +++ /dev/null 2017-01-29 01:52:59.371188621 -0800 @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// key: compiler.err.module-info.with.patched.module.classpath --- old/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleClasspath/additional/module-info.java 2017-02-08 11:44:52.130970049 -0800 +++ /dev/null 2017-01-29 01:52:59.371188621 -0800 @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -module mod {} --- old/test/tools/javac/diags/examples/ModuleInfoWithPatchedModuleClasspath/patchmodule/java.compiler/javax/lang/model/element/Extra.java 2017-02-08 11:44:52.433972326 -0800 +++ /dev/null 2017-01-29 01:52:59.371188621 -0800 @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package javax.lang.model.element; - -public interface Extra {}