JDK-7178297 : provide mapping from doc comment position to source file position
Type:Enhancement
Component:tools
Sub-Component:javac
Affected Version:8
Priority:P3
Status:Closed
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2012-06-20
Updated:2013-06-07
Resolved:2012-06-27
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.
We need to be able to map from any position in a doc comment back to the position in the overall source file.
Comments
Review comments:
All edits should be superficial, with no intended change in any functionality. If it helps, I've patched in a direct diff between yesterday's webrev and this one. See "delta diffs" in the webrev header. With hindsight I see how I could have done it better with mq, I will try and remember next time.
1. Almost all comments in JavadocTokenizer have been expanded and clarified, based on your feedback. The one comment that /hasn't/ changed is the one on new line 353.
2. The ColReader class has been renamed to DocReader.
3. The "is array full" test on new line 196 has been modified to be slightly more robust and less deserving of a comment. The test is now of the form "is the max index I'm about to use within the bounds of the array".
4. Extra parens have been added on new line 245, to emphasise the grouping.
5. The expression on new line 195 has been refactored to make it more directly correspond to the comment about detecting discontinuity.
Previously the expression was of the form
sourcepos.N + (commentpos.N+1 - commentpos.N) != sourcepos.N+1
Now, the first term has been moved to the other side for greater symmetry
(commentpos.N+1 - commentpos.N) != (sourcepos.N+1 - sourcepos.N)
... so, adding noreg-cleanup