mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
unused declaration: take inner class settings into account
This commit is contained in:
+6
-2
@@ -234,8 +234,12 @@ class PostHighlightingVisitor {
|
||||
return processMethod(myProject, (PsiMethod)parent, identifier, progress, helper);
|
||||
}
|
||||
}
|
||||
if (parent instanceof PsiClass && compareVisibilities((PsiModifierListOwner)parent, myUnusedSymbolInspection.getClassVisibility())) {
|
||||
return processClass(myProject, (PsiClass)parent, identifier, progress, helper);
|
||||
if (parent instanceof PsiClass) {
|
||||
final String acceptedVisibility = ((PsiClass)parent).getContainingClass() == null ? myUnusedSymbolInspection.getClassVisibility()
|
||||
: myUnusedSymbolInspection.getInnerClassVisibility();
|
||||
if (compareVisibilities((PsiModifierListOwner)parent, acceptedVisibility)) {
|
||||
return processClass(myProject, (PsiClass)parent, identifier, progress, helper);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+1
-2
@@ -23,7 +23,6 @@ import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.psi.PsiModifier;
|
||||
import org.intellij.lang.annotations.Pattern;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -39,7 +38,7 @@ public class UnusedSymbolLocalInspectionBase extends BaseJavaLocalInspectionTool
|
||||
public boolean FIELD = true;
|
||||
public boolean METHOD = true;
|
||||
public boolean CLASS = true;
|
||||
protected boolean INNER_CLASS = CLASS;
|
||||
protected boolean INNER_CLASS = true;
|
||||
public boolean PARAMETER = true;
|
||||
public boolean REPORT_PARAMETER_FOR_PUBLIC_METHODS = true;
|
||||
|
||||
|
||||
+5
-2
@@ -439,8 +439,11 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
|
||||
|
||||
@PsiModifier.ModifierConstant
|
||||
private static String getAcceptedVisibility(UnusedSymbolLocalInspectionBase tool, RefJavaElement element) {
|
||||
if (element instanceof RefClass || element instanceof RefImplicitConstructor) {
|
||||
return tool.getClassVisibility();
|
||||
if (element instanceof RefImplicitConstructor) {
|
||||
element = ((RefImplicitConstructor)element).getOwnerClass();
|
||||
}
|
||||
if (element instanceof RefClass) {
|
||||
return element.getOwner() instanceof RefClass ? tool.getInnerClassVisibility() : tool.getClassVisibility();
|
||||
}
|
||||
if (element instanceof RefField) {
|
||||
return tool.getFieldVisibility();
|
||||
|
||||
Reference in New Issue
Block a user