From f84c06142dffd34c3a6375367dc54364f2d81d94 Mon Sep 17 00:00:00 2001 From: Honza Date: Thu, 19 Oct 2023 21:41:19 +0200 Subject: [PATCH] "extract lambda to method" works newly for lambda which uses a method argument(s) --- .../netbeans/modules/java/hints/introduce/ScanStatement.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/ScanStatement.java b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/ScanStatement.java index 46e9ca835295..f6f6a0001a85 100644 --- a/java/java.hints/src/org/netbeans/modules/java/hints/introduce/ScanStatement.java +++ b/java/java.hints/src/org/netbeans/modules/java/hints/introduce/ScanStatement.java @@ -244,7 +244,7 @@ private boolean isMethodCode() { @Override public Void visitReturn(ReturnTree node, Void p) { - if (isMethodCode() && phase == PHASE_INSIDE_SELECTION) { + if ((isMethodCode() || isLambda) && phase == PHASE_INSIDE_SELECTION) { selectionExits.add(getCurrentPath()); hasReturns = true; }