From 3854b67daac14188d47a86bb6b84ccb00c087f5f Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 1 Sep 2014 15:05:08 +0400 Subject: java-decompiler: post-import cleanup (tests reorganized) --- test/unit/classes/TestClassFields.java | 13 ------- test/unit/classes/TestClassLambda.java | 67 ---------------------------------- test/unit/classes/TestClassLoop.java | 48 ------------------------ test/unit/classes/TestClassSwitch.java | 16 -------- test/unit/classes/TestClassTypes.java | 54 --------------------------- test/unit/classes/TestClassVar.java | 44 ---------------------- 6 files changed, 242 deletions(-) delete mode 100644 test/unit/classes/TestClassFields.java delete mode 100644 test/unit/classes/TestClassLambda.java delete mode 100644 test/unit/classes/TestClassLoop.java delete mode 100644 test/unit/classes/TestClassSwitch.java delete mode 100644 test/unit/classes/TestClassTypes.java delete mode 100644 test/unit/classes/TestClassVar.java (limited to 'test/unit/classes') diff --git a/test/unit/classes/TestClassFields.java b/test/unit/classes/TestClassFields.java deleted file mode 100644 index 8ae7449..0000000 --- a/test/unit/classes/TestClassFields.java +++ /dev/null @@ -1,13 +0,0 @@ -package unit.classes; - -public class TestClassFields { - - private static int[] sizes; - private static String[] names; - - static { - - names = new String[]{"name1", "name2"}; - sizes = new int[names.length]; - } -} diff --git a/test/unit/classes/TestClassLambda.java b/test/unit/classes/TestClassLambda.java deleted file mode 100644 index a2b9d9a..0000000 --- a/test/unit/classes/TestClassLambda.java +++ /dev/null @@ -1,67 +0,0 @@ -package unit.classes; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.OptionalInt; -import java.util.function.IntBinaryOperator; -import java.util.function.Supplier; - -public class TestClassLambda { - - public int field = 0; - - public void testLambda() { - - List list = Arrays.asList(1, 2, 3, 4, 5, 6, 7); - int b = (int)Math.random(); - - list.forEach(n -> {int a = 2 * n; System.out.println(a + b + field);}); - } - - public void testLambda1() { - - int a = (int)Math.random(); - - Runnable r = () -> { System.out.println("hello" + a); }; - - Runnable r1 = () -> { System.out.println("hello1" + a); }; - } - - public void testLambda2() { - reduce((left, right) -> Math.max(left, right)); - } - - public void testLambda3() { // IDEA-127301 - reduce(Math::max); - } - - public void testLambda4() { - reduce(TestClassLambda::localMax); - } - - public void testLambda5() { - String x = "abcd"; - function(x::toString); - } - - public void testLambda6() { - List list = new ArrayList(); - int bottom = list.size() * 2; - int top = list.size() * 5; - list.removeIf( s -> (bottom >= s.length() && s.length() <= top) ); - } - - public static OptionalInt reduce(IntBinaryOperator op) { - return null; - } - - public static String function(Supplier supplier) { - return supplier.get(); - } - - public static int localMax(int first, int second) { - return 0; - } - -} diff --git a/test/unit/classes/TestClassLoop.java b/test/unit/classes/TestClassLoop.java deleted file mode 100644 index 5288cf6..0000000 --- a/test/unit/classes/TestClassLoop.java +++ /dev/null @@ -1,48 +0,0 @@ -package unit.classes; - -public class TestClassLoop { - - public static void testSimpleInfinite() { - - while(true) { - System.out.println(); - } - - } - - public static void testFinally() { - - boolean a = (Math.random() > 0); - - while(true) { - try { - if(!a) { - return; - } - } finally { - System.out.println("1"); - } - } - - } - - 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"); - } - - } - -} diff --git a/test/unit/classes/TestClassSwitch.java b/test/unit/classes/TestClassSwitch.java deleted file mode 100644 index 3e29d5e..0000000 --- a/test/unit/classes/TestClassSwitch.java +++ /dev/null @@ -1,16 +0,0 @@ -package unit.classes; - -public class TestClassSwitch { - - public void testCaseOrder(int a) { - - switch(a) { - case 13: - System.out.println(13); - return; - case 5: - System.out.println(5); - } - } - -} diff --git a/test/unit/classes/TestClassTypes.java b/test/unit/classes/TestClassTypes.java deleted file mode 100644 index a8a5116..0000000 --- a/test/unit/classes/TestClassTypes.java +++ /dev/null @@ -1,54 +0,0 @@ -package unit.classes; - -import java.util.ArrayList; -import java.util.List; - -public class TestClassTypes { - - public void testBoolean() { - - byte var7 = 0; - long time = System.currentTimeMillis(); - - if(time % 2 > 0) { - var7 = 1; - } else if(time % 3 > 0) { - var7 = 2; - } - - if(var7 == 1) { - System.out.println(); - } - } - - public boolean testBit(int var0) { - return (var0 & 1) == 1; - } - - public void testSwitchConsts(int a) { - - switch (a) { - case 88: - System.out.println("1"); - break; - case 656: - System.out.println("2"); - break; - case 65201: - case 65489: - System.out.println("3"); - } - } - - public void testAssignmentType(List list) { - - List a = list; - - if(a != null) { - (a = new ArrayList(a)).add("23"); - } - - System.out.println(a.size()); - } - -} diff --git a/test/unit/classes/TestClassVar.java b/test/unit/classes/TestClassVar.java deleted file mode 100644 index fdba5c6..0000000 --- a/test/unit/classes/TestClassVar.java +++ /dev/null @@ -1,44 +0,0 @@ -package unit.classes; - - -public class TestClassVar { - - private boolean field_boolean = (Math.random() > 0); - public int field_int = 0; - - public void testFieldSSAU() { - - for(int i = 0; i < 10; i++) { - - try { - System.out.println(); - } finally { - if (field_boolean) { - System.out.println(); - } - } - - } - } - - public Long testFieldSSAU1() { // IDEA-127466 - return new Long(field_int++); - } - - public void testComplexPropagation() { - - int a = 0; - - while (a < 10) { - - int b = a; - - for(; a < 10 && a == 0; a++) {} - - if (b != a) { - System.out.println(); - } - } - } - -} -- cgit v1.2.3