mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
ExtractChainedMapAction: disable on non-first variable; enable for parenthesized lambda
This commit is contained in:
+1
-1
@@ -4,6 +4,6 @@ import java.util.stream.*;
|
||||
|
||||
public class Test {
|
||||
long[] testAsLongStream(int[] x) {
|
||||
return Arrays.stream(x).map(i -> i * 2).mapToLong(l -> l).toArray();
|
||||
return Arrays.stream(x).map(i -> i * 2).mapToLong((l -> l)).toArray();
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Extract variable 'lowerCase' to 'map' operation" "false"
|
||||
import java.util.*;
|
||||
import java.util.stream.*;
|
||||
|
||||
public class Test {
|
||||
boolean test(List<String> list) {
|
||||
return list.stream()
|
||||
.anyMatch(s -> {
|
||||
System.out.println(s);
|
||||
String <caret>lowerCase = s.toLowerCase();
|
||||
return "test".equals(lowerCase);
|
||||
});
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -4,9 +4,9 @@ import java.util.stream.*;
|
||||
|
||||
public class Test {
|
||||
long[] testAsLongStream(int[] x) {
|
||||
return Arrays.stream(x).mapToLong(i -> {
|
||||
return Arrays.stream(x).mapToLong((i -> {
|
||||
int <caret>l = i * 2;
|
||||
return l;
|
||||
}).toArray();
|
||||
})).toArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user