From c0c83126a69a0c652f343e972f727ffd7f5f10af Mon Sep 17 00:00:00 2001
From: Roman Shevchenko <roman.shevchenko@jetbrains.com>
Date: Mon, 1 Sep 2014 19:48:39 +0400
Subject: [PATCH] java-decompiler: post-import cleanup (test sources
 reformatted)

---
 testData/classes/pkg/TestClassLambda.class | Bin 3714 -> 3723 bytes
 testData/results/TestClassLambda.dec       |   4 +-
 testData/src/pkg/TestClassFields.java      |  12 +--
 testData/src/pkg/TestClassLambda.java      |  99 ++++++++++-----------
 testData/src/pkg/TestClassLoop.java        |  78 ++++++++--------
 testData/src/pkg/TestClassSwitch.java      |  19 ++--
 testData/src/pkg/TestClassTypes.java       |  84 ++++++++---------
 testData/src/pkg/TestClassVar.java         |  74 +++++++--------
 8 files changed, 181 insertions(+), 189 deletions(-)

diff --git a/testData/classes/pkg/TestClassLambda.class b/testData/classes/pkg/TestClassLambda.class
index cbb9448a2068b4d1f061c6f57efcbaa1de717bfa..b506ea80c80578af10664df2edb80b36cbb0bd52 100644
GIT binary patch
delta 222
zcmWNK%Su8~7)IBwv$Nwq+e;U_c`5@vg2gcnQ@Wf;s)3LNIq(6327(~?05xs+H|-sY
zMm<SmdyGcy$;V<1*7p*=h97-THRR6QNG&`)jz;6dudz4Nx`4;J4AN7(#Ti8|*{08)
z{G>a!jHW_B#4=S0O{{D9?9080{n$|*MN>*<Mc&PtZaQ-$-=^&!Gf$f(I`U_3^QSDj
za-MTGNvLum!yr;!c@AQABcE=2G7C;rBB5=mnmpJ<Me=5oY$Z3x71!?N0BFgtjj|cn
Oh8<GuvPwyEnaMw8swfx$

delta 205
zcmeB{ZIa#K&%$UpIe<lyjWr`RCntY%0n0;HRxSn>2A;`bT&27M47Ln{3{DKf4E_uv
zlW%ZY@=7qUGDtD-FvtMKWGBmU>$55_a55-P4g#`NfGpL?Z9tX=kfk|!7q<nc4g)iT
zE`tz*-sIoheu9P!91KQ46ODmpm@sHCm`;x3QD?N6+{B~LXft^ekaU>*h{u}IWU?Hu
v8Kc7FP+ogRnaNXm?fInym>66c+!z>vrZE6bd(5lO&IaT$FbGeU<SPOIabP78

diff --git a/testData/results/TestClassLambda.dec b/testData/results/TestClassLambda.dec
index 6124268..7310d2d 100644
--- a/testData/results/TestClassLambda.dec
+++ b/testData/results/TestClassLambda.dec
@@ -26,10 +26,10 @@ public class TestClassLambda {
    public void testLambda1() {
       int var1 = (int)Math.random();
       Runnable var2 = () -> {
-         System.out.println("hello" + var1);
+         System.out.println("hello1" + var1);
       };
       Runnable var3 = () -> {
-         System.out.println("hello1" + var1);
+         System.out.println("hello2" + var1);
       };
    }
 
diff --git a/testData/src/pkg/TestClassFields.java b/testData/src/pkg/TestClassFields.java
index 347b687..a1f2fac 100644
--- a/testData/src/pkg/TestClassFields.java
+++ b/testData/src/pkg/TestClassFields.java
@@ -17,12 +17,12 @@ package pkg;
 
 public class TestClassFields {
 
-    private static int[] sizes;
-    private static String[] names;
+  private static int[] sizes;
+  private static String[] names;
 
-    static {
+  static {
 
-    	names = new String[]{"name1", "name2"};
-    	sizes = new int[names.length];
-    }
+    names = new String[]{"name1", "name2"};
+    sizes = new int[names.length];
+  }
 }
diff --git a/testData/src/pkg/TestClassLambda.java b/testData/src/pkg/TestClassLambda.java
index d3fc7f6..589766e 100644
--- a/testData/src/pkg/TestClassLambda.java
+++ b/testData/src/pkg/TestClassLambda.java
@@ -15,68 +15,63 @@
  */
 package pkg;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.OptionalInt;
+import java.util.*;
 import java.util.function.IntBinaryOperator;
 import java.util.function.Supplier;
 
 public class TestClassLambda {
 
-	public int field = 0;
-	
-	public void testLambda() {
-		
-		List<Integer> 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 int field = 0;
 
-	public void testLambda1() {
-		
-		int a = (int)Math.random();
-		
-		Runnable r = () -> { System.out.println("hello" + a); };
+  public void testLambda() {
+    List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7);
+    int b = (int)Math.random();
 
-		Runnable r1 = () -> { System.out.println("hello1" + a); };
-	}
+    list.forEach(n -> {
+      int a = 2 * n;
+      System.out.println(a + b + field);
+    });
+  }
 
-	public void testLambda2() { 
-		reduce((left, right) -> Math.max(left, right));
-	}
+  public void testLambda1() {
+    int a = (int)Math.random();
+    Runnable r1 = () -> { System.out.println("hello1" + a); };
+    Runnable r2 = () -> { System.out.println("hello2" + a); };
+  }
 
-	public void testLambda3() { // IDEA-127301
-		reduce(Math::max);
-	}
+  public void testLambda2() {
+    reduce((left, right) -> Math.max(left, right));
+  }
 
-	public void testLambda4() { 
-		reduce(TestClassLambda::localMax);
-	}
-	
-	public void testLambda5() { 
-		String x = "abcd";
-		function(x::toString);
-	}
-	
-	public void testLambda6() {
-        List<String> list = new ArrayList<String>();
-        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<String> supplier) {
-	    return supplier.get();
-	}
+  public void testLambda3() { // IDEA-127301
+    reduce(Math::max);
+  }
 
-	public static int localMax(int first, int second) {
-	    return 0;
-	}
+  public void testLambda4() {
+    reduce(TestClassLambda::localMax);
+  }
 
+  public void testLambda5() {
+    String x = "abcd";
+    function(x::toString);
+  }
+
+  public void testLambda6() {
+    List<String> list = new ArrayList<String>();
+    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<String> supplier) {
+    return supplier.get();
+  }
+
+  public static int localMax(int first, int second) {
+    return 0;
+  }
 }
diff --git a/testData/src/pkg/TestClassLoop.java b/testData/src/pkg/TestClassLoop.java
index 25964d9..0ecab7d 100644
--- a/testData/src/pkg/TestClassLoop.java
+++ b/testData/src/pkg/TestClassLoop.java
@@ -17,47 +17,45 @@ package pkg;
 
 public class TestClassLoop {
 
-	public static void testSimpleInfinite() {
+  public static void testSimpleInfinite() {
 
-		while(true) {
-     	   System.out.println();
+    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;
         }
+      }
 
-	}
-	
-	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");
-		}
-		
-	}
-	
+      System.out.println("4");
+    }
+  }
 }
