[java-inspections] IDEA-284183 "Replace 'forEach' call with loop" generates red code in case of wildcards with Map

GitOrigin-RevId: 77f0fc7d530aed988653aa726be1244c9a3941f9
This commit is contained in:
Tagir Valeev
2021-12-20 12:11:41 +07:00
committed by intellij-monorepo-bot
parent 27184c1411
commit f2e0304c8d
3 changed files with 18 additions and 2 deletions

View File

@@ -42,4 +42,13 @@ public class Main {
}
}
}
void convert(Map<Integer, ? extends List<? extends Appendable>> map) {
for (Map.Entry<Integer, ? extends List<? extends Appendable>> entry : map.entrySet()) {
Integer integer = entry.getKey();
List<? extends Appendable> appendables = entry.getValue();
System.out.println(integer);
System.out.println(appendables);
}
}
}

View File

@@ -28,4 +28,11 @@ public class Main {
}
}
}
void convert(Map<Integer, ? extends List<? extends Appendable>> map) {
map.forEach((integer, appendables) -> {
System.out.println(integer);
System.out.println(appendables);
});
}
}