java-decompiler: post-import cleanup (test sources reformatted)

master
Roman Shevchenko 10 years ago
parent e629738a46
commit c0c83126a6
  1. BIN
      testData/classes/pkg/TestClassLambda.class
  2. 4
      testData/results/TestClassLambda.dec
  3. 19
      testData/src/pkg/TestClassLambda.java
  4. 20
      testData/src/pkg/TestClassLoop.java
  5. 3
      testData/src/pkg/TestClassSwitch.java
  6. 10
      testData/src/pkg/TestClassTypes.java
  7. 10
      testData/src/pkg/TestClassVar.java

@ -26,10 +26,10 @@ public class TestClassLambda {
public void testLambda1() { public void testLambda1() {
int var1 = (int)Math.random(); int var1 = (int)Math.random();
Runnable var2 = () -> { Runnable var2 = () -> {
System.out.println("hello" + var1); System.out.println("hello1" + var1);
}; };
Runnable var3 = () -> { Runnable var3 = () -> {
System.out.println("hello1" + var1); System.out.println("hello2" + var1);
}; };
} }

@ -15,10 +15,7 @@
*/ */
package pkg; package pkg;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.OptionalInt;
import java.util.function.IntBinaryOperator; import java.util.function.IntBinaryOperator;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -27,20 +24,19 @@ public class TestClassLambda {
public int field = 0; public int field = 0;
public void testLambda() { public void testLambda() {
List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7); List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7);
int b = (int)Math.random(); int b = (int)Math.random();
list.forEach(n -> {int a = 2 * n; System.out.println(a + b + field);}); list.forEach(n -> {
int a = 2 * n;
System.out.println(a + b + field);
});
} }
public void testLambda1() { public void testLambda1() {
int a = (int)Math.random(); int a = (int)Math.random();
Runnable r = () -> { System.out.println("hello" + a); };
Runnable r1 = () -> { System.out.println("hello1" + a); }; Runnable r1 = () -> { System.out.println("hello1" + a); };
Runnable r2 = () -> { System.out.println("hello2" + a); };
} }
public void testLambda2() { public void testLambda2() {
@ -64,7 +60,7 @@ public class TestClassLambda {
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<String>();
int bottom = list.size() * 2; int bottom = list.size() * 2;
int top = list.size() * 5; int top = list.size() * 5;
list.removeIf( s -> (bottom >= s.length() && s.length() <= top) ); list.removeIf(s -> (bottom >= s.length() && s.length() <= top));
} }
public static OptionalInt reduce(IntBinaryOperator op) { public static OptionalInt reduce(IntBinaryOperator op) {
@ -78,5 +74,4 @@ public class TestClassLambda {
public static int localMax(int first, int second) { public static int localMax(int first, int second) {
return 0; return 0;
} }
} }

@ -19,37 +19,37 @@ public class TestClassLoop {
public static void testSimpleInfinite() { public static void testSimpleInfinite() {
while(true) { while (true) {
System.out.println(); System.out.println();
} }
} }
public static void testFinally() { public static void testFinally() {
boolean a = (Math.random() > 0); boolean a = (Math.random() > 0);
while(true) { while (true) {
try { try {
if(!a) { if (!a) {
return; return;
} }
} finally { }
finally {
System.out.println("1"); System.out.println("1");
} }
} }
} }
public static void testFinallyContinue() { public static void testFinallyContinue() {
boolean a = (Math.random() > 0); boolean a = (Math.random() > 0);
for(;;) { for (; ; ) {
try { try {
System.out.println("1"); System.out.println("1");
} finally { }
if(a) { finally {
if (a) {
System.out.println("3"); System.out.println("3");
continue; continue;
} }
@ -57,7 +57,5 @@ public class TestClassLoop {
System.out.println("4"); System.out.println("4");
} }
} }
} }

@ -19,7 +19,7 @@ public class TestClassSwitch {
public void testCaseOrder(int a) { public void testCaseOrder(int a) {
switch(a) { switch (a) {
case 13: case 13:
System.out.println(13); System.out.println(13);
return; return;
@ -27,5 +27,4 @@ public class TestClassSwitch {
System.out.println(5); System.out.println(5);
} }
} }
} }

@ -25,13 +25,14 @@ public class TestClassTypes {
byte var7 = 0; byte var7 = 0;
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
if(time % 2 > 0) { if (time % 2 > 0) {
var7 = 1; var7 = 1;
} else if(time % 3 > 0) { }
else if (time % 3 > 0) {
var7 = 2; var7 = 2;
} }
if(var7 == 1) { if (var7 == 1) {
System.out.println(); System.out.println();
} }
} }
@ -59,11 +60,10 @@ public class TestClassTypes {
List a = list; List a = list;
if(a != null) { if (a != null) {
(a = new ArrayList(a)).add("23"); (a = new ArrayList(a)).add("23");
} }
System.out.println(a.size()); System.out.println(a.size());
} }
} }

@ -23,16 +23,16 @@ public class TestClassVar {
public void testFieldSSAU() { public void testFieldSSAU() {
for(int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
try { try {
System.out.println(); System.out.println();
} finally { }
finally {
if (field_boolean) { if (field_boolean) {
System.out.println(); System.out.println();
} }
} }
} }
} }
@ -48,12 +48,12 @@ public class TestClassVar {
int b = a; int b = a;
for(; a < 10 && a == 0; a++) {} for (; a < 10 && a == 0; a++) {
}
if (b != a) { if (b != a) {
System.out.println(); System.out.println();
} }
} }
} }
} }

Loading…
Cancel
Save