From 8a10925316d81efcd62e3b55234198839b0674f7 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Wed, 22 Aug 2018 13:47:47 -0500 Subject: [PATCH] 8167314: Enable the check to detect duplicate provides in in GenModuleInfoSource Reviewed-by: lancea --- .../src/classes/build/tools/module/GenModuleInfoSource.java | 2 -- .../src/classes/build/tools/module/ModuleInfoExtraTest.java | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java b/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java index 478a90811b5..5189c995d53 100644 --- a/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java +++ b/make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java @@ -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)) { diff --git a/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java b/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java index 5f15a20bb58..f9a09ef3f3b 100644 --- a/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java +++ b/make/jdk/src/classes/build/tools/module/ModuleInfoExtraTest.java @@ -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() {