mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-inspection] IDEA-311127 Not find static import. Fix one more case
GitOrigin-RevId: a45f353468b849238dab2533c87b1f18740ec395
This commit is contained in:
committed by
intellij-monorepo-bot
parent
63396759c4
commit
068020ddd6
+8
-2
@@ -162,8 +162,14 @@ abstract class StaticMembersProcessor<T extends PsiMember & PsiDocCommentOwner>
|
||||
}
|
||||
|
||||
ApplicableType type = isApplicable(member, myPlace);
|
||||
list.remove(list.size() - 1);
|
||||
list.add(new Pair<>(member, type));
|
||||
if (list.size() > 0) {
|
||||
Pair<T, ApplicableType> previousPair = list.get(list.size() - 1);
|
||||
if (previousPair.getFirst().getContainingClass() == containingClass &&
|
||||
previousPair.getSecond().ordinal() < type.ordinal()) {
|
||||
list.remove(list.size() - 1);
|
||||
list.add(new Pair<>(member, type));
|
||||
}
|
||||
}
|
||||
|
||||
if (type == ApplicableType.APPLICABLE) {
|
||||
applicableList.add(member);
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// "Qualify static call..." "true"
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
System.out.println(B.produceSomething(1).isEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
public static Object produceSomething(Integer i) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
public static List<String> produceSomething(Integer i) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
public static Object produceSomething(Integer i) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
public static Integer produceSomething(Integer i) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// "Qualify static call..." "true"
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
System.out.println(produceSomething<caret>(1).isEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
public static Object produceSomething(Integer i) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
public static List<String> produceSomething(Integer i) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
public static Object produceSomething(Integer i) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
public static Integer produceSomething(Integer i) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user