1 2 class Blort { 3 /** Class constructors for enums use a lot of const's */ 4 enum Foo { 5 ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT 6 } 7 8 /** all uses of 10 should be combined except the local assignment */ testNumeric()9 void testNumeric() { 10 int foo = 10; 11 12 for (int i = 0; i < 10; i++){ 13 foo += i * 10; 14 } 15 16 for (int i = 0; i < 10; i++){ 17 foo += i + 10; 18 } 19 } 20 testStrings()21 void testStrings() { 22 StringBuilder sb = new StringBuilder(); 23 24 sb.append("foo"); 25 sb.append("foo"); 26 sb.append("foo"); 27 sb.append("foo"); 28 sb.append("foo"); 29 sb.append("foo"); 30 } 31 testCaughtStrings()32 void testCaughtStrings() { 33 StringBuilder sb = new StringBuilder(); 34 35 sb.append("foo"); 36 sb.append("foo"); 37 sb.append("foo"); 38 try { 39 sb.append("foo"); 40 sb.append("foo"); 41 sb.append("foo"); 42 } catch (Throwable tr) { 43 System.out.println("foo"); 44 } 45 } 46 47 /** local variables cannot be intermingled */ testLocalVars()48 void testLocalVars() { 49 int i = 10; 50 int j = 10; 51 int k = 10; 52 int a = 10; 53 int b = 10; 54 int c = 10; 55 56 i *= 10; 57 } 58 testNull(Object a)59 void testNull(Object a) { 60 a.equals(null); 61 a.equals(null); 62 63 } 64 } 65