From 22ad87622e0c03bb7327124ba472cac20b6203c4 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Thu, 24 Oct 2024 15:12:42 -0400 Subject: [PATCH 1/2] GROOVY-11508: change exception to detailed warning --- src/main/java/org/codehaus/groovy/classgen/Verifier.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/codehaus/groovy/classgen/Verifier.java b/src/main/java/org/codehaus/groovy/classgen/Verifier.java index 248bec3c985..0d7cf6a5f72 100644 --- a/src/main/java/org/codehaus/groovy/classgen/Verifier.java +++ b/src/main/java/org/codehaus/groovy/classgen/Verifier.java @@ -86,6 +86,7 @@ import java.util.ListIterator; import java.util.Map; import java.util.Set; +import java.util.logging.Logger; import static java.lang.reflect.Modifier.isFinal; import static java.lang.reflect.Modifier.isPrivate; @@ -149,6 +150,8 @@ */ public class Verifier implements GroovyClassVisitor, Opcodes { + private static final Logger LOG = Logger.getLogger(Verifier.class.getName()); + public static final String SWAP_INIT = "__$swapInit"; public static final String STATIC_METACLASS_BOOL = "__$stMC"; public static final String INITIAL_EXPRESSION = "INITIAL_EXPRESSION"; @@ -364,9 +367,9 @@ private static void checkForDuplicateInterfaces(final ClassNode cn) { if (t.equals(in)) { String one = in.toString(false), two = t.toString(false); if (!one.equals(two)) - throw new RuntimeParserException("The interface " + in.getNameWithoutPackage() + - " cannot be implemented more than once with different arguments: " + one + " and " + two, cn); - break; + LOG.warning("Warning: " + " on " + cn.getName() + " the interface " + in.getNameWithoutPackage() + + " was implemented more than once with different arguments: " + one + " and " + two + ", " + + cn.getName() + " will only implement the lowest level " + in.getNameWithoutPackage()); } } } From 246146c147a56013d8f84509408c41f6857730bd Mon Sep 17 00:00:00 2001 From: James Fredley Date: Thu, 24 Oct 2024 15:17:30 -0400 Subject: [PATCH 2/2] remove extra space --- src/main/java/org/codehaus/groovy/classgen/Verifier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/codehaus/groovy/classgen/Verifier.java b/src/main/java/org/codehaus/groovy/classgen/Verifier.java index 0d7cf6a5f72..671f8a270ea 100644 --- a/src/main/java/org/codehaus/groovy/classgen/Verifier.java +++ b/src/main/java/org/codehaus/groovy/classgen/Verifier.java @@ -367,7 +367,7 @@ private static void checkForDuplicateInterfaces(final ClassNode cn) { if (t.equals(in)) { String one = in.toString(false), two = t.toString(false); if (!one.equals(two)) - LOG.warning("Warning: " + " on " + cn.getName() + " the interface " + in.getNameWithoutPackage() + + LOG.warning("Warning: " + "on " + cn.getName() + " the interface " + in.getNameWithoutPackage() + " was implemented more than once with different arguments: " + one + " and " + two + ", " + cn.getName() + " will only implement the lowest level " + in.getNameWithoutPackage()); }