mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
suppress single unused parameter
This commit is contained in:
+1
-1
@@ -191,7 +191,7 @@ public class UnusedParametersInspection extends GlobalJavaBatchInspectionTool {
|
||||
clearUsedParameters(refMethod, result, checkDeep);
|
||||
|
||||
for (RefParameter parameter : result) {
|
||||
if (parameter != null) {
|
||||
if (parameter != null && !((RefElementImpl)parameter).isSuppressed(UnusedSymbolLocalInspectionBase.UNUSED_PARAMETERS_SHORT_NAME)) {
|
||||
res.add(parameter);
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems/>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public class Test {
|
||||
public void foo(@SuppressWarnings("UnusedParameters") boolean b) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,10 @@ public class UnusedMethodParameterTest extends InspectionTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSuppressedParameter() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testEntryPointUnusedParameter() throws Exception {
|
||||
doTest("unusedMethodParameter/" + getTestName(true), myTool, true, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user