mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-61858 ("Unnecessarily qualified statically imported element" false positive)
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2007 Dave Griffith, Bas Leijdekkers
|
||||
* Copyright 2003-2010 Dave Griffith, Bas Leijdekkers
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -537,7 +537,8 @@ public class ImportUtils{
|
||||
final String memberName = member.getName();
|
||||
final PsiImportStatementBase existingImportStatement =
|
||||
importList.findSingleImportStatement(memberName);
|
||||
if (existingImportStatement != null) {
|
||||
if (existingImportStatement != null &&
|
||||
existingImportStatement instanceof PsiImportStaticStatement) {
|
||||
final PsiElement target = existingImportStatement.resolve();
|
||||
return member.equals(target);
|
||||
} else {
|
||||
|
||||
+3
-1
@@ -55,7 +55,6 @@ public class UnnecessarilyQualifiedStaticallyImportedElementInspection
|
||||
extends InspectionGadgetsFix {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return InspectionGadgetsBundle.message(
|
||||
"unnecesarily.qualified.statically.imported.element.quickfix");
|
||||
@@ -95,6 +94,9 @@ public class UnnecessarilyQualifiedStaticallyImportedElementInspection
|
||||
if (parent instanceof PsiReferenceExpression) {
|
||||
return;
|
||||
}
|
||||
if (parent instanceof PsiImportStatement) {
|
||||
return;
|
||||
}
|
||||
final PsiElement target = reference.resolve();
|
||||
if (!(target instanceof PsiMember)) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user