mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
moving tests to CE
This commit is contained in:
+10
@@ -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>
|
||||
+20
@@ -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"});
|
||||
}
|
||||
}
|
||||
+10
@@ -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>
|
||||
+9
@@ -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>
|
||||
+16
@@ -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});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user