[jdk17u-dev] RFR: 8336942: Improve test coverage for class loading elements with annotations of different retentions [v2]

Liam Miller-Cushon cushon at openjdk.org
Sat Nov 9 01:13:59 UTC 2024


On Thu, 7 Nov 2024 19:13:04 GMT, Thomas Fitzsimmons <duke at openjdk.org> wrote:

>> Liam Miller-Cushon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>> 
>>  - Merge remote-tracking branch 'origin/master' into backport-JDK-8336942
>>  - 8336942: Improve test coverage for class loading elements with annotations of different retentions
>>    
>>    Reviewed-by: vromero
>
> _I am not a Reviewer; I maintain `java-17-openjdk` in `RHEL` so I try to review `rfr`-labelled pull requests for `jdk17u-dev`, time-permitting._
> 
> This looks like a good change to have in 17.  I tested it on `Fedora 41 x86_64`.
> 
> While trying this out, I noticed a potential oddity regarding `BasicAnnoTests.java`: the first of the two `Test` annotations does not seem to take effect.  For example, I would expect that changing:
> 
> `@Test(posn=0, annoType=TA.class, expect="1")`
> 
> to:
> 
> `@Test(posn=0, annoType=TA.class, expect="33")`
> 
> would cause a failure, but it does not.  Am I missing something?
> 
> I am testing with jtreg `857ed6167418cb4ebe2844fd536461a1649bdced` running on `jdk-17.0.13+11`.

@fitzsim I tried with jtreg `857ed6167418cb4ebe2844fd536461a1649bdced` and `17.0.13+11` and I can reproduce a test failure with that change. Could you double-check you're still unable to reproduce that failure?


diff --git a/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java b/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java
index d4540107022..e22c3d132b9 100644
--- a/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java
+++ b/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java
@@ -423,7 +423,7 @@ public class BasicAnnoTests extends JavacTestingAbstractProcessor {
     //             vary position of one annotated
     //       the three above with the corner case of the ambiguos decl + type anno added

-    @Test(posn=0, annoType=TA.class, expect="1")
+    @Test(posn=0, annoType=TA.class, expect="33")
     public @TA(1) int f1;

     @Test(posn=0, annoType=TA.class, expect="11")



make test TEST="jtreg:test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java"
...
./src/jdk17u-dev/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java:427: error: Unexpected value: 1, expected: 33
    public @TA(1) int f1;
                      ^
1 error

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

PR Comment: https://git.openjdk.org/jdk17u-dev/pull/2955#issuecomment-2465960160


More information about the jdk-updates-dev mailing list