On Sun, 1 Mar 2026 22:36:37 GMT, Chen Liang <[email protected]> wrote:

>> Remove the use of TestNG from java/lang/annotation tests.
>> Interesting that JUnit scans annotations on member classes, so we can't put 
>> malformed annotations on classes nested in the test class; we can put them 
>> on package-private classes in the same source file instead.
>> Also refactored LoaderLeakTest to perform GC more reliably within our test 
>> framework.
>
> Chen Liang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Update 
> test/jdk/java/lang/annotation/typeAnnotations/TestExecutableGetAnnotatedType.java
>   
>   Co-authored-by: Andrey Turbanov <[email protected]>

As someone who has recently gone through this exercise what you have here looks 
good to me. I'm not a typical reviewer for this area though, so I will let a a 
java.lang Reviewer approve.

test/jdk/java/lang/annotation/AnnotationWithLambda.java line 38:

> 36: import java.util.function.Consumer;
> 37: 
> 38: import static org.junit.jupiter.api.Assertions.*;

nit: consider moving this line after line 39?

test/jdk/java/lang/annotation/TypeVariableBounds.java line 38:

> 36: import java.util.List;
> 37: import java.util.Set;
> 38: import static org.junit.jupiter.api.Assertions.*;

nit: move after line 40?

test/jdk/java/lang/annotation/typeAnnotations/BadCPIndex.java line 69:

> 67:             System.out.println("Testing: " + c);
> 68:             testCase.trigger.apply(c);
> 69:             throw new RuntimeException("Expecting AnnotationFormatError 
> here");

Interesting. This `RuntimeException` would have been ignored previously, but 
now if the expected `AnnotationFormatError` is not thrown the test will fail.

I guess that was a test bug.

test/jdk/java/lang/annotation/typeAnnotations/ConstructorReceiverTest.java line 
34:

> 32: import java.lang.annotation.*;
> 33: import java.lang.reflect.*;
> 34: import static org.junit.jupiter.api.Assertions.*;

nit: consider moving the import static after line 36?

test/jdk/java/lang/annotation/typeAnnotations/TestExecutableGetAnnotatedType.java
 line 40:

> 38: import java.util.stream.Stream;
> 39: 
> 40: import static org.junit.jupiter.api.Assertions.*;

nit: consider moving the import static after line 42?

-------------

PR Review: https://git.openjdk.org/jdk/pull/29921#pullrequestreview-3883930521
PR Review Comment: https://git.openjdk.org/jdk/pull/29921#discussion_r2879509440
PR Review Comment: https://git.openjdk.org/jdk/pull/29921#discussion_r2879519617
PR Review Comment: https://git.openjdk.org/jdk/pull/29921#discussion_r2879469257
PR Review Comment: https://git.openjdk.org/jdk/pull/29921#discussion_r2879474388
PR Review Comment: https://git.openjdk.org/jdk/pull/29921#discussion_r2879482597

Reply via email to