moving tests to CE

This commit is contained in:
Dmitry Jemerov
2009-09-25 21:08:51 +04:00
parent 19e9b897aa
commit 3f622aa4ab
7 changed files with 6 additions and 0 deletions
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>Test.java</file>
<line>18</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Redundant array creation</problem_class>
<description>Redundant array creation for calling varargs method</description>
</problem>
</problems>
@@ -0,0 +1,20 @@
public class Test {
public static void main(String[] args) {
foo(new byte[]{ 1, 2, 3 });
}
private static void foo(byte... bytes) {
System.out.println("Test.foo(byte...)");
for (int i = 0; i < bytes.length; i++) {
System.out.println("bytes[" + i + "] = " + bytes[i]);
}
}
public static void extra(String... args) {
extra(new String[]{"vvv","aaa"});
}
}
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>Test.java</file>
<line>7</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Redundant array creation</problem_class>
<description>Redundant array creation for calling varargs method</description>
</problem>
</problems>
@@ -0,0 +1,9 @@
public class Test {
public void foo(Object... params) {}
{
foo(new Object[2]);
foo(new Object[0]);
}
}
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>Test.java</file>
<line>13</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Redundant array creation</problem_class>
<description>Redundant array creation for calling varargs method</description>
</problem>
<problem>
<file>Test.java</file>
<line>14</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Redundant array creation</problem_class>
<description>Redundant array creation for calling varargs method</description>
</problem>
</problems>
@@ -0,0 +1,16 @@
public class IntentionTest {
public IntentionTest() {}
public void method( Object ... args ) {
for (int i = 0; i < args.length; i++) {
System.out.println("args["+i+"] = " + args[i]);
}
}
public void main(String[] args) {
String[] params = new String[]{ "0", "1" };
method(new Object[]{params});
method(new Object[]{"2", params});
method(new Object[]{params, params});
}
}