Possible showstopper: was Re: new tree node

Jonathan Gibbons jonathan.gibbons at oracle.com
Tue May 7 19:01:21 PDT 2013


Werner,

The problems with JCReceiverVariableDecl are more serious than I 
thought. TreeCopier will definitely throw class cast exceptions at 
runtime because of the unchecked cast in TreeCopier.copy.

In general, it is not going to work to create this semi-private subclass 
of JCVariableDecl and hope that everything works out. We would need to 
either generalize JCVariableDecl, which implies changing existing API, 
or else bite the bullet and add JCReceiverDecl, a corresponding 
com.sun.source tree node, and update all related Kind, Tag, Visitor, 
Scanner, Copier classes.

-- Jon


On 05/07/2013 04:45 PM, Jonathan Gibbons wrote:
> Werner,
>
> If you add a new tree node in JCTree, you must add a corresponding new 
> node in com.sun.source.tree. It is not enough to simply create 
> JCReceiverVariableDecl be a subtype of JCVariableDecl :-(
>
> -- Jon
>
>



More information about the type-annotations-dev mailing list