mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
don't reject static method of interfaces imported via static imports (IDEA-145504)
This commit is contained in:
@@ -374,6 +374,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
if (!(conflict instanceof MethodCandidateInfo)) continue;
|
||||
final PsiMethod method = ((MethodCandidateInfo)conflict).getElement();
|
||||
if (method.hasModifierProperty(PsiModifier.STATIC)) {
|
||||
if (conflict.getCurrentFileResolveScope() instanceof PsiImportStaticStatement) continue;
|
||||
final PsiClass containingClass = method.getContainingClass();
|
||||
if (containingClass != null && containingClass.isInterface()) {
|
||||
if (qualifierClass == null) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import static java.util.stream.Stream.concat;
|
||||
import static java.util.stream.Stream.of;
|
||||
|
||||
class Test {
|
||||
{
|
||||
concat(of(""), of(""));
|
||||
}
|
||||
}
|
||||
@@ -82,6 +82,10 @@ public class Interface8MethodsHighlightingTest extends LightCodeInsightFixtureTe
|
||||
doTest(true, false);
|
||||
}
|
||||
|
||||
public void testAcceptStaticInterfaceMethodsImportedViaStaticImports() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user