8167314: Enable the check to detect duplicate provides in in GenModuleInfoSource
authormchung
Wed, 22 Aug 2018 13:47:47 -0500
changeset 51499 fdd768b9865e
parent 51498 9a5200b84046
child 51500 63b3d7989fde
8167314: Enable the check to detect duplicate provides in in GenModuleInfoSource Reviewed-by: lancea
make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java
make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java
--- a/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java	Wed Aug 22 20:37:07 2018 +0200
+++ b/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java	Wed Aug 22 13:47:47 2018 -0500
@@ -431,14 +431,12 @@
                             }
                             uses.put(name, statement);
                             break;
-                        /*  Disable this check until jdk.internal.vm.compiler generated file is fixed.
                         case "provides":
                             if (provides.containsKey(name)) {
                                 throw parser.newError("multiple " + keyword + " " + name);
                             }
                             provides.put(name, statement);
                             break;
-                        */
                     }
                     String lookAhead = lookAhead(parser);
                     if (lookAhead.equals(statement.qualifier)) {
--- a/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java	Wed Aug 22 20:37:07 2018 +0200
+++ b/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java	Wed Aug 22 13:47:47 2018 -0500
@@ -230,7 +230,11 @@
             new String[] {
                 "   uses s;",
                 "   uses s;"
-            },                      ".*, line .*, multiple uses s.*"
+            },                      ".*, line .*, multiple uses s.*",
+            new String[] {
+                "   provides s with impl1;",
+                "   provides s with impl2, impl3;"
+            },                      ".*, line .*, multiple provides s.*"
     );
 
     void errorCases() {