mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
moving tests to CE
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
public class Foo {
|
||||
public void foo() {
|
||||
int[] array = new int[5];
|
||||
for (int i = 0; i < array.length; i++) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import java.util.Stack;
|
||||
|
||||
public class AsynchronousImageLoader extends Thread {
|
||||
private final Stack _tasks = new Stack();
|
||||
|
||||
private void threadBody() throws InterruptedException {
|
||||
while (true) {
|
||||
final Runnable task;
|
||||
synchronized (this) {
|
||||
while (_tasks.isEmpty())
|
||||
wait();
|
||||
task = (Runnable) _tasks.pop();
|
||||
}
|
||||
task.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems />
|
||||
@@ -0,0 +1,16 @@
|
||||
package spike;
|
||||
|
||||
public class A
|
||||
{
|
||||
public static void main (String[] args)
|
||||
{
|
||||
boolean thereIsMoreToParse;
|
||||
do {
|
||||
thereIsMoreToParse = buildNextObject ();
|
||||
} while (thereIsMoreToParse);
|
||||
}
|
||||
|
||||
private static boolean buildNextObject () {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems />
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
public class AssignTest {
|
||||
public static void main(String[] args) {
|
||||
int foo = 0;
|
||||
|
||||
while (true) {
|
||||
if (foo != 12) System.out.println("Test");
|
||||
if (Math.random() > 0.5) foo = 22;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>NotUsedTest.java</file>
|
||||
<line>3</line>
|
||||
<description>Variable is never used</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>NotUsedTest.java</file>
|
||||
<line>4</line>
|
||||
<description>The value assigned is never used</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>NotUsedTest.java</file>
|
||||
<line>5</line>
|
||||
<description>The value assigned is never used</description>
|
||||
</problem>
|
||||
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
public class NotUsedTest {
|
||||
public static void main(String[] args) {
|
||||
boolean unused = true;
|
||||
unused = true;
|
||||
unused = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
public class Foo {
|
||||
public void foo() {
|
||||
int i = 4
|
||||
int[] array = new int[] {i};
|
||||
for (int i = 0; i < array.length; i++) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Foo.java</file>
|
||||
<line>7</line>
|
||||
<description>The value changed is never used</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
public class Foo {
|
||||
int myOffset;
|
||||
void foo() {
|
||||
int offset = myOffset + 4;
|
||||
byte[] a = new byte[10];
|
||||
byte b1 = a[offset++];
|
||||
byte b2 = a[offset++];
|
||||
System.out.println(b1);
|
||||
System.out.println(b2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Foo.java</file>
|
||||
<line>3</line>
|
||||
<description>Variable i is never used</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
public class Foo {
|
||||
public void foo() {
|
||||
int i;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user