8167314: Enable the check to detect duplicate provides in in GenModuleInfoSource
Reviewed-by: lancea
--- 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() {