mbien commented on code in PR #8717:
URL: https://github.com/apache/netbeans/pull/8717#discussion_r2362348900


##########
java/java.hints/src/org/netbeans/modules/java/hints/introduce/Flow.java:
##########
@@ -114,6 +114,16 @@
  */
 public class Flow {
 
+    public static final Set<ElementKind> LOCAL_VARIABLES = 
Set.of(ElementKind.BINDING_VARIABLE, ElementKind.EXCEPTION_PARAMETER, 
ElementKind.LOCAL_VARIABLE, ElementKind.PARAMETER, 
ElementKind.RESOURCE_VARIABLE);
+    private static final Set<ElementKind> IMPLICITLY_INITIALIZED_VARIABLES = 
Set.of(ElementKind.BINDING_VARIABLE, ElementKind.EXCEPTION_PARAMETER, 
ElementKind.PARAMETER);

Review Comment:
   nitpick: since this got moved; maybe add some line breaks for mortals 
without panoramic screens ;)



##########
java/java.hints/src/org/netbeans/modules/java/hints/bugs/ThrowableNotThrown.java:
##########
@@ -359,10 +358,40 @@ Boolean processEnclosingStatement(TreePath excPath) {
                         break;
                     }
 
+                    case SWITCH: {
+                        SwitchTree st = (SwitchTree) leaf;
+
+                        if (st.getExpression() == prevLeaf) {
+                            handleCases(st.getCases());
+                        }
+
+                        break;
+                    }
+                    case SWITCH_EXPRESSION: {
+                        SwitchExpressionTree st = (SwitchExpressionTree) leaf;
+
+                        if (st.getExpression() == prevLeaf) {
+                            handleCases(st.getCases());
+                            process = true;
+                        }
+                        break;
+                    }
                 }
                 prevLeaf = excPath.getLeaf();
             } while (process);
             return varAssignments.isEmpty() ? Boolean.FALSE : null;
         }
+
+        private void handleCases(List<? extends CaseTree> cases) {

Review Comment:
   nitpick: `collectVarAssignments` potentially a more descriptive name?



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

To unsubscribe, e-mail: [email protected]

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