mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-180417 Generated code ("Replace with collect") is invalid
This commit is contained in:
@@ -586,6 +586,11 @@ class CollectMigration extends BaseStreamApiMigration {
|
||||
myElementVariable = elementVariable;
|
||||
}
|
||||
|
||||
@Override
|
||||
String generateIntermediate() {
|
||||
return myElementVariable.getType() instanceof PsiPrimitiveType ? ".boxed()" : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateTerminal() {
|
||||
PsiExpression[] args = myMapUpdateCall.getArgumentList().getExpressions();
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ class Maps {
|
||||
|
||||
public class Test {
|
||||
public void test() {
|
||||
Map<String, Integer> map = IntStream.range(0, 10).filter(i -> i % 2 == 0).collect(Collectors.toMap(String::valueOf, i -> i, (a, b) -> b));
|
||||
Map<String, Integer> map = IntStream.range(0, 10).filter(i -> i % 2 == 0).boxed().collect(Collectors.toMap(String::valueOf, i -> i, (a, b) -> b));
|
||||
System.out.println(map);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user