JDK-8336942 : Improve test coverage for class loading elements with annotations of different retentions
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-07-22
  • Updated: 2025-01-09
  • Resolved: 2024-09-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 21 JDK 23 JDK 24
17.0.15Fixed 21.0.7-oracleFixed 23.0.2Fixed 24 b18Fixed
Related Reports
Relates :  
Description
This change covers adding some additional test coverage for type use annotations read from class files.

When completing elements from class files, annotations with runtime visible and -invisible retention are read from different attributes, and then completed separately in ClassReader by different 'TypeAnnotationCompleter's.

The changes in JDK-8225377 to attach type annotations read from bytecode to their corresponding type included some logic for this, which would benefit from more test coverage:

https://github.com/openjdk/jdk/blob/aabec4a947ed2a808a1443fa6b2dabedd8c2dd9f/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2584-L2591
Comments
[jdk17u-fix-request] Approval Request from Liam Miller-Cushon This change improves annotation processing test coverage. I resolved a trivial merge conflict with JDK-8323684. The modified test passes.
08-01-2025

[jdk21u-fix-request] Approval Request from Liam Miller-Cushon This change improves annotation processing test coverage. I resolved a trivial merge conflict with JDK-8323684, which added the nameToAnnotation map. The modified test passes.
05-11-2024

[jdk23u-fix-request] Approval Request from Shivangi Gupta Straight Backport. Test passed. Good to backport as it is increasing test coverage
29-10-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk23u/pull/210 Date: 2024-10-29 08:48:26 +0000
29-10-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/1037 Date: 2024-10-08 17:58:21 +0000
08-10-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/2955 Date: 2024-10-08 17:58:20 +0000
08-10-2024

Changeset: e36ce5f0 Branch: master Author: Liam Miller-Cushon <cushon@openjdk.org> Date: 2024-09-26 15:11:03 +0000 URL: https://git.openjdk.org/jdk/commit/e36ce5f0341e8d0ec06cb12d0b2c0aa084401021
26-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20287 Date: 2024-07-22 23:05:13 +0000
22-07-2024