mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
Java inspection: Support inferred return type of lambda expression in EqualsReplaceableByObjectsCallInspection (IDEA-161076)
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// "Move 'return' closer to computation of the value of 'r'" "true"
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class T {
|
||||
String[] f(String[] a) {
|
||||
return Stream.of(a).map(s -> {
|
||||
String r;
|
||||
if (s.startsWith("#")) return s.substring(1);
|
||||
else if (s.startsWith("//")) return s.substring(2);
|
||||
else return s;
|
||||
}).toArray(String[]::new);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Move 'return' closer to computation of the value of 'r'" "true"
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class T {
|
||||
String[] f(String[] a) {
|
||||
return Stream.of(a).map(s -> {
|
||||
String r;
|
||||
if (s.startsWith("#")) r = s.substring(1);
|
||||
else if (s.startsWith("//")) r = s.substring(2);
|
||||
else r = s;
|
||||
re<caret>turn r;
|
||||
}).toArray(String[]::new);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user