JDK-8007350 : Some tree nodes do not have endpos set
Type:Bug
Component:tools
Sub-Component:javac
Affected Version:8
Priority:P4
Status:Open
Resolution:Unresolved
Submitted:2013-02-01
Updated:2017-10-28
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.
Some of the synthetic/synthesized tree nodes have a start pos but no end pos.
Comments
This is much larger effort than initially described, and needs to be categorized under the "Immutable Trees" category.
There are 4 case of synthesized trees:
1. Default CTOR: this tree is created in MemberEnter, this should be stored as SymTab vs. a Tree.
2. Enum Values: created in MemberEnter and needs to be stored as a SymTab vs. a Tree.
3. Enum members: ex XYZ -> static EXYZ = new E.... these need to have maybe startpos=endpos=NOPOS or startEnd(XYZ)
4. Anonymous class creation -> hidden class class X$WN{......} this may also be treated the same way as #3.
05-08-2013
The interesting tree nodes to check are those synthesized before Attr, when clients are most likely to want to have the endpos available. This includes synthesized stuff for enums, default constructors, and so on