changeset 3823:d8766c39123a

8170987: Module system implementation refresh (12/2016) Reviewed-by: mcimadamore Contributed-by: jonathan.gibbons@oracle.com, jan.lahoda@oracle.com, srikanth.adayapalam@oracle.com, alan.bateman@oracle.com, mandy.chung@oracle.com
author alanb
date Fri, 16 Dec 2016 05:47:58 +0000
parents e90f9448c7a3
children cd0a8a7a0199
files make/tools/crules/MutableFieldsAnalyzer.java src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ModuleNameReader.java src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/JDK9Wrappers.java src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassTranslator.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModulePackages_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleResolution_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleVersion_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/Module_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ReferenceFinder.java src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/CPSelector.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java test/jdk/javadoc/doclet/testModules/TestModules.java test/jdk/javadoc/doclet/testModules/module1/module-info.java test/jdk/javadoc/doclet/testModules/module1/testpkgmdl1/TestClassInModule1.java test/jdk/javadoc/doclet/testModules/module2/module-info.java test/jdk/javadoc/doclet/testModules/module2/testpkg2mdl2/TestInterfaceInModule2.java test/jdk/javadoc/doclet/testModules/module2/testpkgmdl2/AnnotationType.java test/jdk/javadoc/doclet/testModules/module2/testpkgmdl2/AnnotationTypeUndocumented.java test/jdk/javadoc/doclet/testModules/module2/testpkgmdl2/TestClassInModule2.java test/jdk/javadoc/doclet/testModules/moduleA/module-info.java test/jdk/javadoc/doclet/testModules/moduleA/testpkgmdlA/TestClassInModuleA.java test/jdk/javadoc/doclet/testModules/moduleB/module-info.java test/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterfaceInModuleB.java test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationType.java test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationTypeUndocumented.java test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClassInModuleB.java test/jdk/javadoc/doclet/testModules/moduletags/module-info.java test/lib/annotations/annotations/classfile/ClassfileInspector.java test/tools/javac/MethodParameters/AttributeVisitor.java test/tools/javac/T8003967/DetectMutableStaticFields.java test/tools/javac/classfiles/attributes/Module/ModuleTest.java test/tools/javac/classfiles/attributes/Module/ModuleTestBase.java test/tools/javac/diags/examples/CyclicRequires/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/CyclicRequires/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/CyclicRequires/modulesourcepath/m2/module-info.java test/tools/javac/diags/examples/CyclicRequires/modulesourcepath/m2x/module-info.java test/tools/javac/diags/examples/DuplicateModule/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/DuplicateModule/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/DuplicateModule/modulesourcepath/m2/module-info.java test/tools/javac/diags/examples/DuplicateModule/modulesourcepath/m2x/module-info.java test/tools/javac/diags/examples/HasBeenDeprecatedModule/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/HasBeenDeprecatedModule/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/HasBeenDeprecatedModule/modulesourcepath/m2/module-info.java test/tools/javac/diags/examples/HasBeenDeprecatedModule/modulesourcepath/m2x/module-info.java test/tools/javac/diags/examples/HasBeenDeprecatedRemovalModule/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/HasBeenDeprecatedRemovalModule/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/HasBeenDeprecatedRemovalModule/modulesourcepath/m2/module-info.java test/tools/javac/diags/examples/HasBeenDeprecatedRemovalModule/modulesourcepath/m2x/module-info.java test/tools/javac/diags/examples/LeaksNotAccessible/modulesourcepath/m1/api/Api.java test/tools/javac/diags/examples/LeaksNotAccessible/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/LeaksNotAccessible/modulesourcepath/m1x/api/Api.java test/tools/javac/diags/examples/LeaksNotAccessible/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m1/api1/Api1.java test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m1x/api1/Api1.java test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m2/api2/Api2.java test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m2/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m2x/api2/Api2.java test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m2x/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1/api/Api.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1/impl/Impl.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1x/api/Api.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1x/impl/Impl.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1/api/Api.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1/qapi/QApi.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1x/api/Api.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1x/qapi/QApi.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m2/module-info.java test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m2x/module-info.java test/tools/javac/diags/examples/ModuleInfoWithoutModule/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/ModuleInfoWithoutModule/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/MultiModuleOutputCannotBeExplodedModule/additional/m1/module-info.java test/tools/javac/diags/examples/MultiModuleOutputCannotBeExplodedModule/additional/m1x/module-info.java test/tools/javac/diags/examples/MultiModuleOutputCannotBeExplodedModule/modulesourcepath/m2/module-info.java test/tools/javac/diags/examples/MultiModuleOutputCannotBeExplodedModule/modulesourcepath/m2x/module-info.java test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m1/p1/C1.java test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m1x/p1/C1.java test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m2/module-info.java test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m2/p2/C2.java test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m2x/module-info.java test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m2x/p2/C2.java test/tools/javac/diags/examples/NotInProfile.java test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib1/exported/Api1.java test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib1/module-info.java test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib1x/exported/Api1.java test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib1x/module-info.java test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib2/exported/Api2.java test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib2/module-info.java test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib2x/exported/Api2.java test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib2x/module-info.java test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/use/module-info.java test/tools/javac/diags/examples/PackageEmptyOrNotFound/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/PackageEmptyOrNotFound/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/PoorChoiceForModuleName/module-info.java test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1/exported/Service.java test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1/exported/ServiceImplementation.java test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1x/exported/Service.java test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1x/exported/ServiceImplementation.java test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m2/module-info.java test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m2x/module-info.java test/tools/javac/diags/examples/TooManyModules/p1/module-info.java test/tools/javac/diags/examples/TooManyModules/p2/module-info.java test/tools/javac/diags/examples/UnnamedPackageInNamedModule/modulesourcepath/m1/UnnamedPackageInNamedModule.java test/tools/javac/diags/examples/UnnamedPackageInNamedModule/modulesourcepath/m1/module-info.java test/tools/javac/diags/examples/UnnamedPackageInNamedModule/modulesourcepath/m1x/UnnamedPackageInNamedModule.java test/tools/javac/diags/examples/UnnamedPackageInNamedModule/modulesourcepath/m1x/module-info.java test/tools/javac/diags/examples/WarnModuleNotFound/WarnModuleNotFound.java test/tools/javac/diags/examples/WarnModuleNotFound/modulesourcepath/m/api/Api.java test/tools/javac/diags/examples/WarnModuleNotFound/modulesourcepath/m/module-info.java test/tools/javac/lambda/ByteCodeTest.java test/tools/javac/modules/AddExportsTest.java test/tools/javac/modules/AddLimitMods.java test/tools/javac/modules/AddModulesTest.java test/tools/javac/modules/AddReadsTest.java test/tools/javac/modules/AnnotationProcessing.java test/tools/javac/modules/AnnotationProcessorsInModulesTest.java test/tools/javac/modules/AnnotationsOnModules.java test/tools/javac/modules/AutomaticModules.java test/tools/javac/modules/DoclintOtherModules.java test/tools/javac/modules/DuplicateClassTest.java test/tools/javac/modules/EdgeCases.java test/tools/javac/modules/ExportsUnexported.java test/tools/javac/modules/GetLocationForModuleTest.java test/tools/javac/modules/HelloWorldTest.java test/tools/javac/modules/LimitModulesTest.java test/tools/javac/modules/MOptionTest.java test/tools/javac/modules/ModuleFinderTest.java test/tools/javac/modules/ModuleInfoTest.java test/tools/javac/modules/ModuleInfoTreeAccess.java test/tools/javac/modules/ModulePathTest.java test/tools/javac/modules/ModuleSourcePathTest.java test/tools/javac/modules/ModuleVersion.java test/tools/javac/modules/ModulesAndClassPathTest.java test/tools/javac/modules/MultiModuleModeTest.java test/tools/javac/modules/OpenModulesTest.java test/tools/javac/modules/OutputDirTest.java test/tools/javac/modules/PackageConflictTest.java test/tools/javac/modules/PackageMultipleModules.java test/tools/javac/modules/PluginsInModulesTest.java test/tools/javac/modules/PoorChoiceForModuleNameTest.java test/tools/javac/modules/ProvidesTest.java test/tools/javac/modules/QueryBeforeEnter.java test/tools/javac/modules/RequiresStaticTest.java test/tools/javac/modules/RequiresTransitiveTest.java test/tools/javac/modules/ResolveTest.java test/tools/javac/modules/ServiceProvidedButNotExportedOrUsedTest.java test/tools/javac/modules/SingleModuleModeTest.java test/tools/javac/modules/UpgradeModulePathTest.java test/tools/javac/modules/UsesTest.java test/tools/javac/profiles/ProfileOptionTest.java test/tools/jdeps/modules/CheckModuleTest.java test/tools/jdeps/modules/InverseDeps.java test/tools/jdeps/modules/ModuleTest.java test/tools/jdeps/modules/src/m4/module-info.java test/tools/jdeps/modules/src/m4/p4/Lib.java test/tools/jdeps/modules/src/m4/p4/internal/Impl.java test/tools/jdeps/modules/src/m5/module-info.java test/tools/jdeps/modules/src/m5/p5/Main.java test/tools/jdeps/modules/src/m5/p5/internal/T.java test/tools/jdeps/modules/src/m8/module-info.java test/tools/jdeps/modules/src/m8/p8/Main.java test/tools/jdeps/modules/src/mIV/module-info.java test/tools/jdeps/modules/src/mIV/p4/Lib.java test/tools/jdeps/modules/src/mIV/p4/internal/Impl.java test/tools/jdeps/modules/src/mV/module-info.java test/tools/jdeps/modules/src/mV/p5/Main.java test/tools/jdeps/modules/src/mV/p5/internal/T.java test/tools/jdeps/modules/src/mVIII/module-info.java test/tools/jdeps/modules/src/mVIII/p8/Main.java
diffstat 200 files changed, 3941 insertions(+), 3031 deletions(-) [+]
line wrap: on
line diff
--- a/make/tools/crules/MutableFieldsAnalyzer.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/make/tools/crules/MutableFieldsAnalyzer.java	Fri Dec 16 05:47:58 2016 +0000
@@ -107,6 +107,8 @@
                 "layerClass", "bootMethod", "defineModulesWithOneLoaderMethod", "configurationMethod");
         ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$Module",
                 "addExportsMethod", "addUsesMethod", "getModuleMethod", "getUnnamedModuleMethod");
+        ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$ModuleDescriptor$Version",
+                "versionClass", "parseMethod");
         ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$ServiceLoaderHelper",
                 "loadMethod");
         ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$VMHelper",
--- a/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java	Fri Dec 16 05:47:58 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -36,6 +36,7 @@
 import javax.lang.model.element.ModuleElement.Directive;
 import javax.lang.model.element.ModuleElement.DirectiveKind;
 import javax.lang.model.element.ModuleElement.ExportsDirective;
+import javax.lang.model.element.ModuleElement.OpensDirective;
 import javax.lang.model.element.ModuleElement.ProvidesDirective;
 import javax.lang.model.element.ModuleElement.RequiresDirective;
 import javax.lang.model.element.ModuleElement.UsesDirective;
@@ -239,11 +240,9 @@
         return set;
     }
 
-
-
     /**
-     * Returns a list of export directives in {@code directives}.
-     * @return a list of export directives in {@code directives}
+     * Returns a list of {@code exports} directives in {@code directives}.
+     * @return a list of {@code exports} directives in {@code directives}
      * @param directives the directives to filter
      * @since 9
      */
@@ -253,8 +252,19 @@
     }
 
     /**
-     * Returns a list of provides directives in {@code directives}.
-     * @return a list of provides directives in {@code directives}
+     * Returns a list of {@code opens} directives in {@code directives}.
+     * @return a list of {@code opens} directives in {@code directives}
+     * @param directives the directives to filter
+     * @since 9
+     */
+    public static List<OpensDirective>
+            opensIn(Iterable<? extends Directive> directives) {
+        return listFilter(directives, DirectiveKind.OPENS, OpensDirective.class);
+    }
+
+    /**
+     * Returns a list of {@code provides} directives in {@code directives}.
+     * @return a list of {@code provides} directives in {@code directives}
      * @param directives the directives to filter
      * @since 9
      */
@@ -264,8 +274,8 @@
     }
 
     /**
-     * Returns a list of requires directives in {@code directives}.
-     * @return a list of requires directives in {@code directives}
+     * Returns a list of {@code requires} directives in {@code directives}.
+     * @return a list of {@code requires} directives in {@code directives}
      * @param directives the directives to filter
      * @since 9
      */
@@ -275,8 +285,8 @@
     }
 
     /**
-     * Returns a list of uses directives in {@code directives}.
-     * @return a list of uses directives in {@code directives}
+     * Returns a list of {@code uses} directives in {@code directives}.
+     * @return a list of {@code uses} directives in {@code directives}
      * @param directives the directives to filter
      * @since 9
      */
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java	Fri Dec 16 05:47:58 2016 +0000
@@ -118,6 +118,7 @@
             if (source.compareTo(Source.JDK1_9) >= 0) {
                 values.add(LintCategory.DEP_ANN);
             }
+            values.add(LintCategory.MODULE);
             values.add(LintCategory.REMOVAL);
         }
 
@@ -205,6 +206,11 @@
         FINALLY("finally"),
 
         /**
+         * Warn about module system related issues.
+         */
+        MODULE("module"),
+
+        /**
          * Warn about issues relating to use of command line options
          */
         OPTIONS("options"),
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java	Fri Dec 16 05:47:58 2016 +0000
@@ -925,6 +925,7 @@
 
         public Completer usesProvidesCompleter = Completer.NULL_COMPLETER;
         public final Set<ModuleFlags> flags = EnumSet.noneOf(ModuleFlags.class);
+        public final Set<ModuleResolutionFlags> resolutionFlags = EnumSet.noneOf(ModuleResolutionFlags.class);
 
         /**
          * Create a ModuleSymbol with an associated module-info ClassSymbol.
@@ -1037,7 +1038,26 @@
         }
 
         public final int value;
+    }
 
+    public enum ModuleResolutionFlags {
+        DO_NOT_RESOLVE_BY_DEFAULT(0x0001),
+        WARN_DEPRECATED(0x0002),
+        WARN_DEPRECATED_REMOVAL(0x0004),
+        WARN_INCUBATOR(0x0008);
+
+        public static int value(Set<ModuleResolutionFlags> s) {
+            int v = 0;
+            for (ModuleResolutionFlags f: s)
+                v |= f.value;
+            return v;
+        }
+
+        private ModuleResolutionFlags(int value) {
+            this.value = value;
+        }
+
+        public final int value;
     }
 
     /** A class for package symbols
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Dec 16 05:47:58 2016 +0000
@@ -4444,7 +4444,7 @@
         ModuleSymbol msym = tree.sym;
         Lint lint = env.outer.info.lint = env.outer.info.lint.augment(msym);
         Lint prevLint = chk.setLint(lint);
-
+        chk.checkModuleName(tree);
         chk.checkDeprecatedAnnotation(tree, msym);
 
         try {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Fri Dec 16 05:47:58 2016 +0000
@@ -2116,6 +2116,18 @@
         }
     }
 
+    public void checkModuleName (JCModuleDecl tree) {
+        Name moduleName = tree.sym.name;
+        Assert.checkNonNull(moduleName);
+        if (lint.isEnabled(LintCategory.MODULE)) {
+            String moduleNameString = moduleName.toString();
+            int nameLength = moduleNameString.length();
+            if (nameLength > 0 && Character.isDigit(moduleNameString.charAt(nameLength - 1))) {
+                log.warning(Lint.LintCategory.MODULE, tree.qualId.pos(), Warnings.PoorChoiceForModuleName(moduleName));
+            }
+        }
+    }
+
     private boolean checkNameClash(ClassSymbol origin, Symbol s1, Symbol s2) {
         ClashFilter cf = new ClashFilter(origin.type);
         return (cf.accepts(s1) &&
@@ -3877,4 +3889,17 @@
                 log.warning(LintCategory.EXPORTS, pos, Warnings.LeaksNotAccessibleNotRequiredTransitive(kindName(what), what, what.packge().modle));
             }
         }
+
+    void checkModuleExists(final DiagnosticPosition pos, ModuleSymbol msym) {
+        if (msym.kind != MDL) {
+            deferredLintHandler.report(new DeferredLintHandler.LintLogger() {
+                @Override
+                public void report() {
+                    if (lint.isEnabled(Lint.LintCategory.MODULE))
+                        log.warning(LintCategory.MODULE, pos, Warnings.ModuleNotFound(msym));
+                }
+            });
+        }
+    }
+
 }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Fri Dec 16 05:47:58 2016 +0000
@@ -158,6 +158,7 @@
     private final Set<String> extraAddMods = new HashSet<>();
     private final String limitModsOpt;
     private final Set<String> extraLimitMods = new HashSet<>();
+    private final String moduleVersionOpt;
 
     private final boolean lintOptions;
 
@@ -203,6 +204,7 @@
         addReadsOpt = options.get(Option.ADD_READS);
         addModsOpt = options.get(Option.ADD_MODULES);
         limitModsOpt = options.get(Option.LIMIT_MODULES);
+        moduleVersionOpt = options.get(Option.MODULE_VERSION);
     }
 
     int depth = -1;
@@ -595,13 +597,16 @@
                 msym.flags_field |= UNATTRIBUTED;
                 ModuleVisitor v = new ModuleVisitor();
                 JavaFileObject prev = log.useSource(tree.sourcefile);
+                JCModuleDecl moduleDecl = tree.getModuleDecl();
+                DiagnosticPosition prevLintPos = deferredLintHandler.setPos(moduleDecl.pos());
+
                 try {
-                    JCModuleDecl moduleDecl = tree.getModuleDecl();
                     moduleDecl.accept(v);
                     completeModule(msym);
                     checkCyclicDependencies(moduleDecl);
                 } finally {
                     log.useSource(prev);
+                    deferredLintHandler.setPos(prevLintPos);
                     msym.flags_field &= ~UNATTRIBUTED;
                 }
             }
@@ -678,15 +683,12 @@
                 Set<ModuleSymbol> to = new LinkedHashSet<>();
                 for (JCExpression n: tree.moduleNames) {
                     ModuleSymbol msym = lookupModule(n);
-                    if (msym.kind != MDL) {
-                        log.error(n.pos(), Errors.ModuleNotFound(msym));
-                    } else {
-                        for (ExportsDirective d : exportsForPackage) {
-                            checkDuplicateExportsToModule(n, msym, d);
-                        }
-                        if (!to.add(msym)) {
-                            reportExportsConflictToModule(n, msym);
-                        }
+                    chk.checkModuleExists(n.pos(), msym);
+                    for (ExportsDirective d : exportsForPackage) {
+                        checkDuplicateExportsToModule(n, msym, d);
+                    }
+                    if (!to.add(msym)) {
+                        reportExportsConflictToModule(n, msym);
                     }
                 }
                 toModules = List.from(to);
@@ -740,15 +742,12 @@
                 Set<ModuleSymbol> to = new LinkedHashSet<>();
                 for (JCExpression n: tree.moduleNames) {
                     ModuleSymbol msym = lookupModule(n);
-                    if (msym.kind != MDL) {
-                        log.error(n.pos(), Errors.ModuleNotFound(msym));
-                    } else {
-                        for (OpensDirective d : opensForPackage) {
-                            checkDuplicateOpensToModule(n, msym, d);
-                        }
-                        if (!to.add(msym)) {
-                            reportOpensConflictToModule(n, msym);
-                        }
+                    chk.checkModuleExists(n.pos(), msym);
+                    for (OpensDirective d : opensForPackage) {
+                        checkDuplicateOpensToModule(n, msym, d);
+                    }
+                    if (!to.add(msym)) {
+                        reportOpensConflictToModule(n, msym);
                     }
                 }
                 toModules = List.from(to);
@@ -1133,6 +1132,12 @@
         result.add(syms.unnamedModule);
 
         allModules = result;
+
+        //add module versions from options, if any:
+        if (moduleVersionOpt != null) {
+            Name version = names.fromString(moduleVersionOpt);
+            rootModules.forEach(m -> m.version = version);
+        }
     }
 
     public boolean isInModuleGraph(ModuleSymbol msym) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Fri Dec 16 05:47:58 2016 +0000
@@ -85,6 +85,8 @@
     public final static int CONSTANT_MethodHandle = 15;
     public final static int CONSTANT_MethodType = 16;
     public final static int CONSTANT_InvokeDynamic = 18;
+    public final static int CONSTANT_Module = 19;
+    public final static int CONSTANT_Package = 20;
 
     public final static int REF_getField = 1;
     public final static int REF_getStatic = 2;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Fri Dec 16 05:47:58 2016 +0000
@@ -161,9 +161,6 @@
      */
     protected ModuleSymbol currentModule = null;
 
-    // FIXME: temporary compatibility code
-    private boolean readNewModuleAttribute;
-
     /** The buffer containing the currently read class file.
      */
     byte[] buf = new byte[INITIAL_BUFFER_SIZE];
@@ -392,6 +389,8 @@
             case CONSTANT_Class:
             case CONSTANT_String:
             case CONSTANT_MethodType:
+            case CONSTANT_Module:
+            case CONSTANT_Package:
                 bp = bp + 2;
                 break;
             case CONSTANT_MethodHandle:
@@ -481,6 +480,11 @@
         case CONSTANT_InvokeDynamic:
             skipBytes(5);
             break;
+        case CONSTANT_Module:
+        case CONSTANT_Package:
+            // this is temporary for now: treat as a simple reference to the underlying Utf8.
+            poolObj[i] = readName(getChar(index + 1));
+            break;
         default:
             throw badClassFile("bad.const.pool.tag", Byte.toString(tag));
         }
@@ -567,40 +571,12 @@
         return (NameAndType)obj;
     }
 
-    /** Read the class name of a module-info.class file.
-     * The name is stored in a CONSTANT_Class entry, where the
-     * class name is of the form module-name.module-info.
-     */
-    Name readModuleInfoName(int i) {
-        if (majorVersion < Version.V53.major) {
-            throw badClassFile("anachronistic.module.info",
-                    Integer.toString(majorVersion),
-                    Integer.toString(minorVersion));
-        }
-        int classIndex = poolIdx[i];
-        if (buf[classIndex] == CONSTANT_Class) {
-            int utf8Index = poolIdx[getChar(classIndex + 1)];
-            if (buf[utf8Index] == CONSTANT_Utf8) {
-                int len = getChar(utf8Index + 1);
-                int start = utf8Index + 3;
-                return names.fromUtf(internalize(buf, start, len));
-            }
-        }
-        throw badClassFile("bad.module-info.name");
-    }
-
     /** Read the name of a module.
-     * The name is stored in a CONSTANT_Utf8 entry, in
-     * JVMS 4.2 internal form (with '/' instead of '.')
+     * The name is stored in a CONSTANT_Module entry, in
+     * JVMS 4.2 binary form (using ".", not "/")
      */
     Name readModuleName(int i) {
-        Name name = readName(i);
-        // FIXME: temporary compatibility code
-        if (readNewModuleAttribute) {
-            return names.fromUtf(internalize(name));
-        } else {
-            return name;
-        }
+        return readName(i);
     }
 
     /** Read module_flags.
@@ -614,6 +590,17 @@
         return set;
     }
 
+    /** Read resolution_flags.
+     */
+    Set<ModuleResolutionFlags> readModuleResolutionFlags(int flags) {
+        Set<ModuleResolutionFlags> set = EnumSet.noneOf(ModuleResolutionFlags.class);
+        for (ModuleResolutionFlags f : ModuleResolutionFlags.values()) {
+            if ((flags & f.value) != 0)
+                set.add(f);
+        }
+        return set;
+    }
+
     /** Read exports_flags.
      */
     Set<ExportsFlag> readExportsFlags(int flags) {
@@ -1282,21 +1269,20 @@
                         ModuleSymbol msym = (ModuleSymbol) sym.owner;
                         ListBuffer<Directive> directives = new ListBuffer<>();
 
-                        // FIXME: temporary compatibility code
-                        if (readNewModuleAttribute) {
-                            Name moduleName = readModuleName(nextChar());
-                            if (currentModule.name != moduleName) {
-                                throw badClassFile("module.name.mismatch", moduleName, currentModule.name);
-                            }
+                        Name moduleName = readModuleName(nextChar());
+                        if (currentModule.name != moduleName) {
+                            throw badClassFile("module.name.mismatch", moduleName, currentModule.name);
                         }
 
                         msym.flags.addAll(readModuleFlags(nextChar()));
+                        msym.version = readName(nextChar());
 
                         ListBuffer<RequiresDirective> requires = new ListBuffer<>();
                         int nrequires = nextChar();
                         for (int i = 0; i < nrequires; i++) {
                             ModuleSymbol rsym = syms.enterModule(readModuleName(nextChar()));
                             Set<RequiresFlag> flags = readRequiresFlags(nextChar());
+                            nextChar(); // skip compiled version
                             requires.add(new RequiresDirective(rsym, flags));
                         }
                         msym.requires = requires.toList();
@@ -1372,7 +1358,7 @@
                 }
             },
 
-            new AttributeReader(names.ModuleVersion, V53, CLASS_ATTRIBUTE) {
+            new AttributeReader(names.ModuleResolution, V53, CLASS_ATTRIBUTE) {
                 @Override
                 protected boolean accepts(AttributeKind kind) {
                     return super.accepts(kind) && allowModules;
@@ -1380,7 +1366,7 @@
                 protected void read(Symbol sym, int attrLen) {
                     if (sym.kind == TYP && sym.owner.kind == MDL) {
                         ModuleSymbol msym = (ModuleSymbol) sym.owner;
-                        msym.version = readName(nextChar());
+                        msym.resolutionFlags.addAll(readModuleResolutionFlags(nextChar()));
                     }
                 }
             },
@@ -2564,24 +2550,15 @@
                                    self.flatname);
             }
         } else {
+            if (majorVersion < Version.V53.major) {
+                throw badClassFile("anachronistic.module.info",
+                        Integer.toString(majorVersion),
+                        Integer.toString(minorVersion));
+            }
             c.flags_field = flags;
             currentModule = (ModuleSymbol) c.owner;
             int this_class = nextChar();
-            // FIXME: temporary compatibility code
-            if (this_class == 0) {
-                readNewModuleAttribute = true;
-            } else {
-                Name modInfoName = readModuleInfoName(this_class);
-                if (currentModule.name.append('.', names.module_info) != modInfoName) {
-                    //strip trailing .module-info, if exists:
-                    int modInfoStart = modInfoName.length() - names.module_info.length();
-                    modInfoName = modInfoName.subName(modInfoStart, modInfoName.length()) == names.module_info &&
-                                  modInfoName.charAt(modInfoStart - 1) == '.' ?
-                                      modInfoName.subName(0, modInfoStart - 1) : modInfoName;
-                    throw badClassFile("module.name.mismatch", modInfoName, currentModule.name);
-                }
-                readNewModuleAttribute = false;
-            }
+            // temp, no check on this_class
         }
 
         // class attributes must be read before class
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Fri Dec 16 05:47:58 2016 +0000
@@ -474,6 +474,14 @@
                 poolbuf.appendByte(CONSTANT_MethodHandle);
                 poolbuf.appendByte(ref.refKind);
                 poolbuf.appendChar(pool.put(ref.refSym));
