You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/03/15 09:26:15 UTC

[GitHub] jlahoda commented on issue #453: Split into declaration and assignment issue for var type

jlahoda commented on issue #453: Split into declaration and assignment issue for var type
URL: https://github.com/apache/incubator-netbeans/pull/453#issuecomment-373312737
 
 
   My personal opinions:
   -no need for a comment referring to jira, adding such a comment for every change would lead to many comments. The VCS log should be enough, and tests should help as well.
   -there should be a (unit) test. Tests by default run with nb-javac, and nb-javac supports vars, so this should be doable, even when running the tests with JDK 8. The test may refer to the Jira #, so that if it fails, one can find out the original report.
   -please avoid looking at the text as much as possible - such things are quite fragile (e.g., what if someone writes "var/**/ v = 1;"? Not sure if the fact that the variable is a "var" can be detected from the AST, maybe not. But it should be possible to use lexer tokens to check for "var", something like CompilationInfo.getTreeUtilities().tokensFor(VariableTree) and then check the appropriate token. Please note that things like this are allowed:
           final var v1 = 0;
           @Deprecated var v2 = 1;
   So I'd suggest to move the token sequence behind the modifiers, ignore whitespaces/comments and check the following token.
   -I'd suggest to do an API method for this check in TreeUtilities. I suspect this check will be needed on more places, so better not to duplicate it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists