JDK-8031744 : Annotations on many Language Model elements are not returned
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.lang.model
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-01-15
  • Updated: 2018-06-26
  • Resolved: 2015-04-07
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 9
9 b60Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
There are numerous reports that the Language Model API fails to return the correct mirrors for type parameter declarations, return types, receiver types, and types in extends/implements clauses.

Here is a report about type parameter declarations: http://mail.openjdk.java.net/pipermail/type-annotations-dev/2014-January/001513.html.

An Eclipse committer offered the attached test case:

C:\jtests>C:\work\jdk-8-ea-bin-b123-windows-x64-09_jan_2014\jdk8\jdk1.8.0\bin\javac -Xlint:unchecked -Xlint:deprecation -parameters -cp c:\jtests -processor TestProcessor -s . X.java
Processing type parameter: TP
FAILURE::Incorrect annots on type parameter, expected 1 but was 0
FAILURE::Incorrect annots on type parameter mirror, expected 1 but was 0 

Comments
I believe the supplied test case is wrong. '@Marker' is a declaration annotation. However it is still true that many TypeMirrors that should have annotations are missing them in jdk8. See http://hg.openjdk.java.net/anno-pipeline/dev/langtools/file/1b6e1acfa9fd/test/tools/javac/processing/model/type/BasicAnnoTests.java for a test that to a large extent fails in jdk8.
16-12-2014

this causes the ignore of: test/tools/javac/processing/model/type/BasicAnnoTest.java
08-09-2014

8u20-defer-request justification: This can't be fixed for 8u20. It is not a showstopper, we'd like to fix this in 8u40 as part of Language Model fixes.
29-05-2014

Release team: Approved for deferral.
24-01-2014

8-defer-request justification: This can't be fixed for 8. It is not a showstopper, we'd like to fix this in 8u20 as part of a Type Annotations list of fixes.
22-01-2014

Files received from Srikanth in private mail "Issues with 8b123."
22-01-2014

This can only be fixed by carrying out the refactoring effort described by JDK-8027181, which was deferred to an update patch.
21-01-2014