sdedic commented on a change in pull request #287: Fix 271823 False positive of 
"Non-null method returns null"
URL: https://github.com/apache/incubator-netbeans/pull/287#discussion_r152950895
 
 

 ##########
 File path: java.hints/src/org/netbeans/modules/java/hints/bugs/NPECheck.java
 ##########
 @@ -429,17 +430,37 @@ public static ErrorDescription returnNull(HintContext 
ctx) {
 
         TreePath method = ctx.getPath();
 
-        while (method != null && method.getLeaf().getKind() != Kind.METHOD && 
method.getLeaf().getKind() != Kind.CLASS) {
+        loop: while (method != null) {
 
 Review comment:
   Consider to use 
org.netbeans.modules.java.hints.errors.Utilities.findOwningExecutable

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to