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/07/16 12:52:28 UTC

[GitHub] sdedic commented on a change in pull request #635: [NetBeans-1019]False positive of "Null Pointer Dereference" when passing a lambda with a null possible result to a non-null argument

sdedic commented on a change in pull request #635: [NetBeans-1019]False positive of "Null Pointer Dereference" when passing a lambda with a null possible result to a non-null argument
URL: https://github.com/apache/incubator-netbeans/pull/635#discussion_r202665756
 
 

 ##########
 File path: java.hints/src/org/netbeans/modules/java/hints/bugs/NPECheck.java
 ##########
 @@ -625,7 +626,7 @@ public State scan(Tree tree, Void p) {
             
             TypeMirror currentType = tree != null ? info.getTrees().getTypeMirror(new TreePath(getCurrentPath(), tree)) : null;
             
-            if (currentType != null && currentType.getKind().isPrimitive()) {
+            if ((tree != null && tree instanceof JCTree.JCLambda) || (currentType != null && currentType.getKind().isPrimitive())) {
 
 Review comment:
   in fact `getKind` is strongly preferred, as it allows the implementor to mix in interfaces. Please void dependencies on `JC*` implementation classes from Javac, if possible.

----------------------------------------------------------------
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