fernflower/test/unit/classes/TestClassLoop.java

49 lines
644 B
Java
Raw Normal View History

2014-08-13 22:17:21 +02:00
package unit.classes;
2014-03-04 15:13:11 +01:00
2014-08-13 22:17:21 +02:00
public class TestClassLoop {
2014-03-04 15:13:11 +01:00
2014-08-13 22:17:21 +02:00
public static void testSimpleInfinite() {
2014-03-04 15:13:11 +01:00
2014-08-13 22:17:21 +02:00
while(true) {
System.out.println();
}
}
public static void testFinally() {
boolean a = (Math.random() > 0);
2014-03-04 15:13:11 +01:00
while(true) {
try {
if(!a) {
return;
}
} finally {
System.out.println("1");
}
}
}
2014-08-13 22:17:21 +02:00
public static void testFinallyContinue() {
boolean a = (Math.random() > 0);
for(;;) {
try {
System.out.println("1");
} finally {
if(a) {
System.out.println("3");
continue;
}
}
System.out.println("4");
}
}
2014-03-04 15:13:11 +01:00
}