From eec271d76dccfffb5aedb96025cea9b01e159b3c Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 17 Jul 2013 14:12:38 -0700 Subject: [PATCH] Groovy compiler doesn't seem to put the enclosing class information in the class file. --- .../main/java/org/jvnet/hudson/test/TestExtensionLoader.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/src/main/java/org/jvnet/hudson/test/TestExtensionLoader.java b/test/src/main/java/org/jvnet/hudson/test/TestExtensionLoader.java index 356dfca0e9..b242fc7b78 100644 --- a/test/src/main/java/org/jvnet/hudson/test/TestExtensionLoader.java +++ b/test/src/main/java/org/jvnet/hudson/test/TestExtensionLoader.java @@ -72,6 +72,11 @@ public class TestExtensionLoader extends GuiceExtensionAnnotation return true; // enclosed } } + + // Groovy compiler doesn't seem to put the enclosing class information in the class file, + // so this fallback rule would catch those cases. + if (((Class)e).getName().startsWith(className+"$")) + return true; return false; } if (e instanceof Field) {