junichi11 commented on a change in pull request #2570:
URL: https://github.com/apache/netbeans/pull/2570#discussion_r538883642



##########
File path: 
java/java.hints/src/org/netbeans/modules/java/hints/errors/Utilities.java
##########
@@ -3155,7 +3156,8 @@ public static boolean 
isCompatibleWithSwitchExpression(SwitchTree st) {
                             }
                             firstCase = false;
                         }
-                        if (leftTreeName != null && 
leftTreeName.contentEquals(getLeftTreeName(statements.get(0)))) {
+                        Name exprTree = getLeftTreeName(statements.get(0));
+                        if (leftTreeName != null && exprTree != null && 
leftTreeName.contentEquals(exprTree)) {

Review comment:
       I would introduce a method for checking conditions because it's the same 
as above.
   cc: @Akshay-Gupta-Oracle 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to