mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
Do not suggest computeIfAbsent <=> putIfAbsent conversions if value could be nullable
Fixes IDEA-215931 Incorrect "Excessive lambda usage" warning GitOrigin-RevId: 13fa8f5d7d283cd7a208053ed0271a644b713391
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ceb5edd14f
commit
9366f0ec2a
+8
@@ -0,0 +1,8 @@
|
||||
// "Use 'putIfAbsent' method without lambda" "false"
|
||||
import java.util.Map;
|
||||
|
||||
class Test {
|
||||
public void test(Map<String, String> map, String key, String value) {
|
||||
map.computeIfAbsent(key, k <caret>-> value);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Use 'computeIfAbsent' method with functional argument" "false"
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
class Test {
|
||||
public void test(Map<String, List<Integer>> map, String key) {
|
||||
map.putIfAbsent(key, createList<caret>());
|
||||
map.get(key).add(0);
|
||||
}
|
||||
|
||||
private native List<Integer> createList();
|
||||
}
|
||||
Reference in New Issue
Block a user