merged CVS and Subversion versions

This commit is contained in:
Eugene Zhuravlev
2005-01-13 15:55:50 +03:00
parent 5743bf97ba
commit ca0f829972
4 changed files with 11 additions and 20 deletions
@@ -32,8 +32,7 @@ public class JavaLangImportInspection extends ClassInspection {
}
public void applyFix(Project project, ProblemDescriptor descriptor) {
final PsiElement importReference = descriptor.getPsiElement();
final PsiElement importStatement = importReference.getParent();
final PsiElement importStatement = descriptor.getPsiElement();
deleteElement(importStatement);
}
}
@@ -76,7 +75,7 @@ public class JavaLangImportInspection extends ClassInspection {
final String parentName = text.substring(0, classNameIndex);
if ("java.lang".equals(parentName)) {
if (!ImportUtils.hasOnDemandImportConflict(text, file)) {
registerError(reference);
registerError(importStatement);
}
}
}
@@ -22,7 +22,7 @@ public class RedundantImportInspection extends ClassInspection {
}
public String buildErrorString(PsiElement location) {
return "Redundant import #ref #loc";
return "Redundant import '#ref' #loc";
}
public InspectionGadgetsFix buildFix(PsiElement location) {
@@ -35,8 +35,7 @@ public class RedundantImportInspection extends ClassInspection {
}
public void applyFix(Project project, ProblemDescriptor descriptor) {
final PsiElement importReference = descriptor.getPsiElement();
final PsiElement importStatement = importReference.getParent();
final PsiElement importStatement = descriptor.getPsiElement();
deleteElement(importStatement);
}
}
@@ -79,8 +78,7 @@ public class RedundantImportInspection extends ClassInspection {
final String parentName = text.substring(0, classNameIndex);
if (imports.contains(parentName)) {
if (!ImportUtils.hasOnDemandImportConflict(text, file)) {
final PsiJavaCodeReferenceElement importReference = importStatement.getImportReference();
registerError(importReference);
registerError(importStatement);
}
}
}
@@ -18,7 +18,7 @@ public class SamePackageImportInspection extends ClassInspection {
}
public String buildErrorString(PsiElement location) {
return "Unnecessary import from same package package #loc";
return "Unnecessary import from same package '#ref' #loc";
}
public InspectionGadgetsFix buildFix(PsiElement location) {
@@ -31,9 +31,7 @@ public class SamePackageImportInspection extends ClassInspection {
}
public void applyFix(Project project, ProblemDescriptor descriptor) {
final PsiElement importReference = descriptor.getPsiElement();
final PsiElement importStatement = importReference.getParent();
final PsiElement importStatement = descriptor.getPsiElement();
deleteElement(importStatement);
}
}
@@ -72,7 +70,7 @@ public class SamePackageImportInspection extends ClassInspection {
final int classNameIndex = text.lastIndexOf((int) '.');
final String parentName = classNameIndex < 0 ? "" : text.substring(0, classNameIndex);
if (packageName.equals(parentName)) {
registerError(reference);
registerError(importStatement);
}
}
}
@@ -18,7 +18,7 @@ public class UnusedImportInspection extends ClassInspection {
}
public String buildErrorString(PsiElement location) {
return "Unused import #ref #loc";
return "Unused import '#ref' #loc";
}
public InspectionGadgetsFix buildFix(PsiElement location) {
@@ -31,8 +31,7 @@ public class UnusedImportInspection extends ClassInspection {
}
public void applyFix(Project project, ProblemDescriptor descriptor) {
final PsiElement importReference = descriptor.getPsiElement();
final PsiElement importStatement = importReference.getParent();
final PsiElement importStatement = descriptor.getPsiElement();
deleteElement(importStatement);
}
}
@@ -59,10 +58,7 @@ public class UnusedImportInspection extends ClassInspection {
for (int i = 0; i < importStatements.length; i++) {
final PsiImportStatement importStatement = importStatements[i];
if (!isNecessaryImport(importStatement, file.getClasses())) {
final PsiJavaCodeReferenceElement importReference
= importStatement.getImportReference();
registerError(importReference);
registerError(importStatement);
}
}
}