IDEA-61858 ("Unnecessarily qualified statically imported element" false positive)

This commit is contained in:
Bas Leijdekkers
2010-11-25 22:16:28 +01:00
parent 00f653ccf8
commit 9e95d310f4
3 changed files with 6 additions and 3 deletions
@@ -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 {
@@ -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;