1 package com.github.sevntu.checkstyle.checks.coding; 2 public class testUBV { 3 int f1() { 4 int x = 0; 5 for (int i = (0+1); ((i) < (6+6)); i += (1+0)) { 6 x += (i + 100); 7 (x) += (i + 100); 8 x = (x + i + 100); 9 (x) = (x + i + 100); 10 } 11 12 for (int i = (0+1); (i) < ((6+6)); i += (1+0)) { 13 System.out.println("hi"); 14 } 15 16 return (0); 17 } 18 19 private int f2(int arg1, double arg2) { 20 int x, a, b, c, d; 21 String e, f; 22 23 x = 0; 24 a = 0; 25 b = 0; 26 c = (a + b); 27 d = c - 1; 28 29 int i = (int) arg2; 30 i = ((int) arg2); 31 32 x += (i + 100 + arg1); 33 a = (a + b) * (c + d); 34 b = ((((a + b) * (c + d)))); 35 c = (((a) <= b)) ? 0 : 1; 36 d = (a) + (b) * (600) / (int) (12.5f) + (int) (arg2); 37 e = ("this") + ("that") + ("is" + "other"); 38 f = ("this is a really, really long string that should be truncated."); 39 40 return (x + a + b + d); 41 } 42 43 private boolean f3() { 44 int x = f2((1), (13.5)); 45 boolean b = (true); 46 return (b); 47 } 48 49 public static int f4(int z, int a) { 50 int r = (z * a); 51 r = (a > z) ? a : z; 52 r = ((a > z) ? a : z); 53 r = (a > z) ? a : (z + z); 54 return (r * r - 1); 55 } 56 57 public void f5() { 58 int x, y; 59 x = 0; 60 y = 0; 61 if (x == y) { 62 print(x); 63 } 64 if ((x > y)) { 65 print(y); 66 } 67 68 while ((x < 10)) { 69 print(x++); 70 } 71 72 do { 73 print((y+=100)); 74 } while (y < (4000)); 75 } 76 77 private void f6(TypeA a) { 78 TypeB b = (TypeB) a; 79 TypeC c = ((TypeC) a); 80 int r = 12345; 81 r <<= (3); 82 TypeD<String> d = ((TypeD<String>) a); 83 } 84 85 private void print(int arg) 86 { 87 System.out.println("arg = " + arg); 88 } 89 90 boolean f7(boolean f) { 91 boolean a=true; 92 boolean b = (a != f); 93 b = (a == f); 94 b = a == f; 95 f = 2 == 3; 96 f = (2 >= 3); 97 f = b != true; 98 f = (f != b); 99 assert (1 == 1); 100 assert ((1 == 1)); 101 if(f) 102 { 103 return b = ( b != f ); 104 } 105 else 106 { 107 return f != false; 108 } 109 } 110 111 boolean test (int y, boolean flag, TypeA x) { 112 boolean b = (x == null); 113 if(flag != (y == 0)) 114 { 115 return ("" == null && "null" == null); 116 } 117 else 118 { 119 return (flag != b); 120 } 121 } 122 123 124 125 126 127 static class TypeA {} 128 static class TypeB extends TypeA {} 129 static class TypeC extends TypeA {} 130 static class TypeD<T> extends TypeA {} 131 }