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,24 @@
|
||||
public class Test {
|
||||
public int fib(int n) {
|
||||
switch (n) {
|
||||
case 0:
|
||||
return 0;
|
||||
// you can comment out the next three lines -- same thing
|
||||
case 1:
|
||||
case 2:
|
||||
return 1;
|
||||
default:
|
||||
int a;
|
||||
int b = 1;
|
||||
int c = 2;
|
||||
n -= 3;
|
||||
while (n-- > 0) {
|
||||
a = b;
|
||||
b = c;
|
||||
c = a + b;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package foo;
|
||||
|
||||
public class Test {
|
||||
public static void main(final String[] args) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>5</line>
|
||||
<description>final</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo;
|
||||
|
||||
public class Test {
|
||||
public static void main(final String[] args) {
|
||||
int foo = 12;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo;
|
||||
|
||||
public class Test {
|
||||
public static void main(final String[] args) {
|
||||
final int foo = 12;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package foo;
|
||||
|
||||
public class Test {
|
||||
public static void main(final String[] args) {
|
||||
final int foo = 12;
|
||||
final int bar = 24;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package foo;
|
||||
|
||||
public class Test {
|
||||
public static void main(final String[] args) {
|
||||
final int foo = 12;
|
||||
final int bar = 24;
|
||||
final int gazonk = 48;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package foo;
|
||||
|
||||
public class Test {
|
||||
public static void main(final String[] args) {
|
||||
final int foo = 12;
|
||||
final int bar = 24;
|
||||
final int gazonk = 48;
|
||||
final int banana = 96;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Junk.java</file>
|
||||
<line>5</line>
|
||||
<description>bar final</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Junk.java</file>
|
||||
<line>8</line>
|
||||
<description>i final</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Junk.java</file>
|
||||
<line>9</line>
|
||||
<description>foo final</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Junk.java</file>
|
||||
<line>15</line>
|
||||
<description>j final</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
public final class Junk
|
||||
{
|
||||
public void sillyMethod()
|
||||
{
|
||||
String bar = "bar";
|
||||
try
|
||||
{
|
||||
int i = 1;
|
||||
String foo = "foo";
|
||||
System.out.println("[" + bar + "|" + i + "|" + foo + "]");
|
||||
//throw new Exception();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
int j = 2;
|
||||
System.out.println("j = [" + j + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Junk.java</file>
|
||||
<line>5</line>
|
||||
<description>bar final</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Junk.java</file>
|
||||
<line>8</line>
|
||||
<description>i final</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Junk.java</file>
|
||||
<line>9</line>
|
||||
<description>foo final</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Junk.java</file>
|
||||
<line>15</line>
|
||||
<description>j final</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
public final class Junk
|
||||
{
|
||||
public void sillyMethod()
|
||||
{
|
||||
String bar = "bar";
|
||||
try
|
||||
{
|
||||
int i = 1;
|
||||
String foo = "foo";
|
||||
System.out.println("[" + bar + "|" + i + "|" + foo + "]");
|
||||
throw new Exception();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
int j = 2;
|
||||
System.out.println("j = [" + j + "]");
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.out.println("In finally");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>TestFinal2.java</file>
|
||||
<line>4</line>
|
||||
<description>i final</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
public class TestFinal2 {
|
||||
static void foo(final boolean b) {
|
||||
if (b) {
|
||||
int i = 12;
|
||||
System.out.println("i = " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>TestFinal2.java</file>
|
||||
<line>3</line>
|
||||
<description>bx final</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
public class TestFinal2 {
|
||||
static void foo(final boolean[] b) {
|
||||
for(boolean bx : b) {
|
||||
System.out.println("bx = " + bx);
|
||||
}
|
||||
for(boolean by : b) {
|
||||
by = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>4</line>
|
||||
<description>final</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
public class Test{
|
||||
|
||||
public void t() {
|
||||
Object v;
|
||||
if (true) {
|
||||
v = new Object();
|
||||
} else {
|
||||
v = new Object();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>5</line>
|
||||
<description>o final</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
public class Test{
|
||||
|
||||
public void t() {
|
||||
Object v;
|
||||
Object o;
|
||||
if (true) {
|
||||
v = new Object();
|
||||
o = new Object();
|
||||
} else {
|
||||
}
|
||||
System.out.println(v);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems />
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
public class Test{
|
||||
|
||||
public void t() {
|
||||
Object v;
|
||||
for (int i = 0;i<10;i++) {
|
||||
v = new Object();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>3</line>
|
||||
<description>args final</description>
|
||||
</problem>
|
||||
</problems>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
public class Test
|
||||
{
|
||||
public static void main(String[] args) {
|
||||
System.out.println(args[0]);
|
||||
}
|
||||
|
||||
public static void foo(String cannotBeFinal) {
|
||||
cannotBeFinal = "";
|
||||
System.out.println(cannotBeFinal);
|
||||
}
|
||||
|
||||
public static void bar(final String alreadyFinal) {
|
||||
System.out.println(alreadyFinal);
|
||||
}
|
||||
|
||||
public static void bar1(final String alreadyFinal) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user