8167314: Enable the check to detect duplicate provides in in GenModuleInfoSource

Reviewed-by: lancea
This commit is contained in:
Mandy Chung 2018-08-22 13:47:47 -05:00
parent 6f880d7f48
commit 8a10925316
2 changed files with 5 additions and 3 deletions

View File

@ -431,14 +431,12 @@ public class GenModuleInfoSource {
}
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)) {

View File

@ -230,7 +230,11 @@ public class ModuleInfoExtraTest {
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() {