mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-168296 Comments are duplicated when I replace Map.entrySet() loop with Map.forEach
This commit is contained in:
+1
-1
@@ -191,7 +191,7 @@ public class Java8MapForEachInspection extends BaseJavaBatchLocalInspectionTool
|
||||
LambdaRefactoringUtil.simplifyToExpressionLambda(newLambda);
|
||||
entrySetCall.getArgumentList().add(newLambda);
|
||||
ExpressionUtils.bindCallTo(entrySetCall, "forEach");
|
||||
return entrySetCall.getText();
|
||||
return ct.text(entrySetCall);
|
||||
}
|
||||
|
||||
private static void fixInForeach(PsiForeachStatement loop) {
|
||||
|
||||
@@ -86,4 +86,10 @@ public class Test {
|
||||
System.out.println(str + ":" + num);
|
||||
});
|
||||
}
|
||||
|
||||
void forEach(Map<String, String> map) {
|
||||
map.forEach((key, value) -> {
|
||||
//long comment
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,4 +108,10 @@ public class Test {
|
||||
System.out.println(str + ":" + num);
|
||||
}
|
||||
}
|
||||
|
||||
void forEach(Map<String, String> map) {
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
//long comment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user