Hi,       
      
      Please review http://cr.openjdk.java.net/~sdama/8210742/webrev.00/       
      
      for https://bugs.openjdk.java.net/browse/JDK-8210742.       
      
      Regards,       
      
      Srinivas       
        ">

(original) (raw)

Hi,
I think what you are doing is ok, but I have some comments:

1) it seems like this code:


startPos = TreeInfo.getStartPos(mods);
if (startPos == Position.NOPOS)
startPos = TreeInfo.getStartPos(type);

should probably be lifted outside the 'if' - e.g. should apply to all cases after the check for "isRestrictedLocalVarTypeName"

2) A similar argument applies, kind of, to setting type to 'null'. With your patch we do that in 2/3 branches; the branch that is left out is when you have a var declaration like this:

var foo\[\] = ...

In this case the parser will still attempt to create a var tree with 'var' as its type. If we are worried about how the AST would look in erroneous cases, then I think this is a problem too.

Cheers
Maurizio


On 15/11/2018 10:31, srinivas wrote:


Hi,




Please review http://cr.openjdk.java.net/~sdama/8210742/webrev.00/




for https://bugs.openjdk.java.net/browse/JDK-8210742.




Regards,




Srinivas