make IG test light

This commit is contained in:
Bas Leijdekkers
2016-05-13 16:42:17 +02:00
parent d91c606bfa
commit 6f6da592f6
3 changed files with 17 additions and 25 deletions
@@ -25,7 +25,7 @@ public class A implements Serializable {
return null;
}
native void f();
void g() {
void <warning descr="Method 'g()' may be 'static'">g</warning>() {
System.out.println("boo!");
}
}
@@ -39,7 +39,7 @@ interface Surprise {
}
interface FromJava8 {
default void foo() {
default void <warning descr="Method 'foo()' may be 'static'">foo</warning>() {
System.out.println();
}
}
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>A.java</file>
<line>28</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Method may be 'static'</problem_class>
<description>Method &lt;code&gt;g()&lt;/code&gt; may be 'static' #loc</description>
</problem>
<problem>
<file>A.java</file>
<line>42</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Method may be 'static'</problem_class>
<description>Method &lt;code&gt;foo()&lt;/code&gt; may be 'static' #loc</description>
</problem>
</problems>
@@ -1,13 +1,21 @@
package com.siyeh.ig.performance;
import com.siyeh.ig.IGInspectionTestCase;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.Nullable;
public class MethodMayBeStaticInspectionTest extends IGInspectionTestCase {
public class MethodMayBeStaticInspectionTest extends LightInspectionTestCase {
public void test() throws Exception {
final MethodMayBeStaticInspection tool = new MethodMayBeStaticInspection();
tool.m_ignoreEmptyMethods = false;
tool.m_ignoreDefaultMethods = false;
doTest("com/siyeh/igtest/performance/method_may_be_static", tool);
public void testA() {
doTest();
}
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
final MethodMayBeStaticInspection inspection = new MethodMayBeStaticInspection();
inspection.m_ignoreEmptyMethods = false;
inspection.m_ignoreDefaultMethods = false;
return inspection;
}
}