mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix SameParameterValueInspectionJvmTest
This commit is contained in:
+4
-1
@@ -42,6 +42,7 @@ import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.uast.UExpression;
|
||||
import org.jetbrains.uast.UParameter;
|
||||
import org.jetbrains.uast.UastContextKt;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -118,7 +119,9 @@ public class SameParameterValueInspection extends GlobalJavaBatchInspectionTool
|
||||
if (minimalUsageCount != 0 && refParameter.getUsageCount() < minimalUsageCount) continue;
|
||||
if (!globalContext.shouldCheck(refParameter, this)) continue;
|
||||
if (problems == null) problems = new ArrayList<>(1);
|
||||
problems.add(registerProblem(manager, refParameter.getElement(), value, refParameter.isUsedForWriting()));
|
||||
UParameter parameter = refParameter.getUastElement();
|
||||
if (parameter == null) continue;
|
||||
problems.add(registerProblem(manager, (PsiParameter)parameter.getJavaPsi(), value, refParameter.isUsedForWriting()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-7
@@ -1,12 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.kt</file>
|
||||
<line>9</line>
|
||||
<problem_class>Actual method parameter is the same constant</problem_class>
|
||||
<description>Actual value of parameter 'i' is always '10'</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>Test.kt</file>
|
||||
<line>2</line>
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public class SameParameterValueInspectionJvmTest extends InspectionTestCase {
|
||||
}
|
||||
|
||||
public void testEntryPoint() {
|
||||
doTest(getGlobalTestDir(), myGlobalTool);
|
||||
doTest(getGlobalTestDir(), myGlobalTool, false, true);
|
||||
}
|
||||
|
||||
public void testMethodWithSuper() {
|
||||
|
||||
Reference in New Issue
Block a user