You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2026/03/02 17:35:41 UTC
(groovy) 01/04: GROOVY-11831, GROOVY-11838: fix test case
This is an automated email from the ASF dual-hosted git repository.
emilles pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 36ad88184611db8ba42f75838499de30dd6eb4ad
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Mon Mar 2 10:18:14 2026 -0600
GROOVY-11831, GROOVY-11838: fix test case
---
.../groovy/classgen/ExtendedVerifierTest.groovy | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/test/groovy/org/codehaus/groovy/classgen/ExtendedVerifierTest.groovy b/src/test/groovy/org/codehaus/groovy/classgen/ExtendedVerifierTest.groovy
index 82858c52aa..9e7183dc21 100644
--- a/src/test/groovy/org/codehaus/groovy/classgen/ExtendedVerifierTest.groovy
+++ b/src/test/groovy/org/codehaus/groovy/classgen/ExtendedVerifierTest.groovy
@@ -20,23 +20,28 @@ package org.codehaus.groovy.classgen
import org.codehaus.groovy.ast.ClassHelper
import org.codehaus.groovy.ast.ClassNode
-import org.codehaus.groovy.ast.MethodNode
import org.codehaus.groovy.ast.Parameter
import org.codehaus.groovy.control.SourceUnit
import org.junit.jupiter.api.Test
-import static org.codehaus.groovy.ast.ClassHelper.OBJECT_TYPE
+import java.lang.annotation.ElementType
+import java.lang.annotation.Target
+
import static org.codehaus.groovy.ast.tools.GeneralUtils.block
-import static org.objectweb.asm.Opcodes.ACC_PUBLIC
final class ExtendedVerifierTest {
+ @Target(ElementType.TYPE_USE)
+ public @interface TypeAnno {}
+
@Test
void testNoTypeUseAnnotationsForVoidMethod() {
- ClassNode cn = new ClassNode('DummyClass', ACC_PUBLIC, OBJECT_TYPE)
- MethodNode mn = cn.addMethod("dummyMethod", ACC_PUBLIC, ClassHelper.VOID_TYPE, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, block())
- mn.addAnnotation(ClassHelper.makeWithoutCaching('groovy.lang.Grapes'))
- new ExtendedVerifier(new SourceUnit((String)'dummySU', null, null, null, null)).visitClass(cn)
+ def cn = new ClassNode('DummyClass', 0, ClassHelper.OBJECT_TYPE)
+ def mn = cn.addMethod('dummyMethod', 0, ClassHelper.VOID_TYPE, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, block())
+ mn.addAnnotation(ClassHelper.make(TypeAnno))
+
+ new ExtendedVerifier(new SourceUnit('dummySU', null, null, null, null)).visitClass(cn)
+
assert mn.returnType.annotations.isEmpty()
}
}