+            } else if (value instanceof ModuleSymbol) {
+                ModuleSymbol m = (ModuleSymbol)value;
+                poolbuf.appendByte(CONSTANT_Module);
+                poolbuf.appendChar(pool.put(m.name));
+            } else if (value instanceof PackageSymbol) {
+                PackageSymbol m = (PackageSymbol)value;
+                poolbuf.appendByte(CONSTANT_Package);
+                poolbuf.appendChar(pool.put(names.fromUtf(externalize(m.fullname))));
             } else {
                 Assert.error("writePool " + value);
             }
@@ -954,8 +962,9 @@
 
         int alenIdx = writeAttr(names.Module);
 
-        databuf.appendChar(pool.put(names.fromUtf(externalize(m.name))));
+        databuf.appendChar(pool.put(m));
         databuf.appendChar(ModuleFlags.value(m.flags)); // module_flags
+        databuf.appendChar(m.version != null ? pool.put(m.version) : 0);
 
         ListBuffer<RequiresDirective> requires = new ListBuffer<>();
         for (RequiresDirective r: m.requires) {
@@ -964,21 +973,22 @@
         }
         databuf.appendChar(requires.size());
         for (RequiresDirective r: requires) {
-            databuf.appendChar(pool.put(names.fromUtf(externalize(r.module.name))));
+            databuf.appendChar(pool.put(r.module));
             databuf.appendChar(RequiresFlag.value(r.flags));
+            databuf.appendChar(r.module.version != null ? pool.put(r.module.version) : 0);
         }
 
         List<ExportsDirective> exports = m.exports;
         databuf.appendChar(exports.size());
         for (ExportsDirective e: exports) {
-            databuf.appendChar(pool.put(names.fromUtf(externalize(e.packge.flatName()))));
+            databuf.appendChar(pool.put(e.packge));
             databuf.appendChar(ExportsFlag.value(e.flags));
             if (e.modules == null) {
                 databuf.appendChar(0);
             } else {
                 databuf.appendChar(e.modules.size());
                 for (ModuleSymbol msym: e.modules) {
-                    databuf.appendChar(pool.put(names.fromUtf(externalize(msym.name))));
+                    databuf.appendChar(pool.put(msym));
                 }
             }
         }
@@ -986,14 +996,14 @@
         List<OpensDirective> opens = m.opens;
         databuf.appendChar(opens.size());
         for (OpensDirective o: opens) {
-            databuf.appendChar(pool.put(names.fromUtf(externalize(o.packge.flatName()))));
+            databuf.appendChar(pool.put(o.packge));
             databuf.appendChar(OpensFlag.value(o.flags));
             if (o.modules == null) {
                 databuf.appendChar(0);
             } else {
                 databuf.appendChar(o.modules.size());
                 for (ModuleSymbol msym: o.modules) {
-                    databuf.appendChar(pool.put(names.fromUtf(externalize(msym.name))));
+                    databuf.appendChar(pool.put(msym));
                 }
             }
         }
