VariableTree.getNameExpression and TreeScanner
Jonathan Gibbons
jonathan.gibbons at oracle.com
Thu May 23 08:17:28 PDT 2013
On 05/23/2013 12:27 AM, Werner Dietl wrote:
> Why is it desirable to traverse the receiver parameter name, which is
> usually simply "this"?
Because it might not be "this".
What if you were using a TreeScanner to create a custom pretty printer?
> Should other parameter names also be visited, for consistency?
Other parameter names are represented by Name, not a tree node, so they
can't be visited. The nameExpression is only set for a receiver parameter
and is null the rest of the time, much like the "default" value on a method
decl is only set for a "method" in an anno decl.
-- Jon
More information about the type-annotations-dev
mailing list