mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 12:17:12 +07:00
[java-inspections] TrivialFunctionalExpressionUsageInspection: solve naming conflicts instead of keeping the block
Keeping the block does not work correctly for blocks with return statement GitOrigin-RevId: d14e22e793840d74957928a8d7748275db4929ef
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e536db53dc
commit
4c29ff02f6
@@ -38,4 +38,15 @@ class X {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static List<String> getStrings(List<String> test) {
|
||||
ArrayList<String> objects1 = new ArrayList<>();
|
||||
objects1.add("1");
|
||||
ArrayList<String> strings = objects1;
|
||||
for (String string : test) {
|
||||
System.out.println("1");
|
||||
strings.add(string);
|
||||
}
|
||||
return strings;
|
||||
}
|
||||
}
|
||||
@@ -37,4 +37,16 @@ class X {
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private static List<String> getStrings(List<String> test) {
|
||||
return test.stream()
|
||||
.collect(()->{
|
||||
ArrayList<String> objects = new ArrayList<>();
|
||||
objects.add("1");
|
||||
return objects;
|
||||
}, (strings, string) -> {
|
||||
System.out.println("1");
|
||||
strings.add(string);
|
||||
}, (strings, strings2) -> strings.addAll(strings2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user