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 2020/08/05 05:28:51 UTC

[GitHub] [netbeans] jlahoda commented on a change in pull request #2293: Handling of switch expressions and rule cases in Flow and NPECheck hint.

jlahoda commented on a change in pull request #2293:
URL: https://github.com/apache/netbeans/pull/2293#discussion_r465481495



##########
File path: java/java.hints/src/org/netbeans/modules/java/hints/introduce/Flow.java
##########
@@ -1172,37 +1207,63 @@ public Boolean visitBreak(BreakTree node, ConstructorData p) {
 
             Tree target = info.getTreeUtilities().getBreakContinueTargetTree(getCurrentPath());
             
-            resumeAfter(target, variable2State);
+            breakTo(target);
 
-            variable2State = new HashMap< Element, State>();
+            return null;
+        }
+
+        public Boolean visitYield(Tree node, ConstructorData p) {
+            scan(TreeShims.getYieldValue(node), p);
+
+            Tree target = info.getTreeUtilities().getBreakContinueTargetTree(getCurrentPath());
             
+            breakTo(target);
+
             return null;
         }
 
+        private void breakTo(Tree target) {
+            resumeAfter(target, variable2State);
+
+            variable2State = new HashMap< Element, State>();

Review comment:
       ```suggestion
               variable2State = new HashMap<>();
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



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