diff --git a/testData/src/pkg/TestClassSwitch.java b/testData/src/pkg/TestClassSwitch.java
index aa49bb1..0c95d25 100644
--- a/testData/src/pkg/TestClassSwitch.java
+++ b/testData/src/pkg/TestClassSwitch.java
@@ -17,15 +17,14 @@ package pkg;
 
 public class TestClassSwitch {
 
-    public void testCaseOrder(int a) {
-    	
-        switch(a) {
-            case 13:
-            	System.out.println(13);
-            	return;
-            case 5:
-                System.out.println(5);
-        }
+  public void testCaseOrder(int a) {
+
+    switch (a) {
+      case 13:
+        System.out.println(13);
+        return;
+      case 5:
+        System.out.println(5);
     }
-	
+  }
 }
diff --git a/testData/src/pkg/TestClassTypes.java b/testData/src/pkg/TestClassTypes.java
index 70e23c3..a745aeb 100644
--- a/testData/src/pkg/TestClassTypes.java
+++ b/testData/src/pkg/TestClassTypes.java
@@ -20,50 +20,50 @@ import java.util.List;
 
 public class TestClassTypes {
 
-    public void testBoolean() {
+  public void testBoolean() {
 
-    	byte var7 = 0;
-        long time = System.currentTimeMillis();
-        
-        if(time % 2 > 0) {
-            var7 = 1;
-        } else if(time % 3 > 0) {
-            var7 = 2;
-        }
+    byte var7 = 0;
+    long time = System.currentTimeMillis();
 
-        if(var7 == 1) {
-        	System.out.println();
-        }
+    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");
     }
-	
-	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());
-	}
-   
+    System.out.println(a.size());
+  }
 }
diff --git a/testData/src/pkg/TestClassVar.java b/testData/src/pkg/TestClassVar.java
index 9f8fcac..09dcded 100644
--- a/testData/src/pkg/TestClassVar.java
+++ b/testData/src/pkg/TestClassVar.java
@@ -18,42 +18,42 @@ package pkg;
 
 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();
-        		}
-        	}
-        	
+  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();
-			}
-		}
-	}
-	
+      }
+    }
+  }
+
+  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();
+      }
+    }
+  }
 }