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