mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
alternative suppress id for global inspections (IDEA-154071)
This commit is contained in:
+2
-1
@@ -32,6 +32,7 @@ public class UnusedSymbolLocalInspectionBase extends BaseJavaLocalInspectionTool
|
||||
@NonNls public static final String SHORT_NAME = HighlightInfoType.UNUSED_SYMBOL_SHORT_NAME;
|
||||
@NonNls public static final String DISPLAY_NAME = HighlightInfoType.UNUSED_SYMBOL_DISPLAY_NAME;
|
||||
@NonNls public static final String UNUSED_PARAMETERS_SHORT_NAME = "UnusedParameters";
|
||||
@NonNls public static final String UNUSED_ID = "unused";
|
||||
|
||||
public boolean LOCAL_VARIABLE = true;
|
||||
public boolean FIELD = true;
|
||||
@@ -126,7 +127,7 @@ public class UnusedSymbolLocalInspectionBase extends BaseJavaLocalInspectionTool
|
||||
@NotNull
|
||||
@NonNls
|
||||
public String getID() {
|
||||
return "unused";
|
||||
return UNUSED_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -193,7 +193,7 @@ public class UnusedParametersInspection extends GlobalJavaBatchInspectionTool {
|
||||
clearUsedParameters(refMethod, result, checkDeep);
|
||||
|
||||
for (RefParameter parameter : result) {
|
||||
if (parameter != null && !((RefElementImpl)parameter).isSuppressed(UnusedSymbolLocalInspectionBase.UNUSED_PARAMETERS_SHORT_NAME)) {
|
||||
if (parameter != null && !((RefElementImpl)parameter).isSuppressed(UnusedSymbolLocalInspectionBase.UNUSED_PARAMETERS_SHORT_NAME, UnusedSymbolLocalInspectionBase.UNUSED_ID)) {
|
||||
res.add(parameter);
|
||||
}
|
||||
}
|
||||
@@ -315,6 +315,6 @@ public class UnusedParametersInspection extends GlobalJavaBatchInspectionTool {
|
||||
@Nullable
|
||||
@Override
|
||||
public String getAlternativeID() {
|
||||
return "unused";
|
||||
return UnusedSymbolLocalInspectionBase.UNUSED_ID;
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -2,4 +2,8 @@ public class Test {
|
||||
public void foo(@SuppressWarnings("UnusedParameters") boolean b) {
|
||||
|
||||
}
|
||||
|
||||
public void foo(@SuppressWarnings("unused") boolean b) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -209,7 +209,7 @@ public class GlobalInspectionContextBase extends UserDataHolderBase implements G
|
||||
}
|
||||
|
||||
public boolean isToCheckMember(@NotNull RefElement owner, @NotNull InspectionProfileEntry tool) {
|
||||
return isToCheckFile(((RefElementImpl)owner).getContainingFile(), tool) && !((RefElementImpl)owner).isSuppressed(tool.getShortName());
|
||||
return isToCheckFile(((RefElementImpl)owner).getContainingFile(), tool) && !((RefElementImpl)owner).isSuppressed(tool.getShortName(), tool.getAlternativeID());
|
||||
}
|
||||
|
||||
public boolean isToCheckFile(PsiFile file, @NotNull InspectionProfileEntry tool) {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class GlobalInspectionContextUtil {
|
||||
|
||||
|
||||
public static boolean isToCheckMember(@NotNull RefElement owner, @NotNull InspectionProfileEntry tool, Tools tools, ProfileManager profileManager) {
|
||||
return isToCheckFile(((RefElementImpl)owner).getContainingFile(), tool, tools, profileManager) && !((RefElementImpl)owner).isSuppressed(tool.getShortName());
|
||||
return isToCheckFile(((RefElementImpl)owner).getContainingFile(), tool, tools, profileManager) && !((RefElementImpl)owner).isSuppressed(tool.getShortName(), tool.getAlternativeID());
|
||||
}
|
||||
|
||||
public static boolean isToCheckFile(PsiFile file, @NotNull InspectionProfileEntry tool, Tools tools, ProfileManager profileManager) {
|
||||
|
||||
Reference in New Issue
Block a user