mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
suspicious collection calls: support methods with 2 args where second is generic (IDEA-224194)
GitOrigin-RevId: eea809cfaf93b220d63119caf0f9708c0649d5c3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9b798e3ece
commit
8f3cc4607a
+1
-1
@@ -264,7 +264,7 @@ public class SuspiciousMethodCallUtil {
|
||||
substitutor = TypeConversionUtil.getClassSubstitutor(patternClass, calleeClass, substitutor);
|
||||
if (substitutor == null) continue;
|
||||
|
||||
if (!method.getSignature(substitutor).equals(calleeMethod.getSignature(PsiSubstitutor.EMPTY))) continue;
|
||||
if (!method.getSignature(substitutor).equals(calleeMethod.getSignature(resolveResult.getSubstitutor()))) continue;
|
||||
|
||||
PsiTypeParameter[] typeParameters = patternClass.getTypeParameters();
|
||||
if (typeParameters.length <= patternMethod.typeParameterIdx) return null;
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
class Test {
|
||||
void m(Map<String, String> map){
|
||||
void m(Map<String, String> map, HashMap<String, String> hMap){
|
||||
map.getOrDefault(<warning descr="'Map<String, String>' may not contain keys of type 'Integer'">1</warning>, "");
|
||||
hMap.getOrDefault(<warning descr="'HashMap<String, String>' may not contain keys of type 'Integer'">1</warning>, "");
|
||||
|
||||
map.getOrDefault("", "");
|
||||
hMap.getOrDefault("", "");
|
||||
|
||||
map.remove(<warning descr="'Map<String, String>' may not contain keys of type 'Integer'">1</warning>, "");
|
||||
hMap.remove(<warning descr="'HashMap<String, String>' may not contain keys of type 'Integer'">1</warning>, "");
|
||||
map.remove("", "");
|
||||
hMap.remove("", "");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user