@@ -1718,7 +1728,8 @@
         databuf.appendChar(flags);
 
         if (c.owner.kind == MDL) {
-            databuf.appendChar(0);
+            PackageSymbol unnamed = ((ModuleSymbol) c.owner).unnamedPackage;
+            databuf.appendChar(pool.put(new ClassSymbol(0, names.module_info, unnamed)));
         } else {
             databuf.appendChar(pool.put(c));
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ModuleNameReader.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ModuleNameReader.java	Fri Dec 16 05:47:58 2016 +0000
@@ -100,30 +100,24 @@
         if (access_flags != 0x8000)
             throw new BadClassFile("invalid access flags for module: 0x" + Integer.toHexString(access_flags));
 
-        // FIXME: temporary compatibility code
         int this_class = nextChar();
-        if (this_class == 0) {
-            // new form
-            checkZero(nextChar(), "super_class");
-            checkZero(nextChar(), "interface_count");
-            checkZero(nextChar(), "fields_count");
-            checkZero(nextChar(), "methods_count");
-            int attributes_count = nextChar();
-            for (int i = 0; i < attributes_count; i++) {
-                int attr_name = nextChar();
-                int attr_length = nextInt();
-                if (getUtf8Value(attr_name, false).equals("Module") && attr_length > 2) {
-                    return getUtf8Value(nextChar(), true);
-                } else {
-                    // skip over unknown attributes
-                    bp += attr_length;
-                }
+        // could, should, check this_class == CONSTANT_Class("mdoule-info")
+        checkZero(nextChar(), "super_class");
+        checkZero(nextChar(), "interface_count");
+        checkZero(nextChar(), "fields_count");
+        checkZero(nextChar(), "methods_count");
+        int attributes_count = nextChar();
+        for (int i = 0; i < attributes_count; i++) {
+            int attr_name = nextChar();
+            int attr_length = nextInt();
+            if (getUtf8Value(attr_name, false).equals("Module") && attr_length > 2) {
+                return getModuleName(nextChar());
+            } else {
+                // skip over unknown attributes
+                bp += attr_length;
             }
-            throw new BadClassFile("no Module attribute");
-        } else {
-            // old form
-            return readModuleInfoName(this_class);
         }
+        throw new BadClassFile("no Module attribute");
     }
 
     void checkZero(int count, String name) throws BadClassFile {
@@ -172,6 +166,8 @@
             case CONSTANT_Class:
             case CONSTANT_String:
             case CONSTANT_MethodType:
+            case CONSTANT_Module:
+            case CONSTANT_Package:
                 bp = bp + 2;
                 break;
             case CONSTANT_MethodHandle:
@@ -211,33 +207,13 @@
         throw new BadClassFile("bad name at index " + index);
     }
 
-    /** Read the class name of a module-info.class file.
-     * The name is stored in a CONSTANT_Class entry, where the
-     * class name is of the form module-name/module-info.
-     */
-    String readModuleInfoName(int i) throws BadClassFile {
-        int classIndex = poolIdx[i];
-        if (buf[classIndex] == CONSTANT_Class) {
-            int utf8Index = poolIdx[getChar(classIndex + 1)];
-            if (buf[utf8Index] == CONSTANT_Utf8) {
-                int len = getChar(utf8Index + 1);
-                int start = utf8Index + 3;
-                String suffix = "/module-info";
-                if (endsWith(buf, start, len, suffix))
-                    return new String(ClassFile.internalize(buf, start, len - suffix.length()));
-            }
+    String getModuleName(int index) throws BadClassFile {
+        int infoIndex = poolIdx[index];
+        if (buf[infoIndex] == CONSTANT_Module) {
+            return getUtf8Value(getChar(infoIndex + 1), true);
+        } else {
+            throw new BadClassFile("bad module name at index " + index);
         }
-        throw new BadClassFile("bad module-info name");
-    }
-
-    private boolean endsWith(byte[] buf, int start, int len, String suffix) {
-        if (len <= suffix.length())
-            return false;
-        for (int i = 0; i < suffix.length(); i++) {
-            if (buf[start + len - suffix.length() + i] != suffix.charAt(i))
-                return false;
-        }
-        return true;
     }
 
     private static byte[] readInputStream(byte[] buf, InputStream s) throws IOException {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java	Fri Dec 16 05:47:58 2016 +0000
@@ -582,7 +582,8 @@
                 Option.BOOT_CLASS_PATH,
                 Option.XBOOTCLASSPATH_PREPEND, Option.XBOOTCLASSPATH, Option.XBOOTCLASSPATH_APPEND,
                 Option.ENDORSEDDIRS, Option.DJAVA_ENDORSED_DIRS,
-                Option.EXTDIRS, Option.DJAVA_EXT_DIRS);
+                Option.EXTDIRS, Option.DJAVA_EXT_DIRS,
+                Option.PROFILE);
 
         checkOptionAllowed(t.compareTo(Target.JDK1_9) >= 0,
                 option -> error("err.option.not.allowed.with.target", option.getPrimaryName(), t.name),
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Fri Dec 16 05:47:58 2016 +0000
@@ -35,16 +35,12 @@
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.EnumSet;
-import java.util.HashSet;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.Locale;
-import java.util.Map;
 import java.util.ServiceLoader;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.StreamSupport;
@@ -60,7 +56,6 @@
 import com.sun.tools.javac.jvm.Target;
 import com.sun.tools.javac.platform.PlatformProvider;
 import com.sun.tools.javac.processing.JavacProcessingEnvironment;
-import com.sun.tools.javac.resources.CompilerProperties.Errors;
 import com.sun.tools.javac.util.Assert;
 import com.sun.tools.javac.util.JDK9Wrappers;
 import com.sun.tools.javac.util.Log;
@@ -634,6 +629,33 @@
         }
     },
 
+    MODULE_VERSION("--module-version", "opt.arg.module.version", "opt.module.version", STANDARD, BASIC) {
+        @Override
+        public void process(OptionHelper helper, String option, String arg) throws InvalidValueException {
+            if (arg.isEmpty()) {
+                throw helper.newInvalidValueException("err.no.value.for.option", option);
+            } else {
+                try {
+                    Class.forName(JDK9Wrappers.ModuleDescriptor.Version.CLASSNAME);
+                    // use official parser if available
+                    try {
+                        JDK9Wrappers.ModuleDescriptor.Version.parse(arg);
+                    } catch (IllegalArgumentException e) {
+                        throw helper.newInvalidValueException("err.bad.value.for.option", option, arg);
+                    }
+                } catch (ClassNotFoundException ex) {
+                    // fall-back to simplistic rules when running on older platform
+                    if (!(arg.charAt(0) >= '0' && arg.charAt(0) <= '9') ||
+                        arg.endsWith("-") ||
+                        arg.endsWith("+")) {
+                        throw helper.newInvalidValueException("err.bad.value.for.option", option, arg);
+                    }
+                }
+            }
+            super.process(helper, option, arg);
+        }
+    },
+
     // This option exists only for the purpose of documenting itself.
     // It's actually implemented by the CommandLine class.
     AT("@", "opt.arg.file", "opt.AT", STANDARD, INFO, ArgKind.ADJACENT) {
@@ -681,7 +703,7 @@
         @Override
         public void process(OptionHelper helper, String option) throws InvalidValueException {
             try {
-                Class.forName(JDK9Wrappers.VMHelper.VM_CLASSNAME);
+                Class.forName(JDK9Wrappers.VMHelper.CLASSNAME);
                 String[] runtimeArgs = JDK9Wrappers.VMHelper.getRuntimeArguments();
                 for (String arg : runtimeArgs) {
                     // Handle any supported runtime options; ignore all others.
@@ -1035,7 +1057,7 @@
      * @param helper a helper to provide access to the environment
      * @param arg the arg string that identified this option
      * @param rest the remaining strings to be analysed
-     * @return true if the operation was successful, and false otherwise
+     * @throws InvalidValueException if the value of the option was invalid
      * @implNote The return value is the opposite of that used by {@link #process}.
      */
     public void handleOption(OptionHelper helper, String arg, Iterator<String> rest) throws InvalidValueException {
@@ -1084,6 +1106,7 @@
      * @param option the option to be processed
      * @param arg the value to associate with the option, or a default value
      *  to be used if the option does not otherwise take an argument.
+     * @throws InvalidValueException if an error occurred
      */
     public void process(OptionHelper helper, String option, String arg) throws InvalidValueException {
         if (choices != null) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Fri Dec 16 05:47:58 2016 +0000
@@ -1457,6 +1457,10 @@
 compiler.warn.finally.cannot.complete=\
     finally clause cannot complete normally
 
+# 0: name
+compiler.warn.poor.choice.for.module.name=\
+    module name {0} should avoid terminal digits
+
 # 0: symbol, 1: symbol
 compiler.warn.has.been.deprecated=\
     {0} in {1} has been deprecated
@@ -2749,6 +2753,10 @@
 compiler.err.module.not.found=\
     module not found: {0}
 
+# 0: symbol
+compiler.warn.module.not.found=\
+    module not found: {0}
+
 compiler.err.too.many.modules=\
     too many module declarations found
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties	Fri Dec 16 05:47:58 2016 +0000
@@ -201,6 +201,9 @@
 javac.opt.Xlint.desc.finally=\
     Warn about finally clauses that do not terminate normally.
 
+javac.opt.Xlint.desc.module=\
+    Warn about module system related issues.
+
 javac.opt.Xlint.desc.options=\
     Warn about issues relating to use of command line options.
 
@@ -308,6 +311,10 @@
     Limit the universe of observable modules
 javac.opt.arg.limitmods=\
     <module>(,<module>)*
+javac.opt.module.version=\
+    Specify version of modules that are being compiled
+javac.opt.arg.module.version=\
+    <version>
 javac.opt.inherit_runtime_environment=\
     Inherit module system configuration options from the runtime environment.
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java	Fri Dec 16 05:47:58 2016 +0000
@@ -462,11 +462,22 @@
     @Override
     public void visitExports(JCExports tree) {
         try {
-            if (tree.hasTag(EXPORTS)) {
-                print("exports ");
-            } else {
-                print("opens ");
+            print("exports ");
+            printExpr(tree.qualid);
+            if (tree.moduleNames != null) {
+                print(" to ");
+                printExprs(tree.moduleNames);
             }
+            print(";");
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+
+    @Override
+    public void visitOpens(JCOpens tree) {
+        try {
+            print("opens ");
             printExpr(tree.qualid);
             if (tree.moduleNames != null) {
                 print(" to ");
@@ -1493,7 +1504,7 @@
 
     public void visitTree(JCTree tree) {
         try {
-            print("(UNKNOWN: " + tree + ")");
+            print("(UNKNOWN: " + tree.getTag() + ")");
             println();
         } catch (IOException e) {
             throw new UncheckedIOException(e);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JDK9Wrappers.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JDK9Wrappers.java	Fri Dec 16 05:47:58 2016 +0000
@@ -86,6 +86,58 @@
     }
 
     /**
+     * Wrapper class for java.lang.module.ModuleDescriptor and ModuleDescriptor.Version.
+     */
+    public static class ModuleDescriptor {
+        public static class Version {
+            public static final String CLASSNAME = "java.lang.module.ModuleDescriptor$Version";
+            private final Object theRealVersion;
+
+            private Version(Object version) {
+                this.theRealVersion = version;
+            }
+
+            public static Version parse(String v) {
+                try {
+                    init();
+                    Object result = parseMethod.invoke(null, v);
+                    Version version = new Version(result);
+                    return version;
+                } catch (InvocationTargetException ex) {
+                    if (ex.getCause() instanceof IllegalArgumentException) {
+                        throw (IllegalArgumentException) ex.getCause();
+                    } else {
+                        throw new Abort(ex);
+                    }
+                } catch (IllegalAccessException | IllegalArgumentException | SecurityException ex) {
+                    throw new Abort(ex);
+                }
+            }
+
+            @Override
+            public String toString() {
+                return theRealVersion.toString();
+            }
+
+            // -----------------------------------------------------------------------------------------
+
+            private static Class<?> versionClass = null;
+            private static Method parseMethod = null;
+
+            private static void init() {
+                if (versionClass == null) {
+                    try {
+                        versionClass = Class.forName(CLASSNAME, false, null);
+                        parseMethod = versionClass.getDeclaredMethod("parse", String.class);
+                    } catch (ClassNotFoundException | NoSuchMethodException | SecurityException ex) {
+                        throw new Abort(ex);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
      * Wrapper class for java.lang.module.ModuleFinder.
      */
     public static class ModuleFinder {
@@ -338,7 +390,7 @@
      * Helper class for new method in jdk.internal.misc.VM.
      */
     public static final class VMHelper {
-        public static final String VM_CLASSNAME = "jdk.internal.misc.VM";
+        public static final String CLASSNAME = "jdk.internal.misc.VM";
 
         @SuppressWarnings("unchecked")
         public static String[] getRuntimeArguments() {
@@ -360,7 +412,7 @@
         private static void init() {
             if (vmClass == null) {
                 try {
-                    vmClass = Class.forName(VM_CLASSNAME, false, null);
+                    vmClass = Class.forName(CLASSNAME, false, null);
                     getRuntimeArgumentsMethod = vmClass.getDeclaredMethod("getRuntimeArguments");
                 } catch (ClassNotFoundException | NoSuchMethodException | SecurityException ex) {
                     throw new Abort(ex);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java	Fri Dec 16 05:47:58 2016 +0000
@@ -150,7 +150,7 @@
     public final Name LocalVariableTypeTable;
     public final Name MethodParameters;
     public final Name Module;
-    public final Name ModuleVersion;
+    public final Name ModuleResolution;
     public final Name RuntimeInvisibleAnnotations;
     public final Name RuntimeInvisibleParameterAnnotations;
     public final Name RuntimeInvisibleTypeAnnotations;
@@ -312,7 +312,7 @@
         LocalVariableTypeTable = fromString("LocalVariableTypeTable");
         MethodParameters = fromString("MethodParameters");
         Module = fromString("Module");
-        ModuleVersion = fromString("ModuleVersion");
+        ModuleResolution = fromString("ModuleResolution");
         RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations");
         RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
         RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java	Fri Dec 16 05:47:58 2016 +0000
@@ -56,8 +56,8 @@
     public static final String ModuleHashes             = "ModuleHashes";
     public static final String ModuleMainClass          = "ModuleMainClass";
     public static final String ModulePackages           = "ModulePackages";
+    public static final String ModuleResolution         = "ModuleResolution";
     public static final String ModuleTarget             = "ModuleTarget";
-    public static final String ModuleVersion            = "ModuleVersion";
     public static final String RuntimeVisibleAnnotations = "RuntimeVisibleAnnotations";
     public static final String RuntimeInvisibleAnnotations = "RuntimeInvisibleAnnotations";
     public static final String RuntimeVisibleParameterAnnotations = "RuntimeVisibleParameterAnnotations";
@@ -128,8 +128,8 @@
             standardAttributes.put(ModuleHashes,      ModuleHashes_attribute.class);
             standardAttributes.put(ModuleMainClass,   ModuleMainClass_attribute.class);
             standardAttributes.put(ModulePackages,    ModulePackages_attribute.class);
+            standardAttributes.put(ModuleResolution,  ModuleResolution_attribute.class);
             standardAttributes.put(ModuleTarget,      ModuleTarget_attribute.class);
-            standardAttributes.put(ModuleVersion,     ModuleVersion_attribute.class);
             standardAttributes.put(RuntimeInvisibleAnnotations, RuntimeInvisibleAnnotations_attribute.class);
             standardAttributes.put(RuntimeInvisibleParameterAnnotations, RuntimeInvisibleParameterAnnotations_attribute.class);
             standardAttributes.put(RuntimeVisibleAnnotations, RuntimeVisibleAnnotations_attribute.class);
@@ -191,8 +191,8 @@
         R visitModuleHashes(ModuleHashes_attribute attr, P p);
         R visitModuleMainClass(ModuleMainClass_attribute attr, P p);
         R visitModulePackages(ModulePackages_attribute attr, P p);
+        R visitModuleResolution(ModuleResolution_attribute attr, P p);
         R visitModuleTarget(ModuleTarget_attribute attr, P p);
-        R visitModuleVersion(ModuleVersion_attribute attr, P p);
         R visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, P p);
         R visitRuntimeInvisibleAnnotations(RuntimeInvisibleAnnotations_attribute attr, P p);
         R visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute attr, P p);
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassTranslator.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassTranslator.java	Fri Dec 16 05:47:58 2016 +0000
@@ -38,7 +38,9 @@
 import com.sun.tools.classfile.ConstantPool.CONSTANT_MethodHandle_info;
 import com.sun.tools.classfile.ConstantPool.CONSTANT_MethodType_info;
 import com.sun.tools.classfile.ConstantPool.CONSTANT_Methodref_info;
+import com.sun.tools.classfile.ConstantPool.CONSTANT_Module_info;
 import com.sun.tools.classfile.ConstantPool.CONSTANT_NameAndType_info;
+import com.sun.tools.classfile.ConstantPool.CONSTANT_Package_info;
 import com.sun.tools.classfile.ConstantPool.CONSTANT_String_info;
 import com.sun.tools.classfile.ConstantPool.CONSTANT_Utf8_info;
 import com.sun.tools.classfile.ConstantPool.CPInfo;
@@ -242,6 +244,7 @@
         return true;
     }
 
+    @Override
     public CPInfo visitClass(CONSTANT_Class_info info, Map<Object, Object> translations) {
         CONSTANT_Class_info info2 = (CONSTANT_Class_info) translations.get(info);
         if (info2 == null) {
@@ -255,6 +258,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitDouble(CONSTANT_Double_info info, Map<Object, Object> translations) {
         CONSTANT_Double_info info2 = (CONSTANT_Double_info) translations.get(info);
         if (info2 == null) {
@@ -264,6 +268,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitFieldref(CONSTANT_Fieldref_info info, Map<Object, Object> translations) {
         CONSTANT_Fieldref_info info2 = (CONSTANT_Fieldref_info) translations.get(info);
         if (info2 == null) {
@@ -277,6 +282,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitFloat(CONSTANT_Float_info info, Map<Object, Object> translations) {
         CONSTANT_Float_info info2 = (CONSTANT_Float_info) translations.get(info);
         if (info2 == null) {
@@ -286,6 +292,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitInteger(CONSTANT_Integer_info info, Map<Object, Object> translations) {
         CONSTANT_Integer_info info2 = (CONSTANT_Integer_info) translations.get(info);
         if (info2 == null) {
@@ -295,6 +302,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Map<Object, Object> translations) {
         CONSTANT_InterfaceMethodref_info info2 = (CONSTANT_InterfaceMethodref_info) translations.get(info);
         if (info2 == null) {
@@ -308,6 +316,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitInvokeDynamic(CONSTANT_InvokeDynamic_info info, Map<Object, Object> translations) {
         CONSTANT_InvokeDynamic_info info2 = (CONSTANT_InvokeDynamic_info) translations.get(info);
         if (info2 == null) {
@@ -322,6 +331,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitLong(CONSTANT_Long_info info, Map<Object, Object> translations) {
         CONSTANT_Long_info info2 = (CONSTANT_Long_info) translations.get(info);
         if (info2 == null) {
@@ -331,19 +341,7 @@
         return info;
     }
 
-    public CPInfo visitNameAndType(CONSTANT_NameAndType_info info, Map<Object, Object> translations) {
-        CONSTANT_NameAndType_info info2 = (CONSTANT_NameAndType_info) translations.get(info);
-        if (info2 == null) {
-            ConstantPool cp2 = translate(info.cp, translations);
-            if (cp2 == info.cp)
-                info2 = info;
-            else
-                info2 = new CONSTANT_NameAndType_info(cp2, info.name_index, info.type_index);
-            translations.put(info, info2);
-        }
-        return info;
-    }
-
+    @Override
     public CPInfo visitMethodref(CONSTANT_Methodref_info info, Map<Object, Object> translations) {
         CONSTANT_Methodref_info info2 = (CONSTANT_Methodref_info) translations.get(info);
         if (info2 == null) {
@@ -357,6 +355,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitMethodHandle(CONSTANT_MethodHandle_info info, Map<Object, Object> translations) {
         CONSTANT_MethodHandle_info info2 = (CONSTANT_MethodHandle_info) translations.get(info);
         if (info2 == null) {
@@ -371,6 +370,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitMethodType(CONSTANT_MethodType_info info, Map<Object, Object> translations) {
         CONSTANT_MethodType_info info2 = (CONSTANT_MethodType_info) translations.get(info);
         if (info2 == null) {
@@ -385,6 +385,49 @@
         return info;
     }
 
+    @Override
+    public CPInfo visitModule(CONSTANT_Module_info info, Map<Object, Object> translations) {
+        CONSTANT_Module_info info2 = (CONSTANT_Module_info) translations.get(info);
+        if (info2 == null) {
+            ConstantPool cp2 = translate(info.cp, translations);
+            if (cp2 == info.cp)
+                info2 = info;
+            else
+                info2 = new CONSTANT_Module_info(cp2, info.name_index);
+            translations.put(info, info2);
+        }
+        return info;
+    }
+
+    @Override
+    public CPInfo visitNameAndType(CONSTANT_NameAndType_info info, Map<Object, Object> translations) {
+        CONSTANT_NameAndType_info info2 = (CONSTANT_NameAndType_info) translations.get(info);
+        if (info2 == null) {
+            ConstantPool cp2 = translate(info.cp, translations);
+            if (cp2 == info.cp)
+                info2 = info;
+            else
+                info2 = new CONSTANT_NameAndType_info(cp2, info.name_index, info.type_index);
+            translations.put(info, info2);
+        }
+        return info;
+    }
+
+    @Override
+    public CPInfo visitPackage(CONSTANT_Package_info info, Map<Object, Object> translations) {
+        CONSTANT_Package_info info2 = (CONSTANT_Package_info) translations.get(info);
+        if (info2 == null) {
+            ConstantPool cp2 = translate(info.cp, translations);
+            if (cp2 == info.cp)
+                info2 = info;
+            else
+                info2 = new CONSTANT_Package_info(cp2, info.name_index);
+            translations.put(info, info2);
+        }
+        return info;
+    }
+
+    @Override
     public CPInfo visitString(CONSTANT_String_info info, Map<Object, Object> translations) {
         CONSTANT_String_info info2 = (CONSTANT_String_info) translations.get(info);
         if (info2 == null) {
@@ -398,6 +441,7 @@
         return info;
     }
 
+    @Override
     public CPInfo visitUtf8(CONSTANT_Utf8_info info, Map<Object, Object> translations) {
         CONSTANT_Utf8_info info2 = (CONSTANT_Utf8_info) translations.get(info);
         if (info2 == null) {
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Fri Dec 16 05:47:58 2016 +0000
@@ -290,13 +290,6 @@
         }
 
         @Override
-        public Integer visitNameAndType(CONSTANT_NameAndType_info info, ClassOutputStream out) {
-            out.writeShort(info.name_index);
-            out.writeShort(info.type_index);
-            return 1;
-        }
-
-        @Override
         public Integer visitMethodHandle(CONSTANT_MethodHandle_info info, ClassOutputStream out) {
             out.writeByte(info.reference_kind.tag);
             out.writeShort(info.reference_index);
@@ -315,6 +308,25 @@
         }
 
         @Override
+        public Integer visitModule(CONSTANT_Module_info info, ClassOutputStream out) {
+            out.writeShort(info.name_index);
+            return 1;
+        }
+
+        @Override
+        public Integer visitNameAndType(CONSTANT_NameAndType_info info, ClassOutputStream out) {
+            out.writeShort(info.name_index);
+            out.writeShort(info.type_index);
+            return 1;
+        }
+
+        @Override
+        public Integer visitPackage(CONSTANT_Package_info info, ClassOutputStream out) {
+            out.writeShort(info.name_index);
+            return 1;
+        }
+
+        @Override
         public Integer visitString(CONSTANT_String_info info, ClassOutputStream out) {
             out.writeShort(info.string_index);
             return 1;
@@ -425,14 +437,6 @@
         }
 
         @Override
-        public Void visitModulePackages(ModulePackages_attribute attr, ClassOutputStream out) {
-            out.writeShort(attr.packages_count);
-            for (int i: attr.packages_index)
-                out.writeShort(i);
-            return null;
-        }
-
-        @Override
         public Void visitConstantValue(ConstantValue_attribute attr, ClassOutputStream out) {
             out.writeShort(attr.constantvalue_index);
             return null;
@@ -466,20 +470,6 @@
             return null;
         }
 
-        @Override
-        public Void visitModuleHashes(ModuleHashes_attribute attr, ClassOutputStream out) {
-            out.writeShort(attr.algorithm_index);
-            out.writeShort(attr.hashes_table.length);
-            for (ModuleHashes_attribute.Entry e: attr.hashes_table) {
-                out.writeShort(e.module_name_index);
-                out.writeShort(e.hash.length);
-                for (byte b: e.hash) {
-                    out.writeByte(b);
-                }
-            }
-            return null;
-        }
-
         protected void writeInnerClassesInfo(InnerClasses_attribute.Info info, ClassOutputStream out) {
             out.writeShort(info.inner_class_info_index);
             out.writeShort(info.outer_class_info_index);
@@ -543,20 +533,16 @@
         }
 
         @Override
-        public Void visitModuleMainClass(ModuleMainClass_attribute attr, ClassOutputStream out) {
-            out.writeShort(attr.main_class_index);
-            return null;
-        }
-
-        @Override
         public Void visitModule(Module_attribute attr, ClassOutputStream out) {
             out.writeShort(attr.module_name);
             out.writeShort(attr.module_flags);
+            out.writeShort(attr.module_version_index);
 
             out.writeShort(attr.requires.length);
             for (Module_attribute.RequiresEntry e: attr.requires) {
                 out.writeShort(e.requires_index);
                 out.writeShort(e.requires_flags);
+                out.writeShort(e.requires_version_index);
             }
 
             out.writeShort(attr.exports.length);
@@ -595,8 +581,44 @@
         }
 
         @Override
-        public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, ClassOutputStream out) {
-            annotationWriter.write(attr.annotations, out);
+        public Void visitModuleHashes(ModuleHashes_attribute attr, ClassOutputStream out) {
+            out.writeShort(attr.algorithm_index);
+            out.writeShort(attr.hashes_table.length);
+            for (ModuleHashes_attribute.Entry e: attr.hashes_table) {
+                out.writeShort(e.module_name_index);
+                out.writeShort(e.hash.length);
+                for (byte b: e.hash) {
+                    out.writeByte(b);
+                }
+            }
+            return null;
+        }
+
+        @Override
+        public Void visitModuleMainClass(ModuleMainClass_attribute attr, ClassOutputStream out) {
+            out.writeShort(attr.main_class_index);
+            return null;
+        }
+
+        @Override
+        public Void visitModulePackages(ModulePackages_attribute attr, ClassOutputStream out) {
+            out.writeShort(attr.packages_count);
+            for (int i: attr.packages_index)
+                out.writeShort(i);
+            return null;
+        }
+
+        @Override
+        public Void visitModuleResolution(ModuleResolution_attribute attr, ClassOutputStream out) {
+            out.writeShort(attr.resolution_flags);
+            return null;
+        }
+
+        @Override
+        public Void visitModuleTarget(ModuleTarget_attribute attr, ClassOutputStream out) {
+            out.writeShort(attr.os_name_index);
+            out.writeShort(attr.os_arch_index);
+            out.writeShort(attr.os_version_index);
             return null;
         }
 
@@ -607,13 +629,21 @@
         }
 
         @Override
-        public Void visitRuntimeVisibleTypeAnnotations(RuntimeVisibleTypeAnnotations_attribute attr, ClassOutputStream out) {
+        public Void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisibleParameterAnnotations_attribute attr, ClassOutputStream out) {
+            out.writeByte(attr.parameter_annotations.length);
+            for (Annotation[] annos: attr.parameter_annotations)
+                annotationWriter.write(annos, out);
+            return null;
+        }
+
+        @Override
+        public Void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisibleTypeAnnotations_attribute attr, ClassOutputStream out) {
             annotationWriter.write(attr.annotations, out);
             return null;
         }
 
         @Override
-        public Void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisibleTypeAnnotations_attribute attr, ClassOutputStream out) {
+        public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, ClassOutputStream out) {
             annotationWriter.write(attr.annotations, out);
             return null;
         }
@@ -627,10 +657,8 @@
         }
 
         @Override
-        public Void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisibleParameterAnnotations_attribute attr, ClassOutputStream out) {
-            out.writeByte(attr.parameter_annotations.length);
-            for (Annotation[] annos: attr.parameter_annotations)
-                annotationWriter.write(annos, out);
+        public Void visitRuntimeVisibleTypeAnnotations(RuntimeVisibleTypeAnnotations_attribute attr, ClassOutputStream out) {
+            annotationWriter.write(attr.annotations, out);
             return null;
         }
 
@@ -685,24 +713,10 @@
             return null;
         }
 
-        @Override
-        public Void visitModuleTarget(ModuleTarget_attribute attr, ClassOutputStream out) {
-            out.writeShort(attr.os_name_index);
-            out.writeShort(attr.os_arch_index);
-            out.writeShort(attr.os_version_index);
-            return null;
-        }
-
         protected void writeAccessFlags(AccessFlags flags, ClassOutputStream p) {
             sharedOut.writeShort(flags.flags);
         }
 
-        @Override
-        public Void visitModuleVersion(ModuleVersion_attribute attr, ClassOutputStream out) {
-            out.writeShort(attr.version_index);
-            return null;
-        }
-
         protected StackMapTableWriter stackMapWriter;
     }
 
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java	Fri Dec 16 05:47:58 2016 +0000
@@ -117,6 +117,8 @@
     public static final int CONSTANT_MethodHandle = 15;
     public static final int CONSTANT_MethodType = 16;
     public static final int CONSTANT_InvokeDynamic = 18;
+    public static final int CONSTANT_Module = 19;
+    public static final int CONSTANT_Package = 20;
 
     public static enum RefKind {
         REF_getField(1),
@@ -213,10 +215,18 @@
                 pool[i] = new CONSTANT_Methodref_info(this, cr);
                 break;
 
+            case CONSTANT_Module:
+                pool[i] = new CONSTANT_Module_info(this, cr);
+                break;
+
             case CONSTANT_NameAndType:
                 pool[i] = new CONSTANT_NameAndType_info(this, cr);
                 break;
 
+            case CONSTANT_Package:
+                pool[i] = new CONSTANT_Package_info(this, cr);
+                break;
+
             case CONSTANT_String:
                 pool[i] = new CONSTANT_String_info(this, cr);
                 break;
@@ -276,10 +286,18 @@
         return ((CONSTANT_Class_info) get(index, CONSTANT_Class));
     }
 
+    public CONSTANT_Module_info getModuleInfo(int index) throws InvalidIndex, UnexpectedEntry {
+        return ((CONSTANT_Module_info) get(index, CONSTANT_Module));
+    }
+
     public CONSTANT_NameAndType_info getNameAndTypeInfo(int index) throws InvalidIndex, UnexpectedEntry {
         return ((CONSTANT_NameAndType_info) get(index, CONSTANT_NameAndType));
     }
 
+    public CONSTANT_Package_info getPackageInfo(int index) throws InvalidIndex, UnexpectedEntry {
+        return ((CONSTANT_Package_info) get(index, CONSTANT_Package));
+    }
+
     public String getUTF8Value(int index) throws InvalidIndex, UnexpectedEntry {
         return getUTF8Info(index).value;
     }
@@ -339,10 +357,12 @@
         R visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, P p);
         R visitInvokeDynamic(CONSTANT_InvokeDynamic_info info, P p);
         R visitLong(CONSTANT_Long_info info, P p);
-        R visitNameAndType(CONSTANT_NameAndType_info info, P p);
         R visitMethodref(CONSTANT_Methodref_info info, P p);
         R visitMethodHandle(CONSTANT_MethodHandle_info info, P p);
         R visitMethodType(CONSTANT_MethodType_info info, P p);
+        R visitModule(CONSTANT_Module_info info, P p);
+        R visitNameAndType(CONSTANT_NameAndType_info info, P p);
+        R visitPackage(CONSTANT_Package_info info, P p);
         R visitString(CONSTANT_String_info info, P p);
         R visitUtf8(CONSTANT_Utf8_info info, P p);
     }
@@ -781,6 +801,46 @@
         }
     }
 
+    public static class CONSTANT_Module_info extends CPInfo {
+        CONSTANT_Module_info(ConstantPool cp, ClassReader cr) throws IOException {
+            super(cp);
+            name_index = cr.readUnsignedShort();
+        }
+
+        public CONSTANT_Module_info(ConstantPool cp, int name_index) {
+            super(cp);
+            this.name_index = name_index;
+        }
+
+        public int getTag() {
+            return CONSTANT_Module;
+        }
+
+        public int  byteLength() {
+            return 3;
+        }
+
+        /**
+         * Get the raw value of the module name referenced by this constant pool entry.
+         * This will be the name of the module.
+         * @return the raw value of the module name
+         */
+        public String getName() throws ConstantPoolException {
+            return cp.getUTF8Value(name_index);
+        }
+
+        @Override
+        public String toString() {
+            return "CONSTANT_Module_info[name_index: " + name_index + "]";
+        }
+
+        public <R, D> R accept(Visitor<R, D> visitor, D data) {
+            return visitor.visitModule(this, data);
+        }
+
+        public final int name_index;
+    }
+
     public static class CONSTANT_NameAndType_info extends CPInfo {
         CONSTANT_NameAndType_info(ConstantPool cp, ClassReader cr) throws IOException {
             super(cp);
@@ -823,6 +883,46 @@
         public final int type_index;
     }
 
+    public static class CONSTANT_Package_info extends CPInfo {
+        CONSTANT_Package_info(ConstantPool cp, ClassReader cr) throws IOException {
+            super(cp);
+            name_index = cr.readUnsignedShort();
+        }
+
+        public CONSTANT_Package_info(ConstantPool cp, int name_index) {
+            super(cp);
+            this.name_index = name_index;
+        }
+
+        public int getTag() {
+            return CONSTANT_Package;
+        }
+
+        public int  byteLength() {
+            return 3;
+        }
+
+        /**
+         * Get the raw value of the package name referenced by this constant pool entry.
+         * This will be the name of the package, in internal form.
+         * @return the raw value of the module name
+         */
+        public String getName() throws ConstantPoolException {
+            return cp.getUTF8Value(name_index);
+        }
+
+        @Override
+        public String toString() {
+            return "CONSTANT_Package_info[name_index: " + name_index + "]";
+        }
+
+        public <R, D> R accept(Visitor<R, D> visitor, D data) {
+            return visitor.visitPackage(this, data);
+        }
+
+        public final int name_index;
+    }
+
     public static class CONSTANT_String_info extends CPInfo {
         CONSTANT_String_info(ConstantPool cp, ClassReader cr) throws IOException {
             super(cp);
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java	Fri Dec 16 05:47:58 2016 +0000
@@ -708,6 +708,10 @@
                 return visitRef(info, p);
             }
 
+            public Void visitModule(CONSTANT_Module_info info, Void p) {
+                return null;
+            }
+
             public Void visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
                 try {
                     new Signature(info.type_index).getType(constant_pool).accept(this, null);
@@ -717,6 +721,10 @@
                 }
             }
 
+            public Void visitPackage(CONSTANT_Package_info info, Void p) {
+                return null;
+            }
+
             public Void visitString(CONSTANT_String_info info, Void p) {
                 return null;
             }
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModulePackages_attribute.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModulePackages_attribute.java	Fri Dec 16 05:47:58 2016 +0000
@@ -27,6 +27,8 @@
 
 import java.io.IOException;
 
+import com.sun.tools.classfile.ConstantPool.CONSTANT_Package_info;
+
 /**
  * See JVMS, section 4.8.15.
  *
@@ -61,7 +63,8 @@
 
     public String getPackage(int index, ConstantPool constant_pool) throws ConstantPoolException {
         int package_index = packages_index[index];
-        return constant_pool.getUTF8Value(package_index);
+        CONSTANT_Package_info info = constant_pool.getPackageInfo(package_index);
+        return info.getName();
     }
 
     @Override
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleResolution_attribute.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,69 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 com.sun.tools.classfile;
+
+import java.io.IOException;
+
+/**
+ * See JVMS, section 4.8.15.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public class ModuleResolution_attribute extends Attribute {
+    public static final int DO_NOT_RESOLVE_BY_DEFAULT   = 0x0001;
+    public static final int WARN_DEPRECATED             = 0x0002;
+    public static final int WARN_DEPRECATED_FOR_REMOVAL = 0x0004;
+    public static final int WARN_INCUBATING             = 0x0008;
+
+    ModuleResolution_attribute(ClassReader cr, int name_index, int length)
+            throws IOException {
+        super(name_index, length);
+        resolution_flags = cr.readUnsignedShort();
+    }
+
+    public ModuleResolution_attribute(ConstantPool constant_pool,
+                              int resolution_flags)
+            throws ConstantPoolException {
+        this(constant_pool.getUTF8Index(Attribute.ModulePackages),
+             resolution_flags);
+    }
+
+    public ModuleResolution_attribute(int name_index,
+                              int resolution_flags) {
+        super(name_index, 2);
+        this.resolution_flags = resolution_flags;
+    }
+
+    @Override
+    public <R, D> R accept(Visitor<R, D> visitor, D data) {
+        return visitor.visitModuleResolution(this, data);
+    }
+
+    public final int resolution_flags;
+}
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleVersion_attribute.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2015, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 com.sun.tools.classfile;
-
-import java.io.IOException;
-
-/**
- * See JVMS, section 4.8.15.
- *
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own risk.
- *  This code and its internal interfaces are subject to change or
- *  deletion without notice.</b>
- */
-public class ModuleVersion_attribute extends Attribute {
-    ModuleVersion_attribute(ClassReader cr, int name_index, int length) throws IOException {
-        super(name_index, length);
-        version_index = cr.readUnsignedShort();
-    }
-
-    public ModuleVersion_attribute(ConstantPool constant_pool, int version_index)
-            throws ConstantPoolException {
-        this(constant_pool.getUTF8Index(Attribute.ModuleVersion), version_index);
-    }
-
-    public ModuleVersion_attribute(int name_index, int version_index) {
-        super(name_index, 2);
-        this.version_index = version_index;
-    }
-
-    @Override
-    public <R, D> R accept(Visitor<R, D> visitor, D data) {
-        return visitor.visitModuleVersion(this, data);
-    }
-
-    public final int version_index;
-}
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Module_attribute.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Module_attribute.java	Fri Dec 16 05:47:58 2016 +0000
@@ -27,6 +27,8 @@
 
 import java.io.IOException;
 
+import com.sun.tools.classfile.ConstantPool.CONSTANT_Module_info;
+
 /**
  * See Jigsaw.
  *
@@ -48,6 +50,8 @@
         module_name = cr.readUnsignedShort();
         module_flags = cr.readUnsignedShort();
 
+        module_version_index = cr.readUnsignedShort();
+
         requires_count = cr.readUnsignedShort();
         requires = new RequiresEntry[requires_count];
         for (int i = 0; i < requires_count; i++)
@@ -77,6 +81,7 @@
     public Module_attribute(int name_index,
             int module_name,
             int module_flags,
+            int module_version_index,
             RequiresEntry[] requires,
             ExportsEntry[] exports,
             OpensEntry[] opens,
@@ -85,6 +90,7 @@
         super(name_index, 2);
         this.module_name = module_name;
         this.module_flags = module_flags;
+        this.module_version_index = module_version_index;
         requires_count = requires.length;
         this.requires = requires;
         exports_count = exports.length;
@@ -109,6 +115,7 @@
 
     public final int module_name;
     public final int module_flags;
+    public final int module_version_index;
     public final int requires_count;
     public final RequiresEntry[] requires;
     public final int exports_count;
@@ -124,21 +131,25 @@
         RequiresEntry(ClassReader cr) throws IOException {
             requires_index = cr.readUnsignedShort();
             requires_flags = cr.readUnsignedShort();
+            requires_version_index = cr.readUnsignedShort();
         }
 
-        public RequiresEntry(int index, int flags) {
+        public RequiresEntry(int index, int flags, int version_index) {
             this.requires_index = index;
             this.requires_flags = flags;
+            this.requires_version_index = version_index;
         }
 
         public String getRequires(ConstantPool constant_pool) throws ConstantPoolException {
-            return constant_pool.getUTF8Value(requires_index);
+            CONSTANT_Module_info info = constant_pool.getModuleInfo(requires_index);
+            return info.getName();
         }
 
         public static final int length = 4;
 
         public final int requires_index;
         public final int requires_flags;
+        public final int requires_version_index;
     }
 
     public static class ExportsEntry {
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ReferenceFinder.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ReferenceFinder.java	Fri Dec 16 05:47:58 2016 +0000
@@ -136,14 +136,6 @@
             return false;
         }
 
-        public Boolean visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, ConstantPool cpool) {
-            return filter.accept(cpool, info);
-        }
-
-        public Boolean visitMethodref(CONSTANT_Methodref_info info, ConstantPool cpool) {
-            return filter.accept(cpool, info);
-        }
-
         public Boolean visitFieldref(CONSTANT_Fieldref_info info, ConstantPool cpool) {
             return filter.accept(cpool, info);
         }
@@ -160,6 +152,10 @@
             return false;
         }
 
+        public Boolean visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, ConstantPool cpool) {
+            return filter.accept(cpool, info);
+        }
+
         public Boolean visitInvokeDynamic(CONSTANT_InvokeDynamic_info info, ConstantPool cpool) {
             return false;
         }
@@ -168,15 +164,27 @@
             return false;
         }
 
+        public Boolean visitMethodHandle(CONSTANT_MethodHandle_info info, ConstantPool cpool) {
+            return false;
+        }
+
+        public Boolean visitMethodref(CONSTANT_Methodref_info info, ConstantPool cpool) {
+            return filter.accept(cpool, info);
+        }
+
+        public Boolean visitMethodType(CONSTANT_MethodType_info info, ConstantPool cpool) {
+            return false;
+        }
+
+        public Boolean visitModule(CONSTANT_Module_info info, ConstantPool cpool) {
+            return false;
+        }
+
         public Boolean visitNameAndType(CONSTANT_NameAndType_info info, ConstantPool cpool) {
             return false;
         }
 
-        public Boolean visitMethodHandle(CONSTANT_MethodHandle_info info, ConstantPool cpool) {
-            return false;
-        }
-
-        public Boolean visitMethodType(CONSTANT_MethodType_info info, ConstantPool cpool) {
+        public Boolean visitPackage(CONSTANT_Package_info info, ConstantPool cpool) {
             return false;
         }
 
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java	Fri Dec 16 05:47:58 2016 +0000
@@ -51,8 +51,8 @@
 import com.sun.tools.classfile.ModuleHashes_attribute;
 import com.sun.tools.classfile.ModuleMainClass_attribute;
 import com.sun.tools.classfile.ModulePackages_attribute;
+import com.sun.tools.classfile.ModuleResolution_attribute;
 import com.sun.tools.classfile.ModuleTarget_attribute;
-import com.sun.tools.classfile.ModuleVersion_attribute;
 import com.sun.tools.classfile.RuntimeInvisibleAnnotations_attribute;
 import com.sun.tools.classfile.RuntimeInvisibleParameterAnnotations_attribute;
 import com.sun.tools.classfile.RuntimeInvisibleTypeAnnotations_attribute;
@@ -237,27 +237,6 @@
         return null;
     }
 
-    private String getJavaPackage(ModulePackages_attribute attr, int index) {
-        try {
-            return getJavaName(attr.getPackage(index, constant_pool));
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
-
-    @Override
-    public Void visitModulePackages(ModulePackages_attribute attr, Void ignore) {
-        println("ModulePackages: ");
-        indent(+1);
-        for (int i = 0; i < attr.packages_count; i++) {
-            print("#" + attr.packages_index[i]);
-            tab();
-            println("// " + getJavaPackage(attr, i));
-        }
-        indent(-1);
-        return null;
-    }
-
     @Override
     public Void visitConstantValue(ConstantValue_attribute attr, Void ignore) {
         print("ConstantValue: ");
@@ -322,39 +301,6 @@
         }
     }
 
-    @Override
-    public Void visitModuleHashes(ModuleHashes_attribute attr, Void ignore) {
-        println("ModuleHashes:");
-        indent(+1);
-        print("algorithm #" + attr.algorithm_index);
-        tab();
-        println("// " + getAlgorithm(attr));
-        for (ModuleHashes_attribute.Entry e : attr.hashes_table) {
-            print("#" + e.module_name_index);
-            tab();
-            println("// " + getModuleName(e));
-            println("hash_length: " + e.hash.length);
-            println("hash: [" + toHex(e.hash) + "]");
-        }
-        indent(-1);
-        return null;
-    }
-
-    private String getAlgorithm(ModuleHashes_attribute attr) {
-        try {
-            return constant_pool.getUTF8Value(attr.algorithm_index);
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
-
-    private String getModuleName(ModuleHashes_attribute.Entry entry) {
-        try {
-            return constant_pool.getUTF8Value(entry.module_name_index);
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
 
     @Override
     public Void visitInnerClasses(InnerClasses_attribute attr, Void ignore) {
@@ -449,15 +395,6 @@
         return null;
     }
 
-    @Override
-    public Void visitModuleMainClass(ModuleMainClass_attribute attr, Void ignore) {
-        print("ModuleMainClass: #" + attr.main_class_index);
-        tab();
-        print("// " + getJavaClassName(attr));
-        println();
-        return null;
-    }
-
     private String getJavaClassName(ModuleMainClass_attribute a) {
         try {
             return getJavaName(a.getMainClassName(constant_pool));
@@ -495,13 +432,11 @@
         println("Module:");
         indent(+1);
 
-        print(attr.module_name);
-        tab();
-        println("// " + constantWriter.stringValue(attr.module_name));
-
+        print("#" + attr.module_name);
+        print(",");
         print(String.format("%x", attr.module_flags));
         tab();
-        print("// ");
+        print("// " + constantWriter.stringValue(attr.module_name));
         if ((attr.module_flags & Module_attribute.ACC_OPEN) != 0)
             print(" ACC_OPEN");
         if ((attr.module_flags & Module_attribute.ACC_MANDATED) != 0)
@@ -509,6 +444,12 @@
         if ((attr.module_flags & Module_attribute.ACC_SYNTHETIC) != 0)
             print(" ACC_SYNTHETIC");
         println();
+        print("#" + attr.module_version_index);
+        if (attr.module_version_index != 0) {
+            tab();
+            print("// " + constantWriter.stringValue(attr.module_version_index));
+        }
+        println();
 
         printRequiresTable(attr);
         printExportsTable(attr);
@@ -538,6 +479,12 @@
             if ((e.requires_flags & Module_attribute.ACC_MANDATED) != 0)
                 print(" ACC_MANDATED");
             println();
+            print("#" + e.requires_version_index);
+            if (e.requires_version_index != 0) {
+                tab();
+                print("// " + constantWriter.stringValue(e.requires_version_index));
+            }
+            println();
         }
         indent(-1);
     }
@@ -627,6 +574,145 @@
     }
 
     @Override
+    public Void visitModuleHashes(ModuleHashes_attribute attr, Void ignore) {
+        println("ModuleHashes:");
+        indent(+1);
+        print("algorithm: #" + attr.algorithm_index);
+        tab();
+        println("// " + getAlgorithm(attr));
+        print(attr.hashes_table_length);
+        tab();
+        println("// hashes");
+        for (ModuleHashes_attribute.Entry e : attr.hashes_table) {
+            print("#" + e.module_name_index);
+            tab();
+            println("// " + getModuleName(e));
+            println("hash_length: " + e.hash.length);
+            println("hash: [" + toHex(e.hash) + "]");
+        }
+        indent(-1);
+        return null;
+    }
+
+    private String getAlgorithm(ModuleHashes_attribute attr) {
+        try {
+            return constant_pool.getUTF8Value(attr.algorithm_index);
+        } catch (ConstantPoolException e) {
+            return report(e);
+        }
+    }
+
+    private String getModuleName(ModuleHashes_attribute.Entry entry) {
+        try {
+            int utf8Index = constant_pool.getModuleInfo(entry.module_name_index).name_index;
+            return constant_pool.getUTF8Value(utf8Index);
+        } catch (ConstantPoolException e) {
+            return report(e);
+        }
+    }
+
+    @Override
+    public Void visitModuleMainClass(ModuleMainClass_attribute attr, Void ignore) {
+        print("ModuleMainClass: #" + attr.main_class_index);
+        tab();
+        print("// " + getJavaClassName(attr));
+        println();
+        return null;
+    }
+
+    @Override
+    public Void visitModulePackages(ModulePackages_attribute attr, Void ignore) {
+        println("ModulePackages: ");
+        indent(+1);
+        for (int i = 0; i < attr.packages_count; i++) {
+            print("#" + attr.packages_index[i]);
+            tab();
+            println("// " + getJavaPackage(attr, i));
+        }
+        indent(-1);
+        return null;
+    }
+
+    private String getJavaPackage(ModulePackages_attribute attr, int index) {
+        try {
+            return getJavaName(attr.getPackage(index, constant_pool));
+        } catch (ConstantPoolException e) {
+            return report(e);
+        }
+    }
+
+    @Override
+    public Void visitModuleResolution(ModuleResolution_attribute attr, Void ignore) {
+        println("ModuleResolution:");
+        indent(+1);
+        print(String.format("%x", attr.resolution_flags));
+        tab();
+        print("// ");
+        int flags = attr.resolution_flags;
+        if ((flags & ModuleResolution_attribute.DO_NOT_RESOLVE_BY_DEFAULT) != 0)
+            print(" DO_NOT_RESOLVE_BY_DEFAULT");
+        if ((flags & ModuleResolution_attribute.WARN_DEPRECATED) != 0)
+            print(" WARN_DEPRECATED");
+        if ((flags & ModuleResolution_attribute.WARN_DEPRECATED_FOR_REMOVAL) != 0)
+            print(" WARN_DEPRECATED_FOR_REMOVAL");
+        if ((flags & ModuleResolution_attribute.WARN_INCUBATING) != 0)
+            print(" WARN_INCUBATING");
+        println();
+        indent(-1);
+        return null;
+    }
+
+    @Override
+    public Void visitModuleTarget(ModuleTarget_attribute attr, Void ignore) {
+        println("ModuleTarget:");
+        indent(+1);
+        print("os_name: #" + attr.os_name_index);
+        if (attr.os_name_index != 0) {
+            tab();
+            print("// " + getOSName(attr));
+        }
+        println();
+        print("os_arch: #" + attr.os_arch_index);
+        if (attr.os_arch_index != 0) {
+            tab();
+            print("// " + getOSArch(attr));
+        }
+        println();
+        print("os_version: #" + attr.os_version_index);
+        if (attr.os_version_index != 0) {
+            tab();
+            print("// " + getOSVersion(attr));
+        }
+        println();
+        indent(-1);
+        return null;
+    }
+
+    private String getOSName(ModuleTarget_attribute attr) {
+        try {
+            return constant_pool.getUTF8Value(attr.os_name_index);
+        } catch (ConstantPoolException e) {
+            return report(e);
+        }
+    }
+
+    private String getOSArch(ModuleTarget_attribute attr) {
+        try {
+            return constant_pool.getUTF8Value(attr.os_arch_index);
+        } catch (ConstantPoolException e) {
+            return report(e);
+        }
+    }
+
+    private String getOSVersion(ModuleTarget_attribute attr) {
+        try {
+            return constant_pool.getUTF8Value(attr.os_version_index);
+        } catch (ConstantPoolException e) {
+            return report(e);
+        }
+    }
+
+    @Override
     public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, Void ignore) {
         println("RuntimeVisibleAnnotations:");
         indent(+1);
@@ -929,74 +1015,6 @@
         return null;
     }
 
-    @Override
-    public Void visitModuleTarget(ModuleTarget_attribute attr, Void ignore) {
-        println("ModuleTarget:");
-        indent(+1);
-        print("os_name: #" + attr.os_name_index);
-        if (attr.os_name_index != 0) {
-            tab();
-            print("// " + getOSName(attr));
-        }
-        println();
-        print("os_arch: #" + attr.os_arch_index);
-        if (attr.os_arch_index != 0) {
-            tab();
-            print("// " + getOSArch(attr));
-        }
-        println();
-        print("os_version: #" + attr.os_version_index);
-        if (attr.os_version_index != 0) {
-            tab();
-            print("// " + getOSVersion(attr));
-        }
-        println();
-        indent(-1);
-        return null;
-    }
-
-    private String getOSName(ModuleTarget_attribute attr) {
-        try {
-            return constant_pool.getUTF8Value(attr.os_name_index);
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
-
-    private String getOSArch(ModuleTarget_attribute attr) {
-        try {
-            return constant_pool.getUTF8Value(attr.os_arch_index);
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
-
-    private String getOSVersion(ModuleTarget_attribute attr) {
-        try {
-            return constant_pool.getUTF8Value(attr.os_version_index);
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
-
-    @Override
-    public Void visitModuleVersion(ModuleVersion_attribute attr, Void ignore) {
-        print("ModuleVersion: #" + attr.version_index);
-        indent(+1);
-        tab();
-        println("// " + getVersion(attr));
-        indent(-1);
-        return null;
-    }
-
-    private String getVersion(ModuleVersion_attribute attr) {
-        try {
-            return constant_pool.getUTF8Value(attr.version_index);
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
-
     static String getJavaName(String name) {
         return name.replace('/', '.');
     }
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java	Fri Dec 16 05:47:58 2016 +0000
@@ -58,6 +58,8 @@
 import com.sun.tools.classfile.Type.WildcardType;
 
 import static com.sun.tools.classfile.AccessFlags.*;
+import static com.sun.tools.classfile.ConstantPool.CONSTANT_Module;
+import static com.sun.tools.classfile.ConstantPool.CONSTANT_Package;
 
 /*
  *  The main javap class to write the contents of a class file as text.
@@ -166,7 +168,12 @@
                 Module_attribute modAttr = (Module_attribute) attr;
                 String name;
                 try {
-                    name = getJavaName(constant_pool.getUTF8Value(modAttr.module_name));
+                    // FIXME: compatibility code
+                    if (constant_pool.get(modAttr.module_name).getTag() == CONSTANT_Module) {
+                        name = getJavaName(constant_pool.getModuleInfo(modAttr.module_name).getName());
+                    } else {
+                        name = getJavaName(constant_pool.getUTF8Value(modAttr.module_name));
+                    }
                 } catch (ConstantPoolException e) {
                     name = report(e);
                 }
@@ -175,6 +182,10 @@
                 }
                 print("module ");
                 print(name);
+                if (modAttr.module_version_index != 0) {
+                    print("@");
+                    print(getUTF8Value(modAttr.module_version_index));
+                }
             } else {
                 // fallback for malformed class files
                 print("class ");
@@ -602,19 +613,31 @@
             if ((entry.requires_flags & Module_attribute.ACC_TRANSITIVE) != 0)
                 print(" transitive");
             print(" ");
-            print(getUTF8Value(entry.requires_index).replace('/', '.'));
+            String mname;
+            try {
+                mname = getModuleName(entry.requires_index);
+            } catch (ConstantPoolException e) {
+                mname = report(e);
+            }
+            print(mname);
             println(";");
         }
 
         for (Module_attribute.ExportsEntry entry: m.exports) {
             print("exports");
             print(" ");
-            print(getUTF8Value(entry.exports_index).replace('/', '.'));
+            String pname;
+            try {
+                pname = getPackageName(entry.exports_index).replace('/', '.');
+            } catch (ConstantPoolException e) {
+                pname = report(e);
+            }
+            print(pname);
             boolean first = true;
             for (int i: entry.exports_to_index) {
                 String mname;
                 try {
-                    mname = classFile.constant_pool.getUTF8Value(i).replace('/', '.');
+                    mname = getModuleName(i);
                 } catch (ConstantPoolException e) {
                     mname = report(e);
                 }
@@ -635,12 +658,18 @@
         for (Module_attribute.OpensEntry entry: m.opens) {
             print("opens");
             print(" ");
-            print(getUTF8Value(entry.opens_index).replace('/', '.'));
+            String pname;
+            try {
+                pname = getPackageName(entry.opens_index).replace('/', '.');
+            } catch (ConstantPoolException e) {
+                pname = report(e);
+            }
+            print(pname);
             boolean first = true;
             for (int i: entry.opens_to_index) {
                 String mname;
                 try {
-                    mname = classFile.constant_pool.getUTF8Value(i).replace('/', '.');
+                    mname = getModuleName(i);
                 } catch (ConstantPoolException e) {
                     mname = report(e);
                 }
@@ -684,6 +713,22 @@
         }
     }
 
+    String getModuleName(int index) throws ConstantPoolException {
+        if (constant_pool.get(index).getTag() == CONSTANT_Module) {
+            return constant_pool.getModuleInfo(index).getName();
+        } else {
+            return constant_pool.getUTF8Value(index);
+        }
+    }
+
+    String getPackageName(int index) throws ConstantPoolException {
+        if (constant_pool.get(index).getTag() == CONSTANT_Package) {
+            return constant_pool.getPackageInfo(index).getName();
+        } else {
+            return constant_pool.getUTF8Value(index);
+        }
+    }
+
     String getUTF8Value(int index) {
         try {
             return classFile.constant_pool.getUTF8Value(index);
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java	Fri Dec 16 05:47:58 2016 +0000
@@ -109,13 +109,6 @@
                 return 2;
             }
 
-            public Integer visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
-                print("#" + info.name_index + ":#" + info.type_index);
-                tab();
-                println("// " + stringValue(info));
-                return 1;
-            }
-
             public Integer visitMethodref(CONSTANT_Methodref_info info, Void p) {
                 print("#" + info.class_index + ".#" + info.name_and_type_index);
                 tab();
@@ -137,6 +130,27 @@
                 return 1;
             }
 
+            public Integer visitModule(CONSTANT_Module_info info, Void p) {
+                print("#" + info.name_index);
+                tab();
+                println("// " + stringValue(info));
+                return 1;
+            }
+
+            public Integer visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
+                print("#" + info.name_index + ":#" + info.type_index);
+                tab();
+                println("// " + stringValue(info));
+                return 1;
+            }
+
+            public Integer visitPackage(CONSTANT_Package_info info, Void p) {
+                print("#" + info.name_index);
+                tab();
+                println("// " + stringValue(info));
+                return 1;
+            }
+
             public Integer visitString(CONSTANT_String_info info, Void p) {
                 print("#" + info.string_index);
                 tab();
@@ -304,6 +318,14 @@
             return info.value + "l";
         }
 
+        public String visitModule(CONSTANT_Module_info info, Void p) {
+            try {
+                return checkName(info.getName());
+            } catch (ConstantPoolException e) {
+                return report(e);
+            }
+        }
+
         public String visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
             return getCheckedName(info) + ":" + getType(info);
         }
@@ -316,6 +338,14 @@
             }
         }
 
+        public String visitPackage(CONSTANT_Package_info info, Void p) {
+            try {
+                return checkName(info.getName());
+            } catch (ConstantPoolException e) {
+                return report(e);
+            }
+        }
+
         String getType(CONSTANT_NameAndType_info info) {
             try {
                 return info.getType();
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/CPSelector.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/CPSelector.java	Fri Dec 16 05:47:58 2016 +0000
@@ -76,11 +76,6 @@
     }
 
     @Override
-    public Void visitNameAndType(ConstantPool.CONSTANT_NameAndType_info info, CPEntries p) {
-        return null;
-    }
-
-    @Override
     public Void visitMethodref(ConstantPool.CONSTANT_Methodref_info info, CPEntries p) {
         p.methodRefs.add(info);
         return null;
@@ -97,6 +92,21 @@
     }
 
     @Override
+    public Void visitModule(ConstantPool.CONSTANT_Module_info info, CPEntries p) {
+        return null;
+    }
+
+    @Override
+    public Void visitNameAndType(ConstantPool.CONSTANT_NameAndType_info info, CPEntries p) {
+        return null;
+    }
+
+    @Override
+    public Void visitPackage(ConstantPool.CONSTANT_Package_info info, CPEntries p) {
+        return null;
+    }
+
+    @Override
     public Void visitString(ConstantPool.CONSTANT_String_info info, CPEntries p) {
         return null;
     }
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java	Fri Dec 16 05:47:58 2016 +0000
@@ -416,7 +416,12 @@
                     }
                 };
 
-                return new ModuleReference(descriptor, uri, readerSupplier);
+                return new ModuleReference(descriptor, uri) {
+                    @Override
+                    public ModuleReader open() {
+                        return readerSupplier.get();
+                    }
+                };
             } catch (IOException e) {
                 throw new UncheckedIOException(e);
             }
--- a/test/jdk/javadoc/doclet/testModules/TestModules.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/jdk/javadoc/doclet/testModules/TestModules.java	Fri Dec 16 05:47:58 2016 +0000
@@ -45,8 +45,8 @@
     void testHtml4() {
         javadoc("-d", "out", "-use",
                 "--module-source-path", testSrc,
-                "--add-modules", "module1,module2",
-                "testpkgmdl1", "testpkgmdl2");
+                "--add-modules", "moduleA,moduleB",
+                "testpkgmdlA", "testpkgmdlB");
         checkExit(Exit.OK);
         checkDescription(true);
         checkNoDescription(false);
@@ -66,8 +66,8 @@
     void testHtml5() {
         javadoc("-d", "out-html5", "-html5", "-use",
                 "--module-source-path", testSrc,
-                "--add-modules", "module1,module2",
-                "testpkgmdl1", "testpkgmdl2");
+                "--add-modules", "moduleA,moduleB",
+                "testpkgmdlA", "testpkgmdlB");
         checkExit(Exit.OK);
         checkHtml5Description(true);
         checkHtml5NoDescription(false);
@@ -87,8 +87,8 @@
     void testHtml4NoComment() {
         javadoc("-d", "out-nocomment", "-nocomment", "-use",
                 "--module-source-path", testSrc,
-                "--add-modules", "module1,module2",
-                "testpkgmdl1", "testpkgmdl2");
+                "--add-modules", "moduleA,moduleB",
+                "testpkgmdlA", "testpkgmdlB");
         checkExit(Exit.OK);
         checkDescription(false);
         checkNoDescription(true);
@@ -104,8 +104,8 @@
     void testHtml5NoComment() {
         javadoc("-d", "out-html5-nocomment", "-nocomment", "-html5", "-use",
                 "--module-source-path", testSrc,
-                "--add-modules", "module1,module2",
-                "testpkgmdl1", "testpkgmdl2");
+                "--add-modules", "moduleA,moduleB",
+                "testpkgmdlA", "testpkgmdlB");
         checkExit(Exit.OK);
         checkHtml5Description(false);
         checkHtml5NoDescription(true);
@@ -154,8 +154,8 @@
                 "-tag", "regular:a:Regular Tag:",
                 "-tag", "moduletag:s:Module Tag:",
                 "--module-source-path", testSrc,
-                "--add-modules", "moduletags,module2",
-                "testpkgmdltags", "testpkgmdl2");
+                "--add-modules", "moduletags,moduleB",
+                "testpkgmdltags", "testpkgmdlB");
         checkExit(Exit.OK);
         checkModuleTags();
     }
@@ -167,8 +167,8 @@
     void testModuleSummary() {
         javadoc("-d", "out-moduleSummary", "-use",
                 "--module-source-path", testSrc,
-                "--add-modules", "module1,module2",
-                "testpkgmdl1", "testpkgmdl2", "module2/testpkg2mdl2");
+                "--add-modules", "moduleA,moduleB",
+                "testpkgmdlA", "testpkgmdlB", "moduleB/testpkg2mdlB");
         checkExit(Exit.OK);
         checkModuleSummary();
         checkNegatedModuleSummary();
@@ -181,8 +181,8 @@
     void testModuleFilesAndLinks() {
         javadoc("-d", "out-modulelinks",
                 "--module-source-path", testSrc,
-                "--add-modules", "module1",
-                "testpkgmdl1");
+                "--add-modules", "moduleA",
+                "testpkgmdlA");
         checkExit(Exit.OK);
         checkModuleFilesAndLinks(true);
         checkNegatedOverviewFrame();
@@ -197,8 +197,8 @@
                 "-tag", "regular:a:Regular Tag:",
                 "-tag", "moduletag:s:Module Tag:",
                 "--module-source-path", testSrc,
-                "--module", "module1,module2,moduletags",
-                "testpkgmdl1", "testpkgmdl2", "testpkgmdltags");
+                "--module", "moduleA,moduleB,moduletags",
+                "testpkgmdlA", "testpkgmdlB", "testpkgmdltags");
         checkExit(Exit.OK);
         checkModuleDeprecation(true);
     }
@@ -210,38 +210,38 @@
     void testModuleAnnotation() {
         javadoc("-d", "out-moduleanno",
                 "--module-source-path", testSrc,
-                "--module", "module1,module2",
-                "testpkgmdl1", "testpkgmdl2");
+                "--module", "moduleA,moduleB",
+                "testpkgmdlA", "testpkgmdlB");
         checkExit(Exit.OK);
         checkModuleAnnotation();
     }
 
     void checkDescription(boolean found) {
-        checkOutput("module1-summary.html", found,
+        checkOutput("moduleA-summary.html", found,
                 "<!-- ============ MODULE DESCRIPTION =========== -->\n"
                 + "<a name=\"module.description\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<div class=\"block\">This is a test description for the module1 module. Search "
+                + "<div class=\"block\">This is a test description for the moduleA module. Search "
                 + "phrase <a id=\"searchphrase\">search phrase</a>.</div>");
-        checkOutput("module2-summary.html", found,
+        checkOutput("moduleB-summary.html", found,
                 "<!-- ============ MODULE DESCRIPTION =========== -->\n"
                 + "<a name=\"module.description\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<div class=\"block\">This is a test description for the module2 module. Search "
+                + "<div class=\"block\">This is a test description for the moduleB module. Search "
                 + "word <a id=\"search_word\">search_word</a> with no description.</div>");
     }
 
     void checkNoDescription(boolean found) {
-        checkOutput("module1-summary.html", found,
+        checkOutput("moduleA-summary.html", found,
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
                 + "<!-- ============ MODULES SUMMARY =========== -->");
-        checkOutput("module2-summary.html", found,
+        checkOutput("moduleB-summary.html", found,
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
@@ -251,7 +251,7 @@
     }
 
     void checkHtml5Description(boolean found) {
-        checkOutput("module1-summary.html", found,
+        checkOutput("moduleA-summary.html", found,
                 "<section role=\"region\">\n"
                 + "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
@@ -260,27 +260,27 @@
                 + "<a id=\"module.description\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<div class=\"block\">This is a test description for the module1 module. Search "
+                + "<div class=\"block\">This is a test description for the moduleA module. Search "
                 + "phrase <a id=\"searchphrase\">search phrase</a>.</div>");
-        checkOutput("module2-summary.html", found,
+        checkOutput("moduleB-summary.html", found,
                 "<section role=\"region\">\n"
                 + "<!-- ============ MODULE DESCRIPTION =========== -->\n"
                 + "<a id=\"module.description\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<div class=\"block\">This is a test description for the module2 module. Search "
+                + "<div class=\"block\">This is a test description for the moduleB module. Search "
                 + "word <a id=\"search_word\">search_word</a> with no description.</div>");
     }
 
     void checkHtml5NoDescription(boolean found) {
-        checkOutput("module1-summary.html", found,
+        checkOutput("moduleA-summary.html", found,
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
                 + "<!-- ============ MODULES SUMMARY =========== -->");
-        checkOutput("module2-summary.html", found,
+        checkOutput("moduleB-summary.html", found,
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
@@ -292,18 +292,18 @@
     void checkModuleLink() {
         checkOutput("overview-summary.html", true,
                 "<li>Module</li>");
-        checkOutput("module1-summary.html", true,
+        checkOutput("moduleA-summary.html", true,
                 "<li class=\"navBarCell1Rev\">Module</li>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<li class=\"navBarCell1Rev\">Module</li>");
-        checkOutput("testpkgmdl1/class-use/TestClassInModule1.html", true,
-                "<li><a href=\"../../module1-summary.html\">Module</a></li>");
-        checkOutput("testpkgmdl2/package-summary.html", true,
-                "<li><a href=\"../module2-summary.html\">Module</a></li>");
-        checkOutput("testpkgmdl2/TestClassInModule2.html", true,
-                "<li><a href=\"../module2-summary.html\">Module</a></li>");
-        checkOutput("testpkgmdl2/class-use/TestClassInModule2.html", true,
-                "<li><a href=\"../../module2-summary.html\">Module</a></li>");
+        checkOutput("testpkgmdlA/class-use/TestClassInModuleA.html", true,
+                "<li><a href=\"../../moduleA-summary.html\">Module</a></li>");
+        checkOutput("testpkgmdlB/package-summary.html", true,
+                "<li><a href=\"../moduleB-summary.html\">Module</a></li>");
+        checkOutput("testpkgmdlB/TestClassInModuleB.html", true,
+                "<li><a href=\"../moduleB-summary.html\">Module</a></li>");
+        checkOutput("testpkgmdlB/class-use/TestClassInModuleB.html", true,
+                "<li><a href=\"../../moduleB-summary.html\">Module</a></li>");
     }
 
     void checkNoModuleLink() {
@@ -421,102 +421,102 @@
     }
 
     void checkModuleSummary() {
-        checkOutput("module1-summary.html", true,
+        checkOutput("moduleA-summary.html", true,
                 "<ul class=\"subNavList\">\n"
                 + "<li>Module:&nbsp;</li>\n"
                 + "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a "
                 + "href=\"#modules.summary\">Modules</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">"
                 + "Packages</a>&nbsp;|&nbsp;Services</li>\n"
                 + "</ul>");
-        checkOutput("module1-summary.html", true,
+        checkOutput("moduleA-summary.html", true,
                 "<!-- ============ MODULES SUMMARY =========== -->\n"
                 + "<a name=\"modules.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>");
-        checkOutput("module1-summary.html", true,
+        checkOutput("moduleA-summary.html", true,
                 "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdl1/package-summary.html\">testpkgmdl1</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
                 + "<td class=\"colSecond\">All Modules</td>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>");
-        checkOutput("module1-summary.html", true,
+        checkOutput("moduleA-summary.html", true,
                 "<!-- ============ PACKAGES SUMMARY =========== -->\n"
                 + "<a name=\"packages.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>");
-        checkOutput("module1-summary.html", true,
+        checkOutput("moduleA-summary.html", true,
                 "<tr class=\"rowColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"module2-summary.html\">module2</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
                 + "<td class=\"colLast\">\n"
-                + "<div class=\"block\">This is a test description for the module2 module.</div>\n"
+                + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
                 + "</td>\n"
                 + "</tr>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a "
                 + "href=\"#modules.summary\">Modules</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">"
                 + "Packages</a>&nbsp;|&nbsp;<a href=\"#services.summary\">Services</a></li>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<!-- ============ MODULES SUMMARY =========== -->\n"
                 + "<a name=\"modules.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<tr class=\"rowColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdl2/package-summary.html\">"
-                + "testpkg2mdl2</a></th>\n"
-                + "<td class=\"colSecond\">module1</td>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/package-summary.html\">"
+                + "testpkg2mdlB</a></th>\n"
+                + "<td class=\"colSecond\">moduleA</td>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<!-- ============ PACKAGES SUMMARY =========== -->\n"
                 + "<a name=\"packages.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<tr class=\"altColor\">\n"
                 + "<th class=\"colFirst\" scope=\"row\"><a href=\"java.base-summary.html\">java.base</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<!-- ============ SERVICES SUMMARY =========== -->\n"
                 + "<a name=\"services.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdl2/TestClassInModule2.html\" "
-                + "title=\"class in testpkgmdl2\">TestClassInModule2</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/TestClassInModuleB.html\" "
+                + "title=\"class in testpkgmdlB\">TestClassInModuleB</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdl2/TestInterfaceInModule2.html\" "
-                + "title=\"interface in testpkg2mdl2\">TestInterfaceInModule2</a><br>"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterfaceInModuleB.html\" "
+                + "title=\"interface in testpkg2mdlB\">TestInterfaceInModuleB</a><br>"
                 + "(<span class=\"implementationLabel\">Implementation:</span>&nbsp;"
-                + "<a href=\"testpkgmdl2/TestClassInModule2.html\" title=\"class in testpkgmdl2\">"
-                + "TestClassInModule2</a>)</th>\n"
+                + "<a href=\"testpkgmdlB/TestClassInModuleB.html\" title=\"class in testpkgmdlB\">"
+                + "TestClassInModuleB</a>)</th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<caption><span>Exported Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
                 + "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
                 + "</tr>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<caption><span>Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
                 + "</tr>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
                 + "</tr>");
-        checkOutput("module2-summary.html", true,
+        checkOutput("moduleB-summary.html", true,
                 "<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
@@ -525,7 +525,7 @@
     }
 
     void checkNegatedModuleSummary() {
-        checkOutput("module1-summary.html", false,
+        checkOutput("moduleA-summary.html", false,
                 "<!-- ============ SERVICES SUMMARY =========== -->\n"
                 + "<a name=\"services.summary\">\n"
                 + "<!--   -->\n"
@@ -534,13 +534,13 @@
 
     void checkModuleClickThroughLinks() {
         checkOutput("module-overview-frame.html", true,
-                "<li><a href=\"module1-frame.html\" target=\"packageListFrame\" "
-                + "onclick=\"updateModuleFrame('module1-type-frame.html','module1-summary.html');"
-                + "\">module1</a></li>");
+                "<li><a href=\"moduleA-frame.html\" target=\"packageListFrame\" "
+                + "onclick=\"updateModuleFrame('moduleA-type-frame.html','moduleA-summary.html');"
+                + "\">moduleA</a></li>");
         checkOutput("module-overview-frame.html", true,
-                "<li><a href=\"module2-frame.html\" target=\"packageListFrame\" "
-                + "onclick=\"updateModuleFrame('module2-type-frame.html','module2-summary.html');"
-                + "\">module2</a></li>");
+                "<li><a href=\"moduleB-frame.html\" target=\"packageListFrame\" "
+                + "onclick=\"updateModuleFrame('moduleB-type-frame.html','moduleB-summary.html');"
+                + "\">moduleB</a></li>");
         checkOutput("script.js", true,
                 "function updateModuleFrame(pFrame, cFrame)\n"
                 + "{\n"
@@ -551,52 +551,52 @@
 
     void checkModuleClickThrough(boolean found) {
         checkFiles(found,
-                "module1-type-frame.html",
-                "module2-type-frame.html");
+                "moduleA-type-frame.html",
+                "moduleB-type-frame.html");
     }
 
     void checkModuleFilesAndLinks(boolean found) {
-        checkOutput("testpkgmdl1/package-summary.html", found,
-                "<li><a href=\"../module1-summary.html\">Module</a></li>");
-        checkOutput("testpkgmdl1/package-summary.html", found,
+        checkOutput("testpkgmdlA/package-summary.html", found,
+                "<li><a href=\"../moduleA-summary.html\">Module</a></li>");
+        checkOutput("testpkgmdlA/package-summary.html", found,
                 "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span>&nbsp;"
-                + "<a href=\"../module1-summary.html\">module1</a></div>");
-        checkOutput("testpkgmdl1/TestClassInModule1.html", found,
-                "<li><a href=\"../module1-summary.html\">Module</a></li>");
-        checkOutput("testpkgmdl1/TestClassInModule1.html", found,
+                + "<a href=\"../moduleA-summary.html\">moduleA</a></div>");
+        checkOutput("testpkgmdlA/TestClassInModuleA.html", found,
+                "<li><a href=\"../moduleA-summary.html\">Module</a></li>");
+        checkOutput("testpkgmdlA/TestClassInModuleA.html", found,
                 "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span>&nbsp;"
-                + "<a href=\"../module1-summary.html\">module1</a></div>");
+                + "<a href=\"../moduleA-summary.html\">moduleA</a></div>");
         checkFiles(found,
-                "module1-frame.html",
-                "module1-summary.html",
+                "moduleA-frame.html",
+                "moduleA-summary.html",
                 "module-overview-frame.html");
     }
 
     void checkModulesInSearch(boolean found) {
         checkOutput("index-all.html", found,
                 "<dl>\n"
-                + "<dt><a href=\"module1-summary.html\">module1</a> - module module1</dt>\n"
+                + "<dt><a href=\"moduleA-summary.html\">moduleA</a> - module moduleA</dt>\n"
                 + "<dd>\n"
-                + "<div class=\"block\">This is a test description for the module1 module.</div>\n"
+                + "<div class=\"block\">This is a test description for the moduleA module.</div>\n"
                 + "</dd>\n"
-                + "<dt><a href=\"module2-summary.html\">module2</a> - module module2</dt>\n"
+                + "<dt><a href=\"moduleB-summary.html\">moduleB</a> - module moduleB</dt>\n"
                 + "<dd>\n"
-                + "<div class=\"block\">This is a test description for the module2 module.</div>\n"
+                + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
                 + "</dd>\n"
                 + "</dl>");
         checkOutput("index-all.html", found,
                 "<dl>\n"
-                + "<dt><span class=\"searchTagLink\"><a href=\"module1-summary.html#searchphrase\">"
-                + "search phrase</a></span> - Search tag in module1</dt>\n"
+                + "<dt><span class=\"searchTagLink\"><a href=\"moduleA-summary.html#searchphrase\">"
+                + "search phrase</a></span> - Search tag in moduleA</dt>\n"
                 + "<dd>with description</dd>\n"
-                + "<dt><span class=\"searchTagLink\"><a href=\"module2-summary.html#search_word\">"
-                + "search_word</a></span> - Search tag in module2</dt>\n"
+                + "<dt><span class=\"searchTagLink\"><a href=\"moduleB-summary.html#search_word\">"
+                + "search_word</a></span> - Search tag in moduleB</dt>\n"
                 + "<dd>&nbsp;</dd>\n"
                 + "</dl>");
 }
 
     void checkModuleDeprecation(boolean found) {
-        checkOutput("module1-summary.html", found,
+        checkOutput("moduleA-summary.html", found,
                 "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
                 + "</div>");
@@ -605,12 +605,12 @@
                 + "<li><a href=\"#module\">Deprecated Modules</a></li>\n"
                 + "</ul>",
                 "<tr class=\"altColor\">\n"
-                + "<th class=\"colFirst\" scope=\"row\"><a href=\"module1-summary.html\">module1</a></th>\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n"
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
                 + "</td>\n"
                 + "</tr>");
-        checkOutput("module2-summary.html", !found,
+        checkOutput("moduleB-summary.html", !found,
                 "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated using just the javadoc tag.</span></div>");
         checkOutput("moduletags-summary.html", found,
@@ -620,11 +620,11 @@
     }
 
     void checkModuleAnnotation() {
-        checkOutput("module2-summary.html", true,
-                "<p><a href=\"testpkgmdl2/AnnotationType.html\" title=\"annotation in testpkgmdl2\">@AnnotationType</a>(<a href=\"testpkgmdl2/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n"
-                + "                <a href=\"testpkgmdl2/AnnotationType.html#required--\">required</a>=2016)\n"
+        checkOutput("moduleB-summary.html", true,
+                "<p><a href=\"testpkgmdlB/AnnotationType.html\" title=\"annotation in testpkgmdlB\">@AnnotationType</a>(<a href=\"testpkgmdlB/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n"
+                + "                <a href=\"testpkgmdlB/AnnotationType.html#required--\">required</a>=2016)\n"
                 + "</p>");
-        checkOutput("module2-summary.html", false,
+        checkOutput("moduleB-summary.html", false,
                 "@AnnotationTypeUndocumented");
 }
 
--- a/test/jdk/javadoc/doclet/testModules/module1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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.
- */
-
-/**
-  * This is a test description for the module1 module. Search phrase {@index "search phrase" with description}.
-  *
-  * @deprecated This module is deprecated.
-  */
-@Deprecated
-module module1 {
-    requires module2;
-
-    exports testpkgmdl1;
-}
--- a/test/jdk/javadoc/doclet/testModules/module1/testpkgmdl1/TestClassInModule1.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 testpkgmdl1;
-
-public class TestClassInModule1 {
-}
--- a/test/jdk/javadoc/doclet/testModules/module2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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.
- */
-
-/**
-  * This is a test description for the module2 module. Search word {@index search_word} with no description.
-  *
-  * @deprecated This module is deprecated using just the javadoc tag.
-  */
-@testpkgmdl2.AnnotationType(optional="Module Annotation", required=2016)
-@testpkgmdl2.AnnotationTypeUndocumented(optional="Module Annotation", required=2016)
-module module2 {
-    exports testpkgmdl2;
-
-    exports testpkg2mdl2 to module1;
-
-    uses testpkgmdl2.TestClassInModule2;
-
-    provides testpkg2mdl2.TestInterfaceInModule2 with testpkgmdl2.TestClassInModule2;
-}
--- a/test/jdk/javadoc/doclet/testModules/module2/testpkg2mdl2/TestInterfaceInModule2.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 testpkg2mdl2;
-
-public interface TestInterfaceInModule2 {
-    void testMethod();
-}
--- a/test/jdk/javadoc/doclet/testModules/module2/testpkgmdl2/AnnotationType.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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.
- */
-
-package testpkgmdl2;
-
-import java.lang.annotation.*;
-
-/**
- * This is a test annotation type.
- */
-@Documented public @interface AnnotationType {
-
-    /**
-     * The copyright holder.
-     *
-     * @return a string.
-     */
-    String optional() default "unknown";
-
-   /**
-    * The year of the copyright.
-    *
-    * @return an int.
-    */
-    int required();
-}
--- a/test/jdk/javadoc/doclet/testModules/module2/testpkgmdl2/AnnotationTypeUndocumented.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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.
- */
-
-package testpkgmdl2;
-
-import java.lang.annotation.*;
-
-/**
- * This is a test annotation type this is not documented because it
- * is missing the @Documented tag.
- */
-public @interface AnnotationTypeUndocumented {
-
-    /**
-     * The copyright holder.
-     *
-     * @return a string.
-     */
-    String optional() default "unknown";
-
-   /**
-    * The year of the copyright.
-    *
-    * @return an int.
-    */
-    int required();
-}
--- a/test/jdk/javadoc/doclet/testModules/module2/testpkgmdl2/TestClassInModule2.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 testpkgmdl2;
-
-import testpkg2mdl2.TestInterfaceInModule2;
-
-public class TestClassInModule2 implements TestInterfaceInModule2 {
-    void testMethod() {}
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javadoc/doclet/testModules/moduleA/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,36 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+/**
+  * This is a test description for the moduleA module. Search phrase {@index "search phrase" with description}.
+  *
+  * @deprecated This module is deprecated.
+  */
+@Deprecated
+module moduleA {
+    requires moduleB;
+
+    exports testpkgmdlA;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javadoc/doclet/testModules/moduleA/testpkgmdlA/TestClassInModuleA.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,28 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 testpkgmdlA;
+
+public class TestClassInModuleA {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javadoc/doclet/testModules/moduleB/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,41 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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.
+ */
+
+/**
+  * This is a test description for the moduleB module. Search word {@index search_word} with no description.
+  *
+  * @deprecated This module is deprecated using just the javadoc tag.
+  */
+@testpkgmdlB.AnnotationType(optional="Module Annotation", required=2016)
+@testpkgmdlB.AnnotationTypeUndocumented(optional="Module Annotation", required=2016)
+module moduleB {
+    exports testpkgmdlB;
+
+    exports testpkg2mdlB to moduleA;
+
+    uses testpkgmdlB.TestClassInModuleB;
+
+    provides testpkg2mdlB.TestInterfaceInModuleB with testpkgmdlB.TestClassInModuleB;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javadoc/doclet/testModules/moduleB/testpkg2mdlB/TestInterfaceInModuleB.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,29 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 testpkg2mdlB;
+
+public interface TestInterfaceInModuleB {
+    void testMethod();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationType.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+package testpkgmdlB;
+
+import java.lang.annotation.*;
+
+/**
+ * This is a test annotation type.
+ */
+@Documented public @interface AnnotationType {
+
+    /**
+     * The copyright holder.
+     *
+     * @return a string.
+     */
+    String optional() default "unknown";
+
+   /**
+    * The year of the copyright.
+    *
+    * @return an int.
+    */
+    int required();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationTypeUndocumented.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package testpkgmdlB;
+
+import java.lang.annotation.*;
+
+/**
+ * This is a test annotation type this is not documented because it
+ * is missing the @Documented tag.
+ */
+public @interface AnnotationTypeUndocumented {
+
+    /**
+     * The copyright holder.
+     *
+     * @return a string.
+     */
+    String optional() default "unknown";
+
+   /**
+    * The year of the copyright.
+    *
+    * @return an int.
+    */
+    int required();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/TestClassInModuleB.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,31 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 testpkgmdlB;
+
+import testpkg2mdlB.TestInterfaceInModuleB;
+
+public class TestClassInModuleB implements TestInterfaceInModuleB {
+    void testMethod() {}
+}
--- a/test/jdk/javadoc/doclet/testModules/moduletags/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/jdk/javadoc/doclet/testModules/moduletags/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -24,7 +24,7 @@
  */
 
 /**
-  * This is a test description for the module1 module.<br>
+  * This is a test description for the moduleA module.<br>
   * Type Link: {@link testpkgmdltags.TestClassInModuleTags}.<br>
   * Member Link: {@link testpkgmdltags.TestClassInModuleTags#testMethod(String)}.<br>
   * Package Link: {@link testpkgmdltags}.<br>
@@ -39,7 +39,7 @@
   */
 @Deprecated
 module moduletags {
-    requires module2;
+    requires moduleB;
 
     exports testpkgmdltags;
 }
--- a/test/lib/annotations/annotations/classfile/ClassfileInspector.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/lib/annotations/annotations/classfile/ClassfileInspector.java	Fri Dec 16 05:47:58 2016 +0000
@@ -1183,16 +1183,6 @@
     private static class AbstractAttributeVisitor<T> implements Attribute.Visitor<Void, T> {
 
         @Override
-        public Void visitBootstrapMethods(BootstrapMethods_attribute attr, T p) {
-            return null;
-        }
-
-        @Override
-        public Void visitModulePackages(ModulePackages_attribute attr, T p) {
-            return null;
-        }
-
-        @Override
         public Void visitDefault(DefaultAttribute attr, T p) {
             return null;
         }
@@ -1203,6 +1193,11 @@
         }
 
         @Override
+        public Void visitBootstrapMethods(BootstrapMethods_attribute attr, T p) {
+            return null;
+        }
+
+        @Override
         public Void visitCharacterRangeTable(CharacterRangeTable_attribute attr, T p) {
             return null;
         }
@@ -1238,11 +1233,6 @@
         }
 
         @Override
-        public Void visitModuleHashes(ModuleHashes_attribute attr, T p) {
-            return null;
-        }
-
-        @Override
         public Void visitInnerClasses(InnerClasses_attribute attr, T p) {
             return null;
         }
@@ -1263,11 +1253,6 @@
         }
 
         @Override
-        public Void visitModuleMainClass(ModuleMainClass_attribute attr, T p) {
-            return null;
-        }
-
-        @Override
         public Void visitMethodParameters(MethodParameters_attribute attr, T p) {
             return null;
         }
@@ -1278,7 +1263,27 @@
         }
 
         @Override
-        public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, T p) {
+        public Void visitModuleHashes(ModuleHashes_attribute attr, T p) {
+            return null;
+        }
+
+        @Override
+        public Void visitModuleMainClass(ModuleMainClass_attribute attr, T p) {
+            return null;
+        }
+
+        @Override
+        public Void visitModulePackages(ModulePackages_attribute attr, T p) {
+            return null;
+        }
+
+        @Override
+        public Void visitModuleResolution(ModuleResolution_attribute attr, T p) {
+            return null;
+        }
+
+        @Override
+        public Void visitModuleTarget(ModuleTarget_attribute attr, T p) {
             return null;
         }
 
@@ -1288,26 +1293,31 @@
         }
 
         @Override
+        public Void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisibleParameterAnnotations_attribute attr, T p) {
+            return null;
+        }
+
+        @Override
+        public Void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisibleTypeAnnotations_attribute attr, T p) {
+            return null;
+        }
+
+        @Override
+        public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, T p) {
+            return null;
+        }
+
+        @Override
         public Void visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute attr, T p) {
             return null;
         }
 
         @Override
-        public Void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisibleParameterAnnotations_attribute attr, T p) {
-            return null;
-        }
-
-        @Override
         public Void visitRuntimeVisibleTypeAnnotations(RuntimeVisibleTypeAnnotations_attribute attr, T p) {
             return null;
         }
 
         @Override
-        public Void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisibleTypeAnnotations_attribute attr, T p) {
-            return null;
-        }
-
-        @Override
         public Void visitSignature(Signature_attribute attr, T p) {
             return null;
         }
@@ -1341,17 +1351,6 @@
         public Void visitSynthetic(Synthetic_attribute attr, T p) {
             return null;
         }
-
-        @Override
-        public Void visitModuleTarget(ModuleTarget_attribute attr, T p) {
-            return null;
-        }
-
-        @Override
-        public Void visitModuleVersion(ModuleVersion_attribute attr, T p) {
-            return null;
-        }
-
     }
 
     private static final Attribute.Visitor<Void, ExpectedTypeAnnotation> typeAnnoMatcher
--- a/test/tools/javac/MethodParameters/AttributeVisitor.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/MethodParameters/AttributeVisitor.java	Fri Dec 16 05:47:58 2016 +0000
@@ -47,8 +47,8 @@
     public R visitModuleHashes(ModuleHashes_attribute attr, P p) { return null; }
     public R visitModuleMainClass(ModuleMainClass_attribute attr, P p) { return null; }
     public R visitModulePackages(ModulePackages_attribute attr, P p) { return null; }
+    public R visitModuleResolution(ModuleResolution_attribute attr, P p) { return null; }
     public R visitModuleTarget(ModuleTarget_attribute attr, P p) { return null; }
-    public R visitModuleVersion(ModuleVersion_attribute attr, P p) { return null; }
     public R visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, P p) { return null; }
     public R visitRuntimeInvisibleAnnotations(RuntimeInvisibleAnnotations_attribute attr, P p) { return null; }
     public R visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute attr, P p) { return null; }
--- a/test/tools/javac/T8003967/DetectMutableStaticFields.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/T8003967/DetectMutableStaticFields.java	Fri Dec 16 05:47:58 2016 +0000
@@ -112,6 +112,8 @@
                 "bootMethod", "defineModulesWithOneLoaderMethod", "configurationMethod", "layerClass");
         ignore("com/sun/tools/javac/util/JDK9Wrappers$Module",
                 "addExportsMethod", "addUsesMethod", "getModuleMethod", "getUnnamedModuleMethod");
+        ignore("com/sun/tools/javac/util/JDK9Wrappers$ModuleDescriptor$Version",
+                "versionClass", "parseMethod");
         ignore("com/sun/tools/javac/util/JDK9Wrappers$ModuleFinder",
                 "moduleFinderClass", "ofMethod");
         ignore("com/sun/tools/javac/util/JDK9Wrappers$ServiceLoaderHelper",
--- a/test/tools/javac/classfiles/attributes/Module/ModuleTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/classfiles/attributes/Module/ModuleTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -46,7 +46,7 @@
 
     @Test
     public void testEmptyModule(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .write(base);
         compile(base);
         testModuleAttribute(base, moduleDescriptor);
@@ -54,7 +54,7 @@
 
     @Test
     public void testExports(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .exports("pack")
                 .write(base);
         tb.writeJavaFiles(base, "package pack; public class C extends java.util.ArrayList{ }");
@@ -64,7 +64,7 @@
 
     @Test
     public void testSeveralExports(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .exports("pack")
                 .exports("pack2")
                 .exports("pack3")
@@ -83,7 +83,7 @@
 
     @Test
     public void testQualifiedExports(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .exportsTo("pack", "jdk.compiler")
                 .write(base);
         tb.writeJavaFiles(base, "package pack; public class A { }");
@@ -93,7 +93,7 @@
 
     @Test
     public void testQualifiedDynamicExports(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .exportsTo("pack", "jdk.compiler")
                 .write(base);
         tb.writeJavaFiles(base, "package pack; public class A { }");
@@ -103,7 +103,7 @@
 
     @Test
     public void testSeveralQualifiedExports(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .exportsTo("pack", "jdk.compiler, jdk.jdeps")
                 .exportsTo("pack2", "jdk.jdeps")
                 .exportsTo("pack3", "jdk.compiler")
@@ -122,7 +122,7 @@
 
     @Test
     public void testRequires(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .requires("jdk.compiler")
                 .write(base);
         compile(base);
@@ -131,7 +131,7 @@
 
     @Test
     public void testRequiresTransitive(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .requires("jdk.jdeps", RequiresFlag.TRANSITIVE)
                 .write(base);
         compile(base);
@@ -140,7 +140,7 @@
 
     @Test
     public void testRequiresStatic(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .requires("jdk.jdeps", RequiresFlag.STATIC)
                 .write(base);
         compile(base);
@@ -149,26 +149,26 @@
 
     @Test
     public void testSeveralRequires(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1x")
                 .requires("jdk.jdeps", RequiresFlag.TRANSITIVE)
                 .requires("jdk.compiler")
-                .requires("m2", RequiresFlag.STATIC)
-                .requires("m3")
-                .requires("m4", RequiresFlag.TRANSITIVE)
-                .requires("m5", RequiresFlag.STATIC, RequiresFlag.TRANSITIVE)
-                .write(base.resolve("m1"));
-        tb.writeJavaFiles(base.resolve("m2"), "module m2 { }");
-        tb.writeJavaFiles(base.resolve("m3"), "module m3 { }");
-        tb.writeJavaFiles(base.resolve("m4"), "module m4 { }");
-        tb.writeJavaFiles(base.resolve("m5"), "module m5 { }");
+                .requires("m2x", RequiresFlag.STATIC)
+                .requires("m3x")
+                .requires("m4x", RequiresFlag.TRANSITIVE)
+                .requires("m5x", RequiresFlag.STATIC, RequiresFlag.TRANSITIVE)
+                .write(base.resolve("m1x"));
+        tb.writeJavaFiles(base.resolve("m2x"), "module m2x { }");
+        tb.writeJavaFiles(base.resolve("m3x"), "module m3x { }");
+        tb.writeJavaFiles(base.resolve("m4x"), "module m4x { }");
+        tb.writeJavaFiles(base.resolve("m5x"), "module m5x { }");
         compile(base, "--module-source-path", base.toString(),
                 "-d", base.toString());
-        testModuleAttribute(base.resolve("m1"), moduleDescriptor);
+        testModuleAttribute(base.resolve("m1x"), moduleDescriptor);
     }
 
     @Test
     public void testProvides(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .provides("java.util.Collection", "pack2.D")
                 .write(base);
         tb.writeJavaFiles(base, "package pack2; public class D extends java.util.ArrayList{ }");
@@ -178,7 +178,7 @@
 
     @Test
     public void testSeveralProvides(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .provides("java.util.Collection", "pack2.D")
                 .provides("java.util.List", "pack2.D")
                 .requires("jdk.compiler")
@@ -192,7 +192,7 @@
 
     @Test
     public void testUses(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .uses("java.util.List")
                 .write(base);
         compile(base);
@@ -201,7 +201,7 @@
 
     @Test
     public void testSeveralUses(Path base) throws Exception {
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m")
                 .uses("java.util.List")
                 .uses("java.util.Collection")
                 .requires("jdk.compiler")
@@ -213,22 +213,22 @@
 
     @Test
     public void testComplex(Path base) throws Exception {
-        Path m1 = base.resolve("m1");
-        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1")
+        Path m1 = base.resolve("m1x");
+        ModuleDescriptor moduleDescriptor = new ModuleDescriptor("m1x")
                 .exports("pack1")
                 .exports("pack3")
-                .exportsTo("packTo1", "m2")
-                .exportsTo("packTo3", "m3")
+                .exportsTo("packTo1", "m2x")
+                .exportsTo("packTo3", "m3x")
                 .requires("jdk.compiler")
-                .requires("m2", RequiresFlag.TRANSITIVE)
-                .requires("m3", RequiresFlag.STATIC)
-                .requires("m4", RequiresFlag.TRANSITIVE, RequiresFlag.STATIC)
+                .requires("m2x", RequiresFlag.TRANSITIVE)
+                .requires("m3x", RequiresFlag.STATIC)
+                .requires("m4x", RequiresFlag.TRANSITIVE, RequiresFlag.STATIC)
                 .provides("java.util.List", "pack1.C", "pack2.D")
                 .uses("java.util.List")
                 .uses("java.nio.file.Path")
                 .requires("jdk.jdeps", RequiresFlag.STATIC, RequiresFlag.TRANSITIVE)
-                .requires("m5", RequiresFlag.STATIC)
-                .requires("m6", RequiresFlag.TRANSITIVE)
+                .requires("m5x", RequiresFlag.STATIC)
+                .requires("m6x", RequiresFlag.TRANSITIVE)
                 .requires("java.compiler")
                 .exportsTo("packTo4", "java.compiler")
                 .exportsTo("packTo2", "java.compiler")
@@ -244,11 +244,11 @@
                 "package packTo2; public class T2 {}",
                 "package packTo3; public class T3 {}",
                 "package packTo4; public class T4 {}");
-        tb.writeJavaFiles(base.resolve("m2"), "module m2 { }");
-        tb.writeJavaFiles(base.resolve("m3"), "module m3 { }");
-        tb.writeJavaFiles(base.resolve("m4"), "module m4 { }");
-        tb.writeJavaFiles(base.resolve("m5"), "module m5 { }");
-        tb.writeJavaFiles(base.resolve("m6"), "module m6 { }");
+        tb.writeJavaFiles(base.resolve("m2x"), "module m2x { }");
+        tb.writeJavaFiles(base.resolve("m3x"), "module m3x { }");
+        tb.writeJavaFiles(base.resolve("m4x"), "module m4x { }");
+        tb.writeJavaFiles(base.resolve("m5x"), "module m5x { }");
+        tb.writeJavaFiles(base.resolve("m6x"), "module m6x { }");
         compile(base, "--module-source-path", base.toString(),
                 "-d", base.toString());
         testModuleAttribute(m1, moduleDescriptor);
--- a/test/tools/javac/classfiles/attributes/Module/ModuleTestBase.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/classfiles/attributes/Module/ModuleTestBase.java	Fri Dec 16 05:47:58 2016 +0000
@@ -93,10 +93,10 @@
         tr.checkContains(actualRequires, moduleDescriptor.requires, "Lists of requires don't match");
     }
 
-    private void testExports(ModuleDescriptor moduleDescriptor, Module_attribute module, ConstantPool constantPool) throws ConstantPool.InvalidIndex, ConstantPool.UnexpectedEntry {
+    private void testExports(ModuleDescriptor moduleDescriptor, Module_attribute module, ConstantPool constantPool) throws ConstantPoolException {
         tr.checkEquals(module.exports_count, moduleDescriptor.exports.size(), "Wrong amount of exports.");
         for (Module_attribute.ExportsEntry export : module.exports) {
-            String pkg = constantPool.getUTF8Value(export.exports_index);
+            String pkg = constantPool.getPackageInfo(export.exports_index).getName();
             if (tr.checkTrue(moduleDescriptor.exports.containsKey(pkg), "Unexpected export " + pkg)) {
                 Export expectedExport = moduleDescriptor.exports.get(pkg);
                 tr.checkEquals(expectedExport.mask, export.exports_flags, "Wrong export flags");
@@ -104,7 +104,7 @@
                 tr.checkEquals(export.exports_to_count, expectedTo.size(), "Wrong amount of exports to");
                 List<String> actualTo = new ArrayList<>();
                 for (int toIdx : export.exports_to_index) {
-                    actualTo.add(constantPool.getUTF8Value(toIdx).replace('/', '.'));
+                    actualTo.add(constantPool.getModuleInfo(toIdx).getName().replace('/', '.'));
                 }
                 tr.checkContains(actualTo, expectedTo, "Lists of \"exports to\" don't match.");
             }
--- a/test/tools/javac/diags/examples/CyclicRequires/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m1 {
-     requires m2;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/CyclicRequires/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m1x {
+     requires m2x;
+}
--- a/test/tools/javac/diags/examples/CyclicRequires/modulesourcepath/m2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m2 {
-     requires m1;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/CyclicRequires/modulesourcepath/m2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m2x {
+     requires m1x;
+}
--- a/test/tools/javac/diags/examples/DuplicateModule/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 blah {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/DuplicateModule/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,24 @@
+/*
+ * 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 blah {}
--- a/test/tools/javac/diags/examples/DuplicateModule/modulesourcepath/m2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 blah {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/DuplicateModule/modulesourcepath/m2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,24 @@
+/*
+ * 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 blah {}
--- a/test/tools/javac/diags/examples/HasBeenDeprecatedModule/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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.
- */
-
-@Deprecated
-module m1 {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/HasBeenDeprecatedModule/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+@Deprecated
+module m1x {}
--- a/test/tools/javac/diags/examples/HasBeenDeprecatedModule/modulesourcepath/m2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m2 {
-    requires m1;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/HasBeenDeprecatedModule/modulesourcepath/m2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m2x {
+    requires m1x;
+}
--- a/test/tools/javac/diags/examples/HasBeenDeprecatedRemovalModule/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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.
- */
-
-@Deprecated(forRemoval=true)
-module m1 {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/HasBeenDeprecatedRemovalModule/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+@Deprecated(forRemoval=true)
+module m1x {}
--- a/test/tools/javac/diags/examples/HasBeenDeprecatedRemovalModule/modulesourcepath/m2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m2 {
-    requires m1;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/HasBeenDeprecatedRemovalModule/modulesourcepath/m2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m2x {
+    requires m1x;
+}
--- a/test/tools/javac/diags/examples/LeaksNotAccessible/modulesourcepath/m1/api/Api.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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.
- */
-
-package api;
-
-public class Api {
-     public Impl getImpl() {
-         return null;
-     }
-}
-
-class Impl {}
--- a/test/tools/javac/diags/examples/LeaksNotAccessible/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m1 {
-     exports api;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessible/modulesourcepath/m1x/api/Api.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+package api;
+
+public class Api {
+     public Impl getImpl() {
+         return null;
+     }
+}
+
+class Impl {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessible/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m1x {
+     exports api;
+}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m1/api1/Api1.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
- */
-
-package api1;
-
-public class Api1 {
-}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m1 {
-     exports api1;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m1x/api1/Api1.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package api1;
+
+public class Api1 {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m1x {
+     exports api1;
+}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m2/api2/Api2.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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.
- */
-
-package api2;
-
-public class Api2 {
-     public api1.Api1 getApi1() {
-         return null;
-     }
-}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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 m2 {
-     requires m1;
-     exports api2;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m2x/api2/Api2.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package api2;
+
+public class Api2 {
+     public api1.Api1 getApi1() {
+         return null;
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleNotRequiredTransitive/modulesourcepath/m2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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 m2x {
+     requires m1x;
+     exports api2;
+}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1/api/Api.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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.
- */
-
-package api;
-
-public class Api {
-     public impl.Impl getImpl() {
-         return null;
-     }
-}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1/impl/Impl.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
- */
-
-package impl;
-
-public class Impl {
-}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m1 {
-     exports api;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1x/api/Api.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package api;
+
+public class Api {
+     public impl.Impl getImpl() {
+         return null;
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1x/impl/Impl.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package impl;
+
+public class Impl {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleUnexported/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m1x {
+     exports api;
+}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1/api/Api.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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.
- */
-
-package api;
-
-public class Api {
-     public qapi.QApi get() {
-         return null;
-     }
-}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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 m1 {
-     exports api;
-     exports qapi to m2;
-}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1/qapi/QApi.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
- */
-
-package qapi;
-
-public class QApi {
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1x/api/Api.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package api;
+
+public class Api {
+     public qapi.QApi get() {
+         return null;
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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 m1x {
+     exports api;
+     exports qapi to m2x;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m1x/qapi/QApi.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package qapi;
+
+public class QApi {
+}
--- a/test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m2 {
-     requires m1;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/LeaksNotAccessibleUnexportedQualified/modulesourcepath/m2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m2x {
+     requires m1x;
+}
--- a/test/tools/javac/diags/examples/ModuleInfoWithoutModule/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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.
- */
-
-// No module description here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/ModuleInfoWithoutModule/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+// No module description here
--- a/test/tools/javac/diags/examples/MultiModuleOutputCannotBeExplodedModule/additional/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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 m1 {
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/MultiModuleOutputCannotBeExplodedModule/additional/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,25 @@
+/*
+ * 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 m1x {
+}
--- a/test/tools/javac/diags/examples/MultiModuleOutputCannotBeExplodedModule/modulesourcepath/m2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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 m2 {
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/MultiModuleOutputCannotBeExplodedModule/modulesourcepath/m2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,25 @@
+/*
+ * 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 m2x {
+}
--- a/test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 m1 {}
--- a/test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m1/p1/C1.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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.
- */
-
-package p1;
-
-public class C1 {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,24 @@
+/*
+ * 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 m1x {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m1x/p1/C1.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+package p1;
+
+public class C1 {}
--- a/test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 m2 {}
--- a/test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m2/p2/C2.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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.
- */
-
-package p2;
-
-public class C2 {
-    p1.C1 c1;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,24 @@
+/*
+ * 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 m2x {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/NotDefAccessClassPackageCantAccess/modulesourcepath/m2x/p2/C2.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+package p2;
+
+public class C2 {
+    p1.C1 c1;
+}
--- a/test/tools/javac/diags/examples/NotInProfile.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/diags/examples/NotInProfile.java	Fri Dec 16 05:47:58 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.not.in.profile
-// options: -profile compact1
+// options: --release 8 -profile compact1
 
 class NotInProfile {
     Class<?> c = java.awt.Frame.class;
--- a/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib1/exported/Api1.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
- */
-
-package exported;
-
-public class Api1 {
-}
--- a/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 lib1 {
-     exports exported;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib1x/exported/Api1.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package exported;
+
+public class Api1 {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 lib1x {
+     exports exported;
+}
--- a/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib2/exported/Api2.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
- */
-
-package exported;
-
-public class Api2 {
-}
--- a/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 lib2 {
-     exports exported;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib2x/exported/Api2.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package exported;
+
+public class Api2 {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/lib2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 lib2x {
+     exports exported;
+}
--- a/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/use/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/diags/examples/PackageClashFromRequires/modulesourcepath/use/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -22,6 +22,6 @@
  */
 
 module use {
-     requires lib1;
-     requires lib2;
+     requires lib1x;
+     requires lib2x;
 }
--- a/test/tools/javac/diags/examples/PackageEmptyOrNotFound/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m1 {
-    exports p1;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/PackageEmptyOrNotFound/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m1x {
+    exports p1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/PoorChoiceForModuleName/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+// key: compiler.warn.poor.choice.for.module.name
+// options: -Xlint:module
+
+module mango19 {}
--- a/test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1/exported/Service.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
- */
-
-package exported;
-
-public interface Service {
-}
--- a/test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1/exported/ServiceImplementation.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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.
- */
-
-package exported;
-
-public class ServiceImplementation implements Service {
-}
--- a/test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 m1 {
-     exports exported;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1x/exported/Service.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package exported;
+
+public interface Service {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1x/exported/ServiceImplementation.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package exported;
+
+public class ServiceImplementation implements Service {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m1x {
+     exports exported;
+}
--- a/test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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 m2 {
-     requires m1;
-     provides exported.Service with exported.ServiceImplementation;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/ServiceImplementationNotInRightModule/modulesourcepath/m2x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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 m2x {
+     requires m1x;
+     provides exported.Service with exported.ServiceImplementation;
+}
--- a/test/tools/javac/diags/examples/TooManyModules/p1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/diags/examples/TooManyModules/p1/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -21,4 +21,4 @@
  * questions.
  */
 
-module m1 {}
+module m1x {}
--- a/test/tools/javac/diags/examples/TooManyModules/p2/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/diags/examples/TooManyModules/p2/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -21,4 +21,4 @@
  * questions.
  */
 
-module m2 {}
+module m2x {}
--- a/test/tools/javac/diags/examples/UnnamedPackageInNamedModule/modulesourcepath/m1/UnnamedPackageInNamedModule.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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.
- */
-
-class UnnamedPackageInNamedModule {}
--- a/test/tools/javac/diags/examples/UnnamedPackageInNamedModule/modulesourcepath/m1/module-info.java	Wed Dec 14 20:23:26 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 m1 {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/UnnamedPackageInNamedModule/modulesourcepath/m1x/UnnamedPackageInNamedModule.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+class UnnamedPackageInNamedModule {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/UnnamedPackageInNamedModule/modulesourcepath/m1x/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,24 @@
+/*
+ * 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 m1x {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/WarnModuleNotFound/WarnModuleNotFound.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+// key: compiler.warn.module.not.found
+// options: -Xlint:module
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/WarnModuleNotFound/modulesourcepath/m/api/Api.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package api;
+
+public class Api {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/diags/examples/WarnModuleNotFound/modulesourcepath/m/module-info.java	Fri Dec 16 05:47:58 2016 +0000
@@ -0,0 +1,26 @@
+/*
+ * 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 m {
+     exports api to does.not.exist;
+}
--- a/test/tools/javac/lambda/ByteCodeTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/lambda/ByteCodeTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -619,6 +619,36 @@
         }
 
         @Override
+        public String visitModule(CONSTANT_Module_info c, Integer p) {
+
+            String value = slist.get(p);
+            if (value == null) {
+                try {
+                    value = visit(cfpool.get(c.name_index), c.name_index);
+                    slist.set(p, value);
+                } catch (ConstantPoolException ex) {
+                    ex.printStackTrace();
+                }
+            }
+            return value;
+        }
+
+        @Override
+        public String visitPackage(CONSTANT_Package_info c, Integer p) {
+
+            String value = slist.get(p);
+            if (value == null) {
+                try {
+                    value = visit(cfpool.get(c.name_index), c.name_index);
+                    slist.set(p, value);
+                } catch (ConstantPoolException ex) {
+                    ex.printStackTrace();
+                }
+            }
+            return value;
+        }
+
+        @Override
         public String visitString(CONSTANT_String_info c, Integer p) {
 
             try {
--- a/test/tools/javac/modules/AddExportsTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/AddExportsTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -31,13 +31,10 @@
  * @run main AddExportsTest
  */
 
-import java.nio.file.Files;
 import java.nio.file.Path;
-import java.util.Set;
 
 import toolbox.JavacTask;
 import toolbox.Task;
-import toolbox.ToolBox;
 
 public class AddExportsTest extends ModuleTestBase {
 
@@ -71,24 +68,24 @@
     @Test
     public void testEmptyItem(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { p1.C1 c1; }");
-        Path src_m3 = src.resolve("m3");
+        Path src_m3 = src.resolve("m3x");
         tb.writeJavaFiles(src_m3,
-                          "module m3 { }",
+                          "module m3x { }",
                           "package p3; class C3 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
-        testEmptyItem(src, classes, "m1/p1=,m2,m3");
-        testEmptyItem(src, classes, "m1/p1=m2,,m3");
-        testEmptyItem(src, classes, "m1/p1=m2,m3,");
+        testEmptyItem(src, classes, "m1x/p1=,m2x,m3x");
+        testEmptyItem(src, classes, "m1x/p1=m2x,,m3x");
+        testEmptyItem(src, classes, "m1x/p1=m2x,m3x,");
     }
 
     void testEmptyItem(Path src, Path classes, String option) throws Exception {
@@ -104,15 +101,15 @@
     @Test
     public void testEmptyList(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
-        testEmptyList(src, classes, "m1/p1=");
-        testEmptyList(src, classes, "m1/p1=,");
+        testEmptyList(src, classes, "m1x/p1=");
+        testEmptyList(src, classes, "m1x/p1=,");
     }
 
     void testEmptyList(Path src, Path classes, String option) throws Exception {
@@ -132,22 +129,22 @@
     @Test
     public void testMissingSourceParts(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
-        testMissingSourcePart(src, classes, "=m2");
-        testMissingSourcePart(src, classes, "/=m2");
-        testMissingSourcePart(src, classes, "m1/=m2");
-        testMissingSourcePart(src, classes, "/p1=m2");
-        testMissingSourcePart(src, classes, "m1p1=m2");
+        testMissingSourcePart(src, classes, "=m2x");
+        testMissingSourcePart(src, classes, "/=m2x");
+        testMissingSourcePart(src, classes, "m1x/=m2x");
+        testMissingSourcePart(src, classes, "/p1=m2x");
+        testMissingSourcePart(src, classes, "m1xp1=m2x");
     }
 
     private void testMissingSourcePart(Path src, Path classes, String option) throws Exception {
@@ -167,19 +164,19 @@
     @Test
     public void testBadSourceParts(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
-        testBadSourcePart(src, classes, "m!/p1=m2", "m!");
-        testBadSourcePart(src, classes, "m1/p!=m2", "p!");
+        testBadSourcePart(src, classes, "m!/p1=m2x", "m!");
+        testBadSourcePart(src, classes, "m1x/p!=m2x", "p!");
     }
 
     private void testBadSourcePart(Path src, Path classes, String option, String badName)
@@ -201,9 +198,9 @@
     @Test
     public void testBadTarget(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
@@ -211,7 +208,7 @@
         String log = new JavacTask(tb, Task.Mode.CMDLINE)
                 .options("-XDrawDiagnostics",
                          "--module-source-path", src.toString(),
-                         "--add-exports", "m1/p1=m!")
+                         "--add-exports", "m1x/p1=m!")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -225,16 +222,16 @@
     @Test
     public void testSourceNotFound(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { }");
+                          "module m1x { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         String log = new JavacTask(tb, Task.Mode.CMDLINE)
                 .options("-XDrawDiagnostics",
                          "--module-source-path", src.toString(),
-                         "--add-exports", "DoesNotExist/p=m1")
+                         "--add-exports", "DoesNotExist/p=m1x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -248,9 +245,9 @@
     @Test
     public void testTargetNotFound(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package p1; class C1 { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
@@ -258,7 +255,7 @@
         String log = new JavacTask(tb, Task.Mode.CMDLINE)
                 .options("-XDrawDiagnostics",
                          "--module-source-path", src.toString(),
-                         "--add-exports", "m1/p1=DoesNotExist")
+                         "--add-exports", "m1x/p1=DoesNotExist")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -272,20 +269,20 @@
     @Test
     public void testDuplicate(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--add-exports", "m1/p1=m2,m2")
+                         "--add-exports", "m1x/p1=m2x,m2x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -295,21 +292,21 @@
     @Test
     public void testRepeated_SameTarget(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--add-exports", "m1/p1=m2",
-                         "--add-exports", "m1/p1=m2")
+                         "--add-exports", "m1x/p1=m2x",
+                         "--add-exports", "m1x/p1=m2x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -319,25 +316,25 @@
     @Test
     public void testRepeated_DifferentTarget(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { p1.C1 c1; }");
-        Path src_m3 = src.resolve("m3");
+        Path src_m3 = src.resolve("m3x");
         tb.writeJavaFiles(src_m3,
-                          "module m3 { }",
+                          "module m3x { }",
                           "package p3; class C3 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--add-exports", "m1/p1=m2",
-                         "--add-exports", "m1/p1=m3")
+                         "--add-exports", "m1x/p1=m2x",
+                         "--add-exports", "m1x/p1=m3x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
--- a/test/tools/javac/modules/AddLimitMods.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/AddLimitMods.java	Fri Dec 16 05:47:58 2016 +0000
@@ -81,22 +81,22 @@
     @Test
     public void testManual(Path base) throws Exception {
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         tb.writeJavaFiles(m1,
-                          "module m1 { requires m2; requires m3; }");
+                          "module m1x { requires m2x; requires m3x; }");
 
-        Path m2 = moduleSrc.resolve("m2");
+        Path m2 = moduleSrc.resolve("m2x");
 
         tb.writeJavaFiles(m2,
-                          "module m2 { requires m3; exports m2; }",
-                          "package m2; public class M2 {}");
+                          "module m2x { requires m3x; exports m2x; }",
+                          "package m2x; public class M2 {}");
 
-        Path m3 = moduleSrc.resolve("m3");
+        Path m3 = moduleSrc.resolve("m3x");
 
         tb.writeJavaFiles(m3,
-                          "module m3 { exports m3; }",
-                          "package m3; public class M3 {}");
+                          "module m3x { exports m3x; }",
+                          "package m3x; public class M3 {}");
 
         Path modulePath = base.resolve("module-path");
 
@@ -130,7 +130,7 @@
                 .options("--module-path", modulePath.toString(),
                          "--should-stop:ifNoError=FLOW",
                          "--limit-modules", "java.base",
-                         "--add-modules", "m2")
+                         "--add-modules", "m2x")
                 .outdir(modulePath)
                 .files(findJavaFiles(m1))
                 .run(Task.Expect.FAIL)
@@ -140,7 +140,7 @@
                 .options("--module-path", modulePath.toString(),
                          "--should-stop:ifNoError=FLOW",
                          "--limit-modules", "java.base",
-                         "--add-modules", "m2,m3")
+                         "--add-modules", "m2x,m3x")
                 .outdir(modulePath)
                 .files(findJavaFiles(m1))
                 .run()
@@ -149,7 +149,7 @@
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
                          "--should-stop:ifNoError=FLOW",
-                         "--limit-modules", "m2")
+                         "--limit-modules", "m2x")
                 .outdir(modulePath)
                 .files(findJavaFiles(m1))
                 .run()
@@ -158,7 +158,7 @@
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
                          "--should-stop:ifNoError=FLOW",
-                         "--limit-modules", "m3")
+                         "--limit-modules", "m3x")
                 .outdir(modulePath)
                 .files(findJavaFiles(m1))
                 .run(Task.Expect.FAIL)
@@ -167,8 +167,8 @@
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
                          "--should-stop:ifNoError=FLOW",
-                         "--limit-modules", "m3",
-                         "--add-modules", "m2")
+                         "--limit-modules", "m3x",
+                         "--add-modules", "m2x")
                 .outdir(modulePath)
                 .files(findJavaFiles(m1))
                 .run()
@@ -233,10 +233,10 @@
             tb.cleanDirectory(base);
 
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         tb.writeJavaFiles(m1,
-                          "module m1 { exports api; }",
+                          "module m1x { exports api; }",
                           "package api; public class Api { }");
 
         Path modulePath = base.resolve("module-path");
@@ -319,7 +319,7 @@
             throw new IllegalStateException("incorrect errors; actual=" + actual);
         }
 
-        tb.writeJavaFiles(cpSrc, "module m1 {}");
+        tb.writeJavaFiles(cpSrc, "module m1x {}");
 
         actual = new JavacTask(tb)
                    .options("-XDrawDiagnostics",
@@ -382,10 +382,10 @@
           .run();
 
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         tb.writeJavaFiles(m1,
-                          "module m1 { exports api; }",
+                          "module m1x { exports api; }",
                           "package api; public class Api { public void test() { } }");
 
         System.err.println("Compiling module-src files:");
@@ -405,8 +405,8 @@
 
                 System.err.println("Running check: " + moduleInfo + "; " + Arrays.asList(options));
 
-                Path m2Runtime = base.resolve(index + "-runtime").resolve("m2");
-                Path out = base.resolve(index + "-runtime").resolve("out").resolve("m2");
+                Path m2Runtime = base.resolve(index + "-runtime").resolve("m2x");
+                Path out = base.resolve(index + "-runtime").resolve("out").resolve("m2x");
 
                 Files.createDirectories(out);
 
@@ -443,14 +443,14 @@
                 String output;
 
                 try {
-                    System.err.println("Running m2/test.Test:");
+                    System.err.println("Running m2x/test.Test:");
                     output = new JavaTask(tb)
                        .vmOptions(augmentOptions(options,
                                                  Collections.emptyList(),
                                                  "--module-path", modulePath.toString() + File.pathSeparator + out.getParent().toString(),
                                                  "--class-path", classpathOut.toString(),
-                                                 "--add-reads", "m2=ALL-UNNAMED,automatic",
-                                                 "-m", "m2/test.Test"))
+                                                 "--add-reads", "m2x=ALL-UNNAMED,automatic",
+                                                 "-m", "m2x/test.Test"))
                        .run()
                        .writeAll()
                        .getOutput(Task.OutputKind.STDERR);
@@ -461,7 +461,7 @@
                     output = "";
                 }
 
-                Path m2 = base.resolve(String.valueOf(index)).resolve("m2");
+                Path m2 = base.resolve(String.valueOf(index)).resolve("m2x");
 
                 tb.writeJavaFiles(m2,
                                   moduleInfo,
@@ -475,7 +475,7 @@
                     "-XDaccessInternalAPI=true"
                 ) : Collections.emptyList();
 
-                System.err.println("Compiling/processing m2 files:");
+                System.err.println("Compiling/processing m2x files:");
                 new JavacTask(tb)
                    .options(augmentOptions(options,
                                            auxOptions,
@@ -515,8 +515,8 @@
     private static final Map<String, String> MODULES_TO_CHECK_TO_SAMPLE_CLASS = new LinkedHashMap<>();
 
     static {
-        MODULES_TO_CHECK_TO_SAMPLE_CLASS.put("m1", "api.Api");
-        MODULES_TO_CHECK_TO_SAMPLE_CLASS.put("m2", "test.Test");
+        MODULES_TO_CHECK_TO_SAMPLE_CLASS.put("m1x", "api.Api");
+        MODULES_TO_CHECK_TO_SAMPLE_CLASS.put("m2x", "test.Test");
         MODULES_TO_CHECK_TO_SAMPLE_CLASS.put("java.base", "java.lang.Object");
     };
 
@@ -578,19 +578,19 @@
     }
 
     private static final String[] MODULE_INFO_VARIANTS = {
-        "module m2 { exports test; }",
-        "module m2 { requires m1; exports test; }"
+        "module m2x { exports test; }",
+        "module m2x { requires m1x; exports test; }"
     };
 
     private static final String[][] OPTIONS_VARIANTS = {
         {"--add-modules", "automatic"},
-        {"--add-modules", "m1,automatic"},
+        {"--add-modules", "m1x,automatic"},
         {"--add-modules", "jdk.compiler,automatic"},
-        {"--add-modules", "m1,jdk.compiler,automatic"},
+        {"--add-modules", "m1x,jdk.compiler,automatic"},
         {"--add-modules", "ALL-SYSTEM,automatic"},
         {"--limit-modules", "java.base", "--add-modules", "automatic"},
         {"--limit-modules", "java.base", "--add-modules", "ALL-SYSTEM,automatic"},
-        {"--limit-modules", "m2", "--add-modules", "automatic"},
+        {"--limit-modules", "m2x", "--add-modules", "automatic"},
         {"--limit-modules", "jdk.compiler", "--add-modules", "automatic"},
     };
 }
--- a/test/tools/javac/modules/AddModulesTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/AddModulesTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -36,7 +36,6 @@
 
 import toolbox.JavacTask;
 import toolbox.Task;
-import toolbox.ToolBox;
 
 public class AddModulesTest extends ModuleTestBase {
     public static void main(String... args) throws Exception {
@@ -70,18 +69,18 @@
     @Test
     public void testEmptyItem(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { }");
-        Path src_m2 = src.resolve("m2");
+                          "module m1x { }");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }");
+                          "module m2x { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
-        testEmptyItem(src, classes, ",m1");
-        testEmptyItem(src, classes, "m1,,m2");
-        testEmptyItem(src, classes, "m1,");
+        testEmptyItem(src, classes, ",m1x");
+        testEmptyItem(src, classes, "m1x,,m2x");
+        testEmptyItem(src, classes, "m1x,");
     }
 
     private void testEmptyItem(Path src, Path classes, String option) throws Exception {
@@ -159,9 +158,9 @@
         Path src = base.resolve("src");
 
         // setup a utility module
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
         Path modules = base.resolve("modules");
         tb.createDirectories(modules);
@@ -182,7 +181,7 @@
 
         new JavacTask(tb)
                 .options("--module-path", modules.toString(),
-                         "--add-modules", "m1,m1")
+                         "--add-modules", "m1x,m1x")
                 .outdir(classes)
                 .files(findJavaFiles(src2))
                 .run()
@@ -194,13 +193,13 @@
         Path src = base.resolve("src");
 
         // setup some utility modules
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { exports p2; }",
+                          "module m2x { exports p2; }",
                           "package p2; public class C2 { }");
         Path modules = base.resolve("modules");
         tb.createDirectories(modules);
@@ -221,8 +220,8 @@
 
         new JavacTask(tb)
                 .options("--module-path", modules.toString(),
-                         "--add-modules", "m1",
-                         "--add-modules", "m2")
+                         "--add-modules", "m1x",
+                         "--add-modules", "m2x")
                 .outdir(classes)
                 .files(findJavaFiles(src2))
                 .run()
--- a/test/tools/javac/modules/AddReadsTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/AddReadsTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -60,13 +60,13 @@
     @Test
     public void testAddReads(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports api; }",
+                          "module m1x { exports api; }",
                           "package api; public class Api { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package test; public class Test extends api.Api { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
@@ -85,7 +85,7 @@
 
         //test add dependencies:
         new JavacTask(tb)
-                .options("--add-reads", "m2=m1",
+                .options("--add-reads", "m2x=m1x",
                          "--module-source-path", src.toString(),
                          "-processor", VerifyRequires.class.getName())
                 .outdir(classes)
@@ -94,18 +94,19 @@
                 .writeAll();
 
         String decompiled = new JavapTask(tb)
-                .options("-verbose", classes.resolve("m2").resolve("module-info.class").toString())
+                .options("-verbose",
+                        classes.resolve("m2x").resolve("module-info.class").toString())
                 .run()
                 .getOutput(Task.OutputKind.DIRECT);
 
-        if (decompiled.contains("m1")) {
-            throw new Exception("Incorrectly refers to m1 module.");
+        if (decompiled.contains("m1x")) {
+            throw new Exception("Incorrectly refers to m1x module.");
         }
 
         //cyclic dependencies OK when created through addReads:
         new JavacTask(tb)
-                .options("--add-reads", "m2=m1",
-                         "--add-reads", "m1=m2",
+                .options("--add-reads", "m2x=m1x",
+                         "--add-reads", "m1x=m2x",
                          "--module-source-path", src.toString())
                 .outdir(classes)
                 .files(findJavaFiles(src))
@@ -113,10 +114,10 @@
                 .writeAll();
 
         tb.writeJavaFiles(src_m2,
-                          "module m2 { requires m1; }");
+                          "module m2x { requires m1x; }");
 
         new JavacTask(tb)
-                .options("--add-reads", "m1=m2",
+                .options("--add-reads", "m1x=m2x",
                          "--module-source-path", src.toString())
                 .outdir(classes)
                 .files(findJavaFiles(src))
@@ -129,16 +130,16 @@
 
         @Override
         public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-            ModuleElement m2Module = processingEnv.getElementUtils().getModuleElement("m2");
+            ModuleElement m2Module = processingEnv.getElementUtils().getModuleElement("m2x");
             if (m2Module == null) {
-                throw new AssertionError("Cannot find the m2 module!");
+                throw new AssertionError("Cannot find the m2x module!");
             }
             boolean foundM1 = false;
             for (RequiresDirective rd : ElementFilter.requiresIn(m2Module.getDirectives())) {
-                foundM1 |= rd.getDependency().getSimpleName().contentEquals("m1");
+                foundM1 |= rd.getDependency().getSimpleName().contentEquals("m1x");
             }
             if (!foundM1) {
-                throw new AssertionError("Cannot find the dependency on m1 module!");
+                throw new AssertionError("Cannot find the dependency on m1x module!");
             }
             return false;
         }
@@ -155,19 +156,19 @@
         Path jar = prepareTestJar(base);
 
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         Path classes = base.resolve("classes");
 
         Files.createDirectories(classes);
 
         tb.writeJavaFiles(m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package impl; public class Impl { api.Api api; }");
 
         new JavacTask(tb)
           .options("--class-path", jar.toString(),
-                   "--add-reads", "m1=ALL-UNNAMED",
+                   "--add-reads", "m1x=ALL-UNNAMED",
                    "-XDrawDiagnostics")
           .outdir(classes)
           .files(findJavaFiles(moduleSrc))
@@ -180,21 +181,21 @@
         Path jar = prepareTestJar(base);
 
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         Path classes = base.resolve("classes");
 
         Files.createDirectories(classes);
 
         tb.writeJavaFiles(m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package api; public class Api { public static void test() { } }",
                           "package impl; public class Impl { { api.Api.test(); } }");
 
         new JavacTask(tb)
           .options("--class-path", jar.toString(),
                    "--module-source-path", moduleSrc.toString(),
-                   "--add-reads", "m1=ALL-UNNAMED",
+                   "--add-reads", "m1x=ALL-UNNAMED",
                    "-XDrawDiagnostics")
           .outdir(classes)
           .files(m1.resolve("impl").resolve("Impl.java"))
@@ -279,9 +280,9 @@
     @Test
     public void testX(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { provides java.lang.Runnable with impl.Impl; }",
+                          "module m1x { provides java.lang.Runnable with impl.Impl; }",
                           "package impl; public class Impl implements Runnable { public void run() { } }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
@@ -302,8 +303,8 @@
                           "package impl; public class Impl { }");
 
         new JavacTask(tb)
-          .options("--add-reads", "m1=ALL-UNNAMED",
-                   "-Xmodule:m1",
+          .options("--add-reads", "m1x=ALL-UNNAMED",
+                   "-Xmodule:m1x",
                    "--module-path", classes.toString())
           .outdir(unnamedClasses)
           .files(findJavaFiles(unnamedSrc))
@@ -314,16 +315,16 @@
     @Test
     public void testAddSelf(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--add-reads", "m1=m1")
+                         "--add-reads", "m1x=m1x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -357,24 +358,24 @@
     @Test
     public void testEmptyItem(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { }");
-        Path src_m3 = src.resolve("m3");
+        Path src_m3 = src.resolve("m3x");
         tb.writeJavaFiles(src_m3,
-                          "module m3 { }",
+                          "module m3x { }",
                           "package p3; class C3 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
-        testEmptyItem(src, classes, "m3=,m1");
-        testEmptyItem(src, classes, "m3=m1,,m2");
-        testEmptyItem(src, classes, "m3=m1,");
+        testEmptyItem(src, classes, "m3x=,m1x");
+        testEmptyItem(src, classes, "m3x=m1x,,m2x");
+        testEmptyItem(src, classes, "m3x=m1x,");
     }
 
     private void testEmptyItem(Path src, Path classes, String option) throws Exception {
@@ -390,23 +391,23 @@
     @Test
     public void testEmptyList(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { }");
-        Path src_m3 = src.resolve("m3");
+        Path src_m3 = src.resolve("m3x");
         tb.writeJavaFiles(src_m3,
-                          "module m3 { }",
+                          "module m3x { }",
                           "package p3; class C3 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
-        testEmptyList(src, classes, "m3=");
-        testEmptyList(src, classes, "m3=,");
+        testEmptyList(src, classes, "m3x=");
+        testEmptyList(src, classes, "m3x=,");
     }
 
     private void testEmptyList(Path src, Path classes, String option) throws Exception {
@@ -426,25 +427,25 @@
     @Test
     public void testMultipleAddReads_DifferentModules(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { p1.C1 c1; }");
-        Path src_m3 = src.resolve("m3");
+        Path src_m3 = src.resolve("m3x");
         tb.writeJavaFiles(src_m3,
-                          "module m3 { }",
+                          "module m3x { }",
                           "package p3; class C3 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--add-reads", "m2=m1",
-                         "--add-reads", "m3=m1")
+                         "--add-reads", "m2x=m1x",
+                         "--add-reads", "m3x=m1x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -454,25 +455,25 @@
     @Test
     public void testMultipleAddReads_SameModule(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { exports p2; }",
+                          "module m2x { exports p2; }",
                           "package p2; public class C2 { }");
-        Path src_m3 = src.resolve("m3");
+        Path src_m3 = src.resolve("m3x");
         tb.writeJavaFiles(src_m3,
-                          "module m3 { }",
+                          "module m3x { }",
                           "package p3; class C3 { p1.C1 c1; p2.C2 c2; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--add-reads", "m3=m1",
-                         "--add-reads", "m3=m2")
+                         "--add-reads", "m3x=m1x",
+                         "--add-reads", "m3x=m2x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -482,20 +483,20 @@
     @Test
     public void testDuplicateAddReads_SameOption(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { exports p2; }",
+                          "module m2x { exports p2; }",
                           "package p2; class C2 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--add-reads", "m2=m1,m1")
+                         "--add-reads", "m2x=m1x,m1x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -505,21 +506,21 @@
     @Test
     public void testDuplicateAddReads_MultipleOptions(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package p2; class C2 { p1.C1 c1; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--add-reads", "m2=m1",
-                         "--add-reads", "m2=m1")
+                         "--add-reads", "m2x=m1x",
+                         "--add-reads", "m2x=m1x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -529,25 +530,25 @@
     @Test
     public void testRepeatedAddReads(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { exports p2; }",
+                          "module m2x { exports p2; }",
                           "package p2; public class C2 { }");
-        Path src_m3 = src.resolve("m3");
+        Path src_m3 = src.resolve("m3x");
         tb.writeJavaFiles(src_m3,
-                          "module m3 { }",
+                          "module m3x { }",
                           "package p3; class C3 { p1.C1 c1; p2.C2 c2; }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--add-reads", "m3=m1",
-                         "--add-reads", "m3=m2")
+                         "--add-reads", "m3x=m1x",
+                         "--add-reads", "m3x=m2x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -563,7 +564,7 @@
 
         String log = new JavacTask(tb, Task.Mode.CMDLINE)
                 .options("-XDrawDiagnostics",
-                         "--add-reads", "m1:m2")
+                         "--add-reads", "m1x:m2x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run(Task.Expect.FAIL)
@@ -571,7 +572,7 @@
                 .getOutput(Task.OutputKind.DIRECT);
 
         checkOutputContains(log,
-            "javac: bad value for --add-reads option: 'm1:m2'");
+            "javac: bad value for --add-reads option: 'm1x:m2x'");
     }
 
     @Test
@@ -583,7 +584,7 @@
 
         String log = new JavacTask(tb)
                 .options("-XDrawDiagnostics",
-                         "--add-reads", "bad*Source=m2")
+                         "--add-reads", "bad*Source=m2x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -597,16 +598,16 @@
     @Test
     public void testBadTargetName(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package p1; class C1 { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         String log = new JavacTask(tb)
                 .options("-XDrawDiagnostics",
-                         "--add-reads", "m1=badTarget!")
+                         "--add-reads", "m1x=badTarget!")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -620,16 +621,16 @@
     @Test
     public void testSourceNameNotFound(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         String log = new JavacTask(tb)
                 .options("-XDrawDiagnostics",
-                         "--add-reads", "missingSource=m1")
+                         "--add-reads", "missingSource=m")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -643,16 +644,16 @@
     @Test
     public void testTargetNameNotFound(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports p1; }",
+                          "module m1x { exports p1; }",
                           "package p1; public class C1 { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         String log = new JavacTask(tb)
                 .options("-XDrawDiagnostics",
-                         "--add-reads", "m1=missingTarget")
+                         "--add-reads", "m1x=missingTarget")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
--- a/test/tools/javac/modules/AnnotationProcessing.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/AnnotationProcessing.java	Fri Dec 16 05:47:58 2016 +0000
@@ -74,20 +74,20 @@
     @Test
     public void testAPSingleModule(Path base) throws Exception {
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         Path classes = base.resolve("classes");
 
         Files.createDirectories(classes);
 
         tb.writeJavaFiles(m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package impl; public class Impl { }");
 
         String log = new JavacTask(tb)
                 .options("--module-source-path", moduleSrc.toString(),
                          "-processor", AP.class.getName(),
-                         "-AexpectedEnclosedElements=m1=>impl")
+                         "-AexpectedEnclosedElements=m1x=>impl")
                 .outdir(classes)
                 .files(findJavaFiles(moduleSrc))
                 .run()
@@ -101,25 +101,25 @@
     @Test
     public void testAPMultiModule(Path base) throws Exception {
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
-        Path m2 = moduleSrc.resolve("m2");
+        Path m1 = moduleSrc.resolve("m1x");
+        Path m2 = moduleSrc.resolve("m2x");
 
         Path classes = base.resolve("classes");
 
         Files.createDirectories(classes);
 
         tb.writeJavaFiles(m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package impl1; public class Impl1 { }");
 
         tb.writeJavaFiles(m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package impl2; public class Impl2 { }");
 
         String log = new JavacTask(tb)
                 .options("--module-source-path", moduleSrc.toString(),
                          "-processor", AP.class.getName(),
-                         "-AexpectedEnclosedElements=m1=>impl1,m2=>impl2")
+                         "-AexpectedEnclosedElements=m1x=>impl1,m2x=>impl2")
                 .outdir(classes)
                 .files(findJavaFiles(moduleSrc))
                 .run()
@@ -202,14 +202,14 @@
     @Test
     public void testVerifyUsesProvides(Path base) throws Exception {
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         Path classes = base.resolve("classes");
 
         Files.createDirectories(classes);
 
         tb.writeJavaFiles(m1,
-                          "module m1 { exports api; uses api.Api; provides api.Api with impl.Impl; }",
+                          "module m1x { exports api; uses api.Api; provides api.Api with impl.Impl; }",
                           "package api; public class Api { }",
                           "package impl; public class Impl extends api.Api { }");
 
@@ -307,20 +307,20 @@
     @Test
     public void testQualifiedClassForProcessing(Path base) throws Exception {
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
-        Path m2 = moduleSrc.resolve("m2");
+        Path m1 = moduleSrc.resolve("m1x");
+        Path m2 = moduleSrc.resolve("m2x");
 
         Path classes = base.resolve("classes");
 
         Files.createDirectories(classes);
 
         tb.writeJavaFiles(m1,
-                          "module m1 { }",
-                          "package impl; public class Impl { int m1; }");
+                          "module m1x { }",
+                          "package impl; public class Impl { int m1x; }");
 
         tb.writeJavaFiles(m2,
-                          "module m2 { }",
-                          "package impl; public class Impl { int m2; }");
+                          "module m2x { }",
+                          "package impl; public class Impl { int m2x; }");
 
         new JavacTask(tb)
             .options("--module-source-path", moduleSrc.toString())
@@ -330,13 +330,13 @@
             .writeAll()
             .getOutput(Task.OutputKind.DIRECT);
 
-        List<String> expected = Arrays.asList("Note: field: m1");
+        List<String> expected = Arrays.asList("Note: field: m1x");
 
         for (Mode mode : new Mode[] {Mode.API, Mode.CMDLINE}) {
             List<String> log = new JavacTask(tb, mode)
                     .options("-processor", QualifiedClassForProcessing.class.getName(),
                              "--module-path", classes.toString())
-                    .classes("m1/impl.Impl")
+                    .classes("m1x/impl.Impl")
                     .outdir(classes)
                     .run()
                     .writeAll()
@@ -352,8 +352,8 @@
 
         @Override
         public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-            if (processingEnv.getElementUtils().getModuleElement("m1") == null) {
-                throw new AssertionError("No m1 module found.");
+            if (processingEnv.getElementUtils().getModuleElement("m1x") == null) {
+                throw new AssertionError("No m1x module found.");
             }
 
             Messager messager = processingEnv.getMessager();
--- a/test/tools/javac/modules/AnnotationProcessorsInModulesTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/AnnotationProcessorsInModulesTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -38,7 +38,6 @@
 
 import toolbox.JavacTask;
 import toolbox.Task;
-import toolbox.ToolBox;
 
 public class AnnotationProcessorsInModulesTest extends ModuleTestBase {
 
@@ -47,7 +46,7 @@
     }
 
     private static final String annotationProcessorModule1 =
-            "module anno_proc1 {\n" +
+            "module anno_proc1x {\n" +
             "    requires java.compiler;\n" +
             "\n" +
             "    provides javax.annotation.processing.Processor\n" +
@@ -55,7 +54,7 @@
             "}";
 
     private static final String annotationProcessorModule2 =
-            "module anno_proc2 {\n" +
+            "module anno_proc2x {\n" +
             "    requires java.compiler;\n" +
             "\n" +
             "    provides javax.annotation.processing.Processor\n" +
@@ -118,8 +117,8 @@
 
     void initialization(Path base) throws Exception {
         moduleSrc = base.resolve("anno_proc_src");
-        Path anno_proc1 = moduleSrc.resolve("anno_proc1");
-        Path anno_proc2 = moduleSrc.resolve("anno_proc2");
+        Path anno_proc1 = moduleSrc.resolve("anno_proc1x");
+        Path anno_proc2 = moduleSrc.resolve("anno_proc2x");
 
         processorCompiledModules = base.resolve("mods");
 
--- a/test/tools/javac/modules/AnnotationsOnModules.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/AnnotationsOnModules.java	Fri Dec 16 05:47:58 2016 +0000
@@ -67,10 +67,10 @@
     @Test
     public void testSimpleAnnotation(Path base) throws Exception {
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         tb.writeJavaFiles(m1,
-                          "@Deprecated module m1 { }");
+                          "@Deprecated module m1x { }");
 
         Path modulePath = base.resolve("module-path");
 
@@ -83,7 +83,7 @@
                 .run()
                 .writeAll();
 
-        ClassFile cf = ClassFile.read(modulePath.resolve("m1").resolve("module-info.class"));
+        ClassFile cf = ClassFile.read(modulePath.resolve("m1x").resolve("module-info.class"));
         RuntimeVisibleAnnotations_attribute annotations = (RuntimeVisibleAnnotations_attribute) cf.attributes.map.get(Attribute.RuntimeVisibleAnnotations);
 
         if (annotations == null || annotations.annotations.length != 1) {
@@ -94,11 +94,11 @@
     @Test
     public void testAnnotationWithImport(Path base) throws Exception {
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         tb.writeJavaFiles(m1,
-                          "import m1.A; @A module m1 { }",
-                          "package m1; import java.lang.annotation.*; @Target(ElementType.MODULE) public @interface A {}");
+                          "import m1x.A; @A module m1x { }",
+                          "package m1x; import java.lang.annotation.*; @Target(ElementType.MODULE) public @interface A {}");
 
         Path modulePath = base.resolve("module-path");
 
@@ -111,7 +111,7 @@
                 .run()
                 .writeAll();
 
-        ClassFile cf = ClassFile.read(modulePath.resolve("m1").resolve("module-info.class"));
+        ClassFile cf = ClassFile.read(modulePath.resolve("m1x").resolve("module-info.class"));
         RuntimeInvisibleAnnotations_attribute annotations = (RuntimeInvisibleAnnotations_attribute) cf.attributes.map.get(Attribute.RuntimeInvisibleAnnotations);
 
         if (annotations == null || annotations.annotations.length != 1) {
@@ -122,13 +122,13 @@
     @Test
     public void testModuleInfoAnnotationsInAPI(Path base) throws Exception {
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         tb.writeJavaFiles(m1,
-                          "import m1.*; @A @Deprecated @E @E module m1 { }",
-                          "package m1; import java.lang.annotation.*; @Target(ElementType.MODULE) public @interface A {}",
-                          "package m1; import java.lang.annotation.*; @Target(ElementType.MODULE) @Repeatable(C.class) public @interface E {}",
-                          "package m1; import java.lang.annotation.*; @Target(ElementType.MODULE) public @interface C { public E[] value(); }");
+                          "import m1x.*; @A @Deprecated @E @E module m1x { }",
+                          "package m1x; import java.lang.annotation.*; @Target(ElementType.MODULE) public @interface A {}",
+                          "package m1x; import java.lang.annotation.*; @Target(ElementType.MODULE) @Repeatable(C.class) public @interface E {}",
+                          "package m1x; import java.lang.annotation.*; @Target(ElementType.MODULE) public @interface C { public E[] value(); }");
 
         Path modulePath = base.resolve("module-path");
 
@@ -153,7 +153,7 @@
 
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString(),
-                         "--add-modules", "m1",
+                         "--add-modules", "m1x",
                          "-processor", AP.class.getName())
                 .outdir(out)
                 .files(findJavaFiles(src))
@@ -162,10 +162,10 @@
 
         new JavacTask(tb)
                 .options("--module-path", modulePath.toString() + File.pathSeparator + out.toString(),
-                         "--add-modules", "m1",
+                         "--add-modules", "m1x",
                          "-processor", AP.class.getName(),
                          "-proc:only")
-                .classes("m1/m1.A")
+                .classes("m1x/m1x.A")
                 .files(findJavaFiles(src))
                 .run()
                 .writeAll();
@@ -176,10 +176,10 @@
 
         @Override
         public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-            ModuleElement m1 = processingEnv.getElementUtils().getModuleElement("m1");
+            ModuleElement m1 = processingEnv.getElementUtils().getModuleElement("m1x");
             Set<String> actualAnnotations = new HashSet<>();
             Set<String> expectedAnnotations =
-                    new HashSet<>(Arrays.asList("@m1.A", "@java.lang.Deprecated", "@m1.C({@m1.E, @m1.E})"));
+                    new HashSet<>(Arrays.asList("@m1x.A", "@java.lang.Deprecated", "@m1x.C({@m1x.E, @m1x.E})"));
 
             for (AnnotationMirror am : m1.getAnnotationMirrors()) {
                 actualAnnotations.add(am.toString());
@@ -197,17 +197,17 @@
     @Test
     public void testModuleDeprecation(Path base) throws Exception {
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         tb.writeJavaFiles(m1,
-                          "@Deprecated module m1 { }");
+                          "@Deprecated module m1x { }");
 
-        Path m2 = moduleSrc.resolve("m2");
+        Path m2 = moduleSrc.resolve("m2x");
 
         tb.writeJavaFiles(m2,
-                          "@Deprecated module m2 { }");
+                          "@Deprecated module m2x { }");
 
-        Path m3 = moduleSrc.resolve("m3");
+        Path m3 = moduleSrc.resolve("m3x");
 
         Path modulePath = base.resolve("module-path");
 
@@ -218,12 +218,12 @@
 
         for (String suppress : new String[] {"", "@Deprecated ", "@SuppressWarnings(\"deprecation\") "}) {
             tb.writeJavaFiles(m3,
-                              suppress + "module m3 {\n" +
-                              "    requires m1;\n" +
-                              "    exports api to m1, m2;\n" +
+                              suppress + "module m3x {\n" +
+                              "    requires m1x;\n" +
+                              "    exports api to m1x, m2x;\n" +
                               "}",
                               "package api; public class Api { }");
-            System.err.println("compile m3");
+            System.err.println("compile m3x");
             actual = new JavacTask(tb)
                     .options("--module-source-path", moduleSrc.toString(),
                              "-XDrawDiagnostics")
@@ -245,7 +245,7 @@
                 throw new AssertionError("Unexpected output: " + actual + "; suppress: " + suppress);
             }
 
-            System.err.println("compile m3 with -Xlint:-deprecation");
+            System.err.println("compile m3x with -Xlint:-deprecation");
             actual = new JavacTask(tb)
                     .options("--module-source-path", moduleSrc.toString(),
                              "-XDrawDiagnostics",
@@ -258,7 +258,7 @@
 
             if (suppress.isEmpty()) {
                 expected = Arrays.asList(
-                        "module-info.java:2:14: compiler.warn.has.been.deprecated.module: m1",
+                        "module-info.java:2:14: compiler.warn.has.been.deprecated.module: m1x",
                         "1 warning");
             } else {
                 expected = Arrays.asList("");
@@ -269,13 +269,13 @@
             }
 
             //load the deprecated module-infos from classfile:
-            System.err.println("compile m3 with -Xlint:-deprecation, loading deprecated modules from classes");
+            System.err.println("compile m3x with -Xlint:-deprecation, loading deprecated modules from classes");
             actual = new JavacTask(tb)
                     .options("--module-path", modulePath.toString(),
                              "-XDrawDiagnostics",
                              "-Xlint:deprecation")
-                    .outdir(modulePath.resolve("m3"))
-                    .files(findJavaFiles(moduleSrc.resolve("m3")))
+                    .outdir(modulePath.resolve("m3x"))
+                    .files(findJavaFiles(moduleSrc.resolve("m3x")))
                     .run()
                     .writeAll()
                     .getOutputLines(OutputKind.DIRECT);
--- a/test/tools/javac/modules/AutomaticModules.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/AutomaticModules.java	Fri Dec 16 05:47:58 2016 +0000
@@ -82,14 +82,14 @@
           .run();
 
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         Path classes = base.resolve("classes");
 
         Files.createDirectories(classes);
 
         tb.writeJavaFiles(m1,
-                          "module m1 { requires test.api; requires java.desktop; }",
+                          "module m1x { requires test.api; requires java.desktop; }",
                           "package impl; public class Impl { public void e(api.Api api) { api.actionPerformed(null); } }");
 
         new JavacTask(tb)
@@ -140,14 +140,14 @@
           .run();
 
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
+        Path m1 = moduleSrc.resolve("m1x");
 
         Path classes = base.resolve("classes");
 
         Files.createDirectories(classes);
 
         tb.writeJavaFiles(m1,
-                          "module m1 { requires test.api; }",
+                          "module m1x { requires test.api; }",
                           "package impl; public class Impl { public void e(api.Api api) { api.run(\"\"); } }");
 
         new JavacTask(tb)
@@ -193,7 +193,7 @@
         Files.createDirectories(depClasses);
 
         tb.writeJavaFiles(depSrc,
-                          "module m1 { requires transitive automatic; }",
+                          "module m1x { requires transitive automatic; }",
                           "package dep; public class Dep { api.Api api; }");
 
         new JavacTask(tb)
@@ -203,7 +203,7 @@
                 .run()
                 .writeAll();
 
-        Path moduleJar = modulePath.resolve("m1.jar");
+        Path moduleJar = modulePath.resolve("m1x.jar");
 
         new JarTask(tb, moduleJar)
           .baseDir(depClasses)
@@ -217,7 +217,7 @@
         Files.createDirectories(testClasses);
 
         tb.writeJavaFiles(testSrc,
-                          "module m2 { requires automatic; }",
+                          "module m2x { requires automatic; }",
                           "package test; public class Test { }");
 
         new JavacTask(tb)
@@ -260,13 +260,13 @@
 
         Path moduleSrc = base.resolve("module-src");
 
-        tb.writeJavaFiles(moduleSrc.resolve("m1"),
-                          "module m1 { requires static automaticA; }",
-                          "package impl; public class Impl { apiA.Api a; apiB.Api b; m2.M2 m;}");
+        tb.writeJavaFiles(moduleSrc.resolve("m1x"),
+                          "module m1x { requires static automaticA; }",
+                          "package impl; public class Impl { apiA.Api a; apiB.Api b; m2x.M2 m;}");
 
-        tb.writeJavaFiles(moduleSrc.resolve("m2"),
-                          "module m2 { exports m2; }",
-                          "package m2; public class M2 { }");
+        tb.writeJavaFiles(moduleSrc.resolve("m2x"),
+                          "module m2x { exports m2x; }",
+                          "package m2x; public class M2 { }");
 
         Path classes = base.resolve("classes");
 
@@ -283,7 +283,7 @@
                 .writeAll()
                 .getOutputLines(Task.OutputKind.DIRECT);
 
-        List<String> expected = Arrays.asList("Impl.java:1:61: compiler.err.not.def.access.package.cant.access: m2.M2, m2",
+        List<String> expected = Arrays.asList("Impl.java:1:62: compiler.err.not.def.access.package.cant.access: m2x.M2, m2x",
                                               "1 error");
 
         if (!expected.equals(log)) {
@@ -301,7 +301,7 @@
                 .getOutputLines(Task.OutputKind.DIRECT);
 
         expected = Arrays.asList("Impl.java:1:51: compiler.err.doesnt.exist: apiB",
-                                 "Impl.java:1:61: compiler.err.not.def.access.package.cant.access: m2.M2, m2",
+                                 "Impl.java:1:62: compiler.err.not.def.access.package.cant.access: m2x.M2, m2x",
                                  "2 errors");
 
         if (!expected.equals(log)) {
--- a/test/tools/javac/modules/DoclintOtherModules.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/DoclintOtherModules.java	Fri Dec 16 05:47:58 2016 +0000
@@ -49,14 +49,14 @@
     @Test
     public void testSimple(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path m1 = src.resolve("m1");
-        Path m2 = src.resolve("m2");
+        Path m1 = src.resolve("m1x");
+        Path m2 = src.resolve("m2x");
         tb.writeJavaFiles(m1,
-                          "module m1 {}",
-                          "package m1; /** @see m2.B */ @Deprecated public class A {}");
+                          "module m1x {}",
+                          "package m1x; /** @see m2x.B */ @Deprecated public class A {}");
         tb.writeJavaFiles(m2,
-                          "module m2 { requires m1; exports m2; }",
-                          "package m2; public class B extends Foo {} @Deprecated class Foo {}");
+                          "module m2x { requires m1x; exports m2x; }",
+                          "package m2x; public class B extends Foo {} @Deprecated class Foo {}");
         Path classes = base.resolve("classes");
         Files.createDirectories(classes);
 
--- a/test/tools/javac/modules/DuplicateClassTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/DuplicateClassTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -37,7 +37,6 @@
 
 import toolbox.JavacTask;
 import toolbox.Task;
-import toolbox.ToolBox;
 
 public class DuplicateClassTest extends ModuleTestBase {
 
@@ -48,13 +47,13 @@
 
     @Test
     public void testSimple(Path base) throws Exception {
-        Path m1 = base.resolve("m1");
-        Path m2 = base.resolve("m2");
+        Path m1 = base.resolve("m1x");
+        Path m2 = base.resolve("m2x");
         tb.writeJavaFiles(m1,
-                          "module m1 { }",
+                          "module m1x { }",
                           "package impl; public class Impl { }");
         tb.writeJavaFiles(m2,
-                          "module m2 { }",
+                          "module m2x { }",
                           "package impl; public class Impl { }");
         Path classes = base.resolve("classes");
         Files.createDirectories(classes);
--- a/test/tools/javac/modules/EdgeCases.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/EdgeCases.java	Fri Dec 16 05:47:58 2016 +0000
@@ -97,9 +97,9 @@
         JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
         try (StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null)) {
             Path moduleSrc = base.resolve("module-src");
-            Path m1 = moduleSrc.resolve("m1");
+            Path m1 = moduleSrc.resolve("m1x");
 
-            tb.writeJavaFiles(m1, "module m1 { }");
+            tb.writeJavaFiles(m1, "module m1x { }");
 
             Iterable<? extends JavaFileObject> files = fm.getJavaFileObjects(findJavaFiles(moduleSrc));
             com.sun.source.util.JavacTask task =
@@ -107,7 +107,7 @@
 
             task.analyze();
 
-            ModuleSymbol msym = (ModuleSymbol) task.getElements().getModuleElement("m1");
+            ModuleSymbol msym = (ModuleSymbol) task.getElements().getModuleElement("m1x");
 
             msym.outermostClass();
         }
@@ -118,9 +118,9 @@
         JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
         try (StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null)) {
             Path moduleSrc = base.resolve("module-src");
-            Path m1 = moduleSrc.resolve("m1");
+            Path m1 = moduleSrc.resolve("m1x");
 
-            tb.writeJavaFiles(m1, "module m1 { }",
+            tb.writeJavaFiles(m1, "module m1x { }",
                                   "package p;",
                                   "package p; class T { }");
 
@@ -154,17 +154,17 @@
     @Test
     public void testModuleImplicitModuleBoundaries(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports api1; }",
+                          "module m1x { exports api1; }",
                           "package api1; public class Api1 { public void call() { } }");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { requires m1; exports api2; }",
+                          "module m2x { requires m1x; exports api2; }",
                           "package api2; public class Api2 { public static api1.Api1 get() { return null; } }");
-        Path src_m3 = src.resolve("m3");
+        Path src_m3 = src.resolve("m3x");
         tb.writeJavaFiles(src_m3,
-                          "module m3 { requires m2; }",
+                          "module m3x { requires m2x; }",
                           "package test; public class Test { { api2.Api2.get().call(); api2.Api2.get().toString(); } }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
@@ -214,13 +214,13 @@
           .run();
 
         Path src = base.resolve("src");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { requires a; exports api2; }",
+                          "module m2x { requires a; exports api2; }",
                           "package api2; public class Api2 { public static api1.Api1 get() { return null; } }");
-        Path src_m3 = src.resolve("m3");
+        Path src_m3 = src.resolve("m3x");
         tb.writeJavaFiles(src_m3,
-                          "module m3 { requires a; requires m2; }",
+                          "module m3x { requires a; requires m2x; }",
                           "package test; public class Test { { api2.Api2.get(); api1.Api1 a1; } }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
@@ -245,7 +245,7 @@
     @Test
     public void testEmptyImplicitModuleInfo(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         Files.createDirectories(src_m1);
         try (Writer w = Files.newBufferedWriter(src_m1.resolve("module-info.java"))) {}
         tb.writeJavaFiles(src_m1,
@@ -262,7 +262,7 @@
                 .writeAll();
 
         tb.writeJavaFiles(src_m1,
-                          "module m1 {}");
+                          "module m1x {}");
 
         new JavacTask(tb)
                 .options("--source-path", src_m1.toString())
@@ -276,16 +276,16 @@
     @Test
     public void testClassPackageClash(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { exports test.m1; }",
-                          "package test.m1;\n" +
+                          "module m1x { exports test.m1x; }",
+                          "package test.m1x;\n" +
                           "public class Test {}\n");
-        Path src_m2 = src.resolve("m2");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { requires m1; }",
+                          "module m2x { requires m1x; }",
                           "package test;\n" +
-                          "public class m1 {}\n");
+                          "public class m1x {}\n");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
@@ -299,7 +299,7 @@
                 .getOutputLines(Task.OutputKind.DIRECT);
 
         List<String> expected = Arrays.asList(
-            "m1.java:2:8: compiler.err.clash.with.pkg.of.same.name: kindname.class, test.m1",
+            "m1x.java:2:8: compiler.err.clash.with.pkg.of.same.name: kindname.class, test.m1x",
             "1 error"
         );
 
@@ -383,7 +383,7 @@
     @Test
     public void testModuleInfoNameMismatchSource(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path m1 = src.resolve("m1");
+        Path m1 = src.resolve("m1x");
         Files.createDirectories(m1);
         tb.writeJavaFiles(m1, "module other { }",
                               "package test; public class Test {}");
@@ -400,8 +400,8 @@
             .getOutputLines(OutputKind.DIRECT);
 
         List<String> expected = Arrays.asList(
-                "module-info.java:1:1: compiler.err.module.name.mismatch: other, m1",
-                "- compiler.err.cant.access: m1.module-info, (compiler.misc.cant.resolve.modules)",
+                "module-info.java:1:1: compiler.err.module.name.mismatch: other, m1x",
+                "- compiler.err.cant.access: m1x.module-info, (compiler.misc.cant.resolve.modules)",
                 "2 errors");
 
         if (!expected.equals(log)) {
@@ -416,7 +416,7 @@
         tb.writeJavaFiles(src, "module other { }",
                                "package test; public class Test {}");
         Path classes = base.resolve("classes");
-        Path m1Classes = classes.resolve("m1");
+        Path m1Classes = classes.resolve("m1x");
         tb.createDirectories(m1Classes);
 
         new JavacTask(tb)
@@ -428,7 +428,7 @@
 
         Path src2 = base.resolve("src2");
         Files.createDirectories(src2);
-        tb.writeJavaFiles(src2, "module use { requires m1; }");
+        tb.writeJavaFiles(src2, "module use { requires m1x; }");
 
         Path classes2 = base.resolve("classes2");
         tb.createDirectories(classes2);
@@ -443,7 +443,7 @@
             .getOutputLines(OutputKind.DIRECT);
 
         List<String> expected = Arrays.asList(
-                "- compiler.err.cant.access: m1.module-info, (compiler.misc.bad.class.file.header: module-info.class, (compiler.misc.module.name.mismatch: other, m1))",
+                "- compiler.err.cant.access: m1x.module-info, (compiler.misc.bad.class.file.header: module-info.class, (compiler.misc.module.name.mismatch: other, m1x))",
                 "1 error");
 
         if (!expected.equals(log)) {
--- a/test/tools/javac/modules/ExportsUnexported.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/ExportsUnexported.java	Fri Dec 16 05:47:58 2016 +0000
@@ -75,7 +75,7 @@
                 System.err.println("testing: " + test);
 
                 Path src = base.resolve("src");
-                Path src_m1 = src.resolve("m1");
+                Path src_m1 = src.resolve("m1x");
                 StringBuilder testCode = new StringBuilder();
                 List<String> expectedLog = new ArrayList<>();
                 int line = 1;
@@ -99,7 +99,9 @@
                             default:
                                 throw new AssertionError(typeName.toString());
                         }
-                        expectedLog.add("Api.java:" + line + ":" + col + ": compiler.warn.leaks.not.accessible.unexported: " + kindName + ", impl.impl." + typeName + ", m1");
+                        expectedLog.add("Api.java:" + line + ":" + col
+                                + ": compiler.warn.leaks.not.accessible.unexported: "
+                                + kindName + ", impl.impl." + typeName + ", m1x");
                         continue;
                     }
 
@@ -121,7 +123,7 @@
                 Collections.sort(expectedLog);
 
                 tb.writeJavaFiles(src_m1,
-                                  "module m1 { exports api; }",
+                                  "module m1x { exports api; }",
                                   testCode.toString(),
                                   "package impl.impl; public class Cls { }",
                                   "package impl.impl; public class Exc extends Exception { }",
@@ -155,22 +157,22 @@
     @Test
     public void testAccessibleToSpecificOrAll(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_lib1 = src.resolve("lib1");
+        Path src_lib1 = src.resolve("lib1x");
         tb.writeJavaFiles(src_lib1,
-                          "module lib1 { exports lib1; }",
+                          "module lib1x { exports lib1; }",
                           "package lib1; public class Lib1 {}");
-        Path src_lib2 = src.resolve("lib2");
+        Path src_lib2 = src.resolve("lib2x");
         tb.writeJavaFiles(src_lib2,
-                          "module lib2 { exports lib2; }",
+                          "module lib2x { exports lib2; }",
                           "package lib2; public class Lib2 {}");
         Path src_api = src.resolve("api");
         tb.writeJavaFiles(src_api,
                           "module api {\n" +
                           "    exports api;\n" +
-                          "    exports qapi1 to qual1;\n" +
-                          "    exports qapi2 to qual1, qual2;\n" +
-                          "    requires transitive lib1;\n" +
-                          "    requires lib2;\n" +
+                          "    exports qapi1 to qual1x;\n" +
+                          "    exports qapi2 to qual1x, qual2x;\n" +
+                          "    requires transitive lib1x;\n" +
+                          "    requires lib2x;\n" +
                           "}\n",
                           "package api;\n" +
                           "public class Api {\n" +
@@ -190,10 +192,10 @@
                           "package impl;\n" +
                           "public class Impl {\n" +
                           "}");
-        Path src_qual1 = src.resolve("qual1");
-        tb.writeJavaFiles(src_qual1, "module qual1 { }");
-        Path src_qual2 = src.resolve("qual2");
-        tb.writeJavaFiles(src_qual2, "module qual2 { }");
+        Path src_qual1 = src.resolve("qual1x");
+        tb.writeJavaFiles(src_qual1, "module qual1x { }");
+        Path src_qual2 = src.resolve("qual2x");
+        tb.writeJavaFiles(src_qual2, "module qual2x { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
@@ -209,7 +211,7 @@
                 .getOutputLines(Task.OutputKind.DIRECT);
 
         List<String> expected = Arrays.asList(
-            "Api.java:4:16: compiler.warn.leaks.not.accessible.not.required.transitive: kindname.class, lib2.Lib2, lib2",
+            "Api.java:4:16: compiler.warn.leaks.not.accessible.not.required.transitive: kindname.class, lib2.Lib2, lib2x",
             "Api.java:5:17: compiler.warn.leaks.not.accessible.unexported.qualified: kindname.class, qapi1.QApi1, api",
             "Api.java:6:16: compiler.warn.leaks.not.accessible.unexported: kindname.class, impl.Impl, api",
             "- compiler.err.warnings.and.werror",
--- a/test/tools/javac/modules/GetLocationForModuleTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/GetLocationForModuleTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -48,10 +48,10 @@
     public void run(Path base) throws Exception {
         // Set up some trivial modules
         Path moduleSrc = base.resolve("module-src");
-        Path m1 = moduleSrc.resolve("m1");
-        tb.writeJavaFiles(m1, "module m1 { }");
-        Path m2 = moduleSrc.resolve("m2");
-        tb.writeJavaFiles(m2, "module m2 { }");
+        Path m1 = moduleSrc.resolve("m1x");
+        tb.writeJavaFiles(m1, "module m1x { }");
+        Path m2 = moduleSrc.resolve("m2x");
+        tb.writeJavaFiles(m2, "module m2x { }");
 
         Path modulePath = base.resolve("module-path");
         Files.createDirectories(modulePath);
@@ -69,7 +69,7 @@
 
         // Test
         test(fm, StandardLocation.SYSTEM_MODULES, "java.base", "java.compiler");
-        test(fm, StandardLocation.MODULE_PATH, "m1", "m2");
+        test(fm, StandardLocation.MODULE_PATH, "m1x", "m2x");
     }
 
     void test(JavaFileManager fm, JavaFileManager.Location locn, String... mods) throws IOException {
--- a/test/tools/javac/modules/HelloWorldTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/HelloWorldTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -123,9 +123,9 @@
     @Test
     public void testModuleSourcePath(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
-        tb.writeFile(src_m1.resolve("module-info.java"), "module m1 { }");
-        tb.writeJavaFiles(src_m1, PKG_HELLO_WORLD);
+        Path src_m = src.resolve("m");
+        tb.writeFile(src_m.resolve("module-info.java"), "module m { }");
+        tb.writeJavaFiles(src_m, PKG_HELLO_WORLD);
 
         Path classes = base.resolve("classes");
         Files.createDirectories(classes);
@@ -133,13 +133,13 @@
         new JavacTask(tb)
             .options("--module-source-path", src.toString())
             .outdir(classes)
-            .files(src_m1.resolve("p/HelloWorld.java"))
+            .files(src_m.resolve("p/HelloWorld.java"))
             .run()
             .writeAll();
 
         checkFiles(
-            classes.resolve("m1/module-info.class"),
-            classes.resolve("m1/p/HelloWorld.class"));
+            classes.resolve("m/module-info.class"),
+            classes.resolve("m/p/HelloWorld.class"));
     }
 
     void checkFiles(Path... files) throws Exception {
--- a/test/tools/javac/modules/LimitModulesTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/LimitModulesTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -36,7 +36,6 @@
 
 import toolbox.JavacTask;
 import toolbox.Task;
-import toolbox.ToolBox;
 
 public class LimitModulesTest extends ModuleTestBase {
     public static void main(String... args) throws Exception {
@@ -78,18 +77,18 @@
     @Test
     public void testEmptyItem(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
+        Path src_m1 = src.resolve("m1x");
         tb.writeJavaFiles(src_m1,
-                          "module m1 { }");
-        Path src_m2 = src.resolve("m2");
+                          "module m1x { }");
+        Path src_m2 = src.resolve("m2x");
         tb.writeJavaFiles(src_m2,
-                          "module m2 { }");
+                          "module m2x { }");
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--limit-modules", ",m1")
+                         "--limit-modules", ",m1x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -97,7 +96,7 @@
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--limit-modules", "m1,,m2")
+                         "--limit-modules", "m1x,,m2x")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
@@ -105,7 +104,7 @@
 
         new JavacTask(tb)
                 .options("--module-source-path", src.toString(),
-                         "--limit-modules", "m1,")
+                         "--limit-modules", "m1x,")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run()
--- a/test/tools/javac/modules/MOptionTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/MOptionTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -49,21 +49,21 @@
     @Test
     public void testOneModule(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path m1 = src.resolve("m1");
+        Path m1 = src.resolve("m1x");
         Path build = base.resolve("build");
         Files.createDirectories(build);
 
         tb.writeJavaFiles(m1,
-                "module m1 {}",
+                "module m1x {}",
                 "package test; public class Test {}");
 
         new JavacTask(tb)
-                .options("-m", "m1", "--module-source-path", src.toString(), "-d", build.toString())
+                .options("-m", "m1x", "--module-source-path", src.toString(), "-d", build.toString())
                 .run(Task.Expect.SUCCESS)
                 .writeAll();
 
-        Path moduleInfoClass = build.resolve("m1/module-info.class");
-        Path testTestClass = build.resolve("m1/test/Test.class");
+        Path moduleInfoClass = build.resolve("m1x/module-info.class");
+        Path testTestClass = build.resolve("m1x/test/Test.class");
 
         FileTime moduleInfoTimeStamp = Files.getLastModifiedTime(moduleInfoClass);
         FileTime testTestTimeStamp = Files.getLastModifiedTime(testTestClass);
@@ -81,7 +81,7 @@
         Thread.sleep(2000); //timestamps
 
         new JavacTask(tb)
-                .options("-m", "m1", "--module-source-path", src.toString(), "-d", build.toString())
+                .options("-m", "m1x", "--module-source-path", src.toString(), "-d", build.toString())
                 .run(Task.Expect.SUCCESS)
                 .writeAll();
 
@@ -98,7 +98,7 @@
         Files.setLastModifiedTime(testTest, FileTime.fromMillis(System.currentTimeMillis()));
 
         new JavacTask(tb)
-                .options("-m", "m1", "--module-source-path", src.toString(), "-d", build.toString())
+                .options("-m", "m1x", "--module-source-path", src.toString(), "-d", build.toString())
                 .run(Task.Expect.SUCCESS)
                 .writeAll();
 
@@ -114,17 +114,17 @@
     @Test
     public void testNoOutputDir(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path m1 = src.resolve("m1");
+        Path m1 = src.resolve("m1x");
         Path build = base.resolve("build");
         Files.createDirectories(build);
 
         tb.writeJavaFiles(m1,
-                "module m1 {}",
+                "module m1x {}",
                 "package test; public class Test {}");
 
         String log = new JavacTask(tb)
                 .options("-XDrawDiagnostics",
-                    "-m", "m1",
+                    "-m", "m1x",
                     "--module-source-path", src.toString())
                 .run(Task.Expect.FAIL)
                 .writeAll()
@@ -137,17 +137,17 @@
     @Test
     public void testNoModuleSourcePath(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path m1 = src.resolve("m1");
+        Path m1 = src.resolve("m1x");
         Path build = base.resolve("build");
         Files.createDirectories(build);
 
         tb.writeJavaFiles(m1,
-                "module m1 {}",
+                "module m1x {}",
                 "package test; public class Test {}");
 
         String log = new JavacTask(tb)
                 .options("-XDrawDiagnostics",
-                        "-m", "m1",
+                        "-m", "m1x",
                         "-d", build.toString())
                 .run(Task.Expect.FAIL)
                 .writeAll()
@@ -160,29 +160,29 @@
     @Test
     public void testMultiModule(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path m1 = src.resolve("m1");
-        Path m2 = src.resolve("m2");
+        Path m1 = src.resolve("m1x");
+        Path m2 = src.resolve("m2x");
         Path build = base.resolve("build");
         Files.createDirectories(build);
 
         tb.writeJavaFiles(m1,
-                "module m1 {}",
+                "module m1x {}",
                 "package p1; public class C1 {}");
 
         tb.writeJavaFiles(m2,
-                "module m2 {}",
+                "module m2x {}",
                 "package p2; public class C2 {}");
 
         new JavacTask(tb)
-                .options("-m", "m1,m2", "--module-source-path", src.toString(), "-d", build.toString())
+                .options("-m", "m1x,m2x", "--module-source-path", src.toString(), "-d", build.toString())
                 .run(Task.Expect.SUCCESS)
                 .writeAll();
 
-        Path m1ModuleInfoClass = build.resolve("m1/module-info.class");
-        Path classC1 = build.resolve("m1/p1/C1.class");
+        Path m1ModuleInfoClass = build.resolve("m1x/module-info.class");
+        Path classC1 = build.resolve("m1x/p1/C1.class");
 
-        Path m2ModuleInfoClass = build.resolve("m2/module-info.class");
-        Path classC2 = build.resolve("m2/p2/C2.class");
+        Path m2ModuleInfoClass = build.resolve("m2x/module-info.class");
+        Path classC2 = build.resolve("m2x/p2/C2.class");
 
         FileTime m1ModuleInfoTimeStamp = Files.getLastModifiedTime(m1ModuleInfoClass);
         FileTime C1TimeStamp = Files.getLastModifiedTime(classC1);
@@ -215,7 +215,7 @@
         Thread.sleep(2000); //timestamps
 
         new JavacTask(tb)
-                .options("-m", "m1,m2", "--module-source-path", src.toString(), "-d", build.toString())
+                .options("-m", "m1x,m2x", "--module-source-path", src.toString(), "-d", build.toString())
                 .run(Task.Expect.SUCCESS)
                 .writeAll();
 
@@ -241,7 +241,7 @@
         Files.setLastModifiedTime(C2Source, FileTime.fromMillis(System.currentTimeMillis()));
 
         new JavacTask(tb)
-                .options("-m", "m1,m2", "--module-source-path", src.toString(), "-d", build.toString())
+                .options("-m", "m1x,m2x", "--module-source-path", src.toString(), "-d", build.toString())
                 .run(Task.Expect.SUCCESS)
                 .writeAll();
 
--- a/test/tools/javac/modules/ModuleFinderTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/ModuleFinderTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -38,7 +38,6 @@
 import toolbox.JarTask;
 import toolbox.JavacTask;
 import toolbox.Task;
-import toolbox.ToolBox;
 
 public class ModuleFinderTest extends ModuleTestBase {
 
@@ -50,7 +49,7 @@
     @Test
     public void testDuplicateModulesOnPath(Path base) throws Exception {
         Path src = base.resolve("src");
-        tb.writeJavaFiles(src, "module m1 { }");
+        tb.writeJavaFiles(src, "module m1x { }");
 
         Path classes = base.resolve("classes");
         Files.createDirectories(classes);
@@ -63,18 +62,18 @@
                 .run()
                 .writeAll();
 
-        new JarTask(tb, modules.resolve("m1-1.jar"))
+        new JarTask(tb, modules.resolve("m1x-1.jar"))
                 .baseDir(classes)
                 .files(".")
                 .run();
 
-        new JarTask(tb, modules.resolve("m1-2.jar"))
+        new JarTask(tb, modules.resolve("m1x-2.jar"))
                 .baseDir(classes)
                 .files(".")
                 .run();
 
         Path src2 = base.resolve("src2");
-        tb.writeJavaFiles(src2, "module m2 { requires m1; }");
+        tb.writeJavaFiles(src2, "module m2x { requires m1x; }");
 
 
         String log = new JavacTask(tb, Task.Mode.CMDLINE)
@@ -85,7 +84,7 @@
                 .writeAll()
                 .getOutput(Task.OutputKind.DIRECT);
 
-        if (!log.contains("- compiler.err.duplicate.module.on.path: (compiler.misc.locn.module_path), m1"))
+        if (!log.contains("- compiler.err.duplicate.module.on.path: (compiler.misc.locn.module_path), m1x"))
             throw new Exception("expected output not found");
     }
 }
--- a/test/tools/javac/modules/ModuleInfoTest.java	Wed Dec 14 20:23:26 2016 +0000
+++ b/test/tools/javac/modules/ModuleInfoTest.java	Fri Dec 16 05:47:58 2016 +0000
@@ -34,14 +34,12 @@
  * @run main ModuleInfoTest
  */
 
-import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.Arrays;
 
 import toolbox.JavacTask;
 import toolbox.Task;
-import toolbox.ToolBox;
 
 public class ModuleInfoTest extends ModuleTestBase {
 
@@ -137,21 +135,129 @@
     }
 
     /**
-     * Verify that missing exports are reported.
+     * Verify that missing exports targets are reported.
      */
     @Test
     public void testExportsNotFound(Path base) throws Exception {
         Path src = base.resolve("src");
-        tb.writeJavaFiles(src, "module M1 { exports p to M2; }");
+        tb.writeJavaFiles(src,
+                          "module M { exports p to N; }",
+                          "package p; public class C {}");
         String log = new JavacTask(tb)
-                .options("-XDrawDiagnostics")
+                .options("-XDrawDiagnostics",
+                         "-Xlint:module")
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:25: compiler.warn.module.not.found: N"))
+            throw new Exception("expected output not found, actual output: " + log);
+    }
+
+    /**
+     * Verify that duplicated qualified missing exports targets are reported.
+     */
+    @Test
+    public void testExportsNotFoundDuplicated(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module M { exports p to N, N; }",
+                          "package p; public class C {}");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "-Xlint:module")
                 .files(findJavaFiles(src))
                 .run(Task.Expect.FAIL)
                 .writeAll()
                 .getOutput(Task.OutputKind.DIRECT);
 
-        if (!log.contains("module-info.java:1:26: compiler.err.module.not.found: M2"))
-            throw new Exception("expected output not found");
+        if (!log.contains("module-info.java:1:28: compiler.err.conflicting.exports.to.module: N"))
+            throw new Exception("expected output not found, actual output: " + log);
+    }
+
+    /**
+     * Verify that missing exports target warning can be suppressed.
+     */
+    @Test
+    public void testExportsNotFoundSuppress(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "@SuppressWarnings(\"module\") module M { exports p to N; }",
+                          "package p; public class C {}");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "-Xlint:module")
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.isEmpty())
+            throw new Exception("expected output not found, actual output: " + log);
+    }
+
+    /**
+     * Verify that missing opens targets are reported.
+     */
+    @Test
+    public void testOpensNotFound(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module M { opens p to N; }",
+                          "package p; public class C {}");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "-Xlint:module")
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:23: compiler.warn.module.not.found: N"))
+            throw new Exception("expected output not found, actual output: " + log);
+    }
+
+    /**
+     * Verify that duplicated qualified missing opens targets are reported.
+     */
+    @Test
+    public void testOpensNotFoundDuplicated(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module M { opens p to N, N; }",
+                          "package p; public class C {}");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "-Xlint:module")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:26: compiler.err.conflicting.opens.to.module: N"))
+            throw new Exception("expected output not found, actual output: " + log);
+    }
+
+    /**
+     * Verify that missing opens target warning can be suppressed.
+     */
+    @Test
+    public void testOpensNotFoundSuppress(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "@SuppressWarnings(\"module\") module M { opens p to N; }",
+                          "package p; public class C {}");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "-Xlint:module")
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.isEmpty())
+            throw new Exception("expected output not found, actual output: " + log);
     }
 
     /**
@@ -178,12 +284,12 @@
     @Test
     public void testRequiresLoop(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
-        tb.writeFile(src_m1.resolve("module-info.java"), "module m1 { requires m2; }");
-        Path src_m2 = src.resolve("m2");
-        tb.writeFile(src_m2.resolve("module-info.java"), "module m2 { requires m3; }");
-        Path src_m3 = src.resolve("m3");
-        tb.writeFile(src_m3.resolve("module-info.java"), "module m3 { requires m1; }");
+        Path src_m1 = src.resolve("m1x");
+        tb.writeFile(src_m1.resolve("module-info.java"), "module m1x { requires m2x; }");
+        Path src_m2 = src.resolve("m2x");
+        tb.writeFile(src_m2.resolve("module-info.java"), "module m2x { requires m3x; }");
+        Path src_m3 = src.resolve("m3x");
+        tb.writeFile(src_m3.resolve("module-info.java"), "module m3x { requires m1x; }");
 
         Path classes = base.resolve("classes");
         Files.createDirectories(classes);
@@ -196,7 +302,7 @@
                 .writeAll()
                 .getOutput(Task.OutputKind.DIRECT);
 
-        if (!log.contains("module-info.java:1:22: compiler.err.cyclic.requires: m3"))
+        if (!log.contains("module-info.java:1:23: compiler.err.cyclic.requires: m3x"))
             throw new Exception("expected output not found");
     }
 
@@ -206,12 +312,12 @@
     @Test
     public void testRequiresTransitiveLoop(Path base) throws Exception {
         Path src = base.resolve("src");
-        Path src_m1 = src.resolve("m1");
-        tb.writeFile(src_m1.resolve("module-info.java"), "module m1 { requires m2; }");
-        Path src_m2 = src.resolve("m2");
-        tb.writeFile(src_m2.resolve("module-info.java"), "module m2 { requires transitive m3; }");
-        Path src_m3 = src.resolve("m3");
-        tb.writeFile(src_m3.resolve("module-info.java"), "module m3 { requires m1; }");
+        Path src_m1 = src.resolve("m1x");
+        tb.writeFile(src_m1.resolve("module-info.java"), "module m1x { requires m2x; }");
+        Path src_m2 = src.resolve("m2x");