-
Bug
-
Resolution: Fixed
-
P4
-
11, 17, 21, 24, 25
-
b04
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8349768 | 24.0.2 | Sendao Yan | P4 | Resolved | Fixed | master |
JDK-8349996 | 21.0.7 | Sendao Yan | P4 | Resolved | Fixed | b03 |
JDK-8349997 | 17.0.15 | Sendao Yan | P4 | Resolved | Fixed | b03 |
BasicAnnoTests uses @Test annotations for test cases, which a 'posn' representation the expected location of an annotation to check for. Some tests have multiple @Test annotations with the same position:
@Test(posn=0, annoType = TA.class, expect = "70")
@Test(posn=0, annoType = TB.class, expect = "71")
@TA(70) @TB(71) String f;
The tests creates a map indexed by posn, so if multiple annotations have the same posn only one of them is processed: https://github.com/openjdk/jdk/blame/325a2c3f76a45248e6f8baa63477db15e55be705/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java#L174-L177
The following change should cause the test to fail, but doesn't, because the modified @Test annotation is not being processed due to this bug:
$ diff --git a/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java b/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java
index 904e4e78cad..01206faeb6d 100644
--- a/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java
+++ b/test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java
@@ -697,7 +697,7 @@ class Inner8<@TA(50) T> {
<T> void m60(@TA(60) @TB(61) String t) { }
class Inner70<T> {
- @Test(posn=0, annoType = TA.class, expect = "70")
+ @Test(posn=0, annoType = TA.class, expect = "99")
@Test(posn=0, annoType = TB.class, expect = "71")
@TA(70) @TB(71) String f;
}
$ make test TEST="jtreg:test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java"
...
Passed: tools/javac/processing/model/type/BasicAnnoTests.java
- backported by
-
JDK-8349768 BasicAnnoTests doesn't handle multiple annotations at the same position
-
- Resolved
-
-
JDK-8349996 BasicAnnoTests doesn't handle multiple annotations at the same position
-
- Resolved
-
-
JDK-8349997 BasicAnnoTests doesn't handle multiple annotations at the same position
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk17u-dev/9eb9ce44
-
Commit(master) openjdk/jdk21u-dev/37ad92f3
-
Commit(master) openjdk/jdk24u/46b39279
-
Commit(master) openjdk/jdk/d562d3c7
-
Review(jdk24) openjdk/jdk/22875
-
Review(master) openjdk/jdk17u-dev/3158
-
Review(master) openjdk/jdk17u-dev/3272
-
Review(master) openjdk/jdk21u-dev/1276
-
Review(master) openjdk/jdk21u-dev/1393
-
Review(master) openjdk/jdk24u/63
-
Review(master) openjdk/jdk/21998