JDK-6479933 : How to get end positions during annotation processing
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P5
  • Status: Resolved
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2006-10-09
  • Updated: 2014-02-18
  • Resolved: 2014-02-18
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 7
7Resolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
When fixing 6402077 it became apparent that end positions are only available
through the tree API when a DiagnosticListener is provided.  When fixing that
bug we also enabled end positions when the parse method is called.  However,
what about annotation processing?

Could we just enable end positions all the time?

Comments
Looking into the code, the end positions should be enabled correctly while annotation processors are running. A test exists for that: langtools/test/tools/javac/tree/TreePosRoundsTest.java The test passes, after augmenting the test with some testing code, the end positions seem reasonable. The test itself seems sufficient to me. So this appears to not to be an issue anymore. I've linked JDK-6985205 and JDK-8007344 which introduced related changes.
18-02-2014

We need to verify that you can get at end positions during anno processing.
12-02-2014