make IG test light

This commit is contained in:
Bas Leijdekkers
2015-05-15 16:38:37 +02:00
parent 623dc5cab2
commit 11b40c924b
3 changed files with 16 additions and 40 deletions
@@ -5,14 +5,14 @@ public class StringConcatenationInsideStringBufferAppend {
private String s;
void foo(StringBuffer buffer) {
buffer.append("asdf" + s + "asdf");
buffer.append("asdf" + s);
buffer.<warning descr="String concatenation as argument to 'StringBuffer.append()' call">append</warning>("asdf" + s + "asdf");
buffer.<warning descr="String concatenation as argument to 'StringBuffer.append()' call">append</warning>("asdf" + s);
buffer.append("asdf" + "asdf");
}
void bar(StringBuilder builder) {
builder.append("asdf" + s + "asdf");
builder.append("asdf" + s);
builder.<warning descr="String concatenation as argument to 'StringBuilder.append()' call">append</warning>("asdf" + s + "asdf");
builder.<warning descr="String concatenation as argument to 'StringBuilder.append()' call">append</warning>("asdf" + s);
builder.append("asdf" + "asdf");
}
@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>StringConcatenationInsideStringBufferAppend.java</file>
<line>8</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">String concatenation as argument to 'StringBuffer.append()' call</problem_class>
<description>String concatenation as argument to &lt;code&gt;StringBuffer.append()&lt;/code&gt; call #loc</description>
</problem>
<problem>
<file>StringConcatenationInsideStringBufferAppend.java</file>
<line>9</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">String concatenation as argument to 'StringBuffer.append()' call</problem_class>
<description>String concatenation as argument to &lt;code&gt;StringBuffer.append()&lt;/code&gt; call #loc</description>
</problem>
<problem>
<file>StringConcatenationInsideStringBufferAppend.java</file>
<line>14</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">String concatenation as argument to 'StringBuffer.append()' call</problem_class>
<description>String concatenation as argument to &lt;code&gt;StringBuilder.append()&lt;/code&gt; call #loc</description>
</problem>
<problem>
<file>StringConcatenationInsideStringBufferAppend.java</file>
<line>15</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">String concatenation as argument to 'StringBuffer.append()' call</problem_class>
<description>String concatenation as argument to &lt;code&gt;StringBuilder.append()&lt;/code&gt; call #loc</description>
</problem>
</problems>
@@ -1,11 +1,18 @@
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 StringConcatenationInsideStringBufferAppendInspectionTest extends IGInspectionTestCase {
public class StringConcatenationInsideStringBufferAppendInspectionTest extends LightInspectionTestCase {
public void test() throws Exception {
doTest("com/siyeh/igtest/performance/string_concatenation_inside_string_buffer_append",
new StringConcatenationInsideStringBufferAppendInspection());
public void testStringConcatenationInsideStringBufferAppend() throws Exception {
doTest();
}
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
return new StringConcatenationInsideStringBufferAppendInspection();
}
}