1 19 20 21 class A { 22 } 23 24 interface I1 { 25 } 26 27 interface I2 { 28 } 29 30 interface I12 extends I1, I2 { 31 } 32 33 class B extends A implements I1 { 34 } 35 36 class C extends B implements I2, I12 { 37 } 38 39 class D extends A implements I12 { 40 } 41 42 class E extends A implements I2 { 43 } 44 45 public class LocalTypes { 46 A a; 47 B b; 48 C c; 49 D d; 50 E e; 51 52 I1 i1; 53 I2 i2; 54 I12 i12; 55 56 boolean g_bo; 57 byte g_by; 58 short g_sh; 59 int g_in; 60 61 int z; 62 int[]ain; 63 64 public void arithTest() { 65 int a=1,b=2; 66 boolean xb = true,yb = false; 67 int xi = 1,yi = 0; 68 int c=0; 69 arithTest(); 70 if ((xb & yb) || (xi & yi) != 0) { 71 c = 5; 72 arithTest(); 73 xb &= yb; 74 xi &= yi; 75 arithTest(); 76 xb = xb | yb; 77 xi = xi | yi; 78 arithTest(); 79 xb ^= yb; 80 xi ^= yi; 81 arithTest(); 82 xb = xb && yb; 83 xi = (xi != 0) && (yi != 0) ? 1 : 0; 84 arithTest(); 85 b <<= a; 86 b <<= c; 87 } 88 xi++; 89 a&=b; 90 } 91 92 public void intTypeTest() { 93 boolean b = false; 94 boolean abo[] = null; 95 byte aby[] = null; 96 byte by; 97 int in; 98 short sh; 99 b = g_bo; 100 in = g_sh; 101 sh = (short)g_in; 102 by = (byte)sh; 103 sh = by; 104 in = by; 105 abo[0] = g_bo; 106 abo[1] = false; 107 abo[2] = true; 108 aby[0] = g_by; 109 aby[1] = 0; 110 aby[2] = 1; 111 } 112 113 native void arrFunc(B[] b); 114 115 119 void DifficultType () { 120 B myB = c; 121 C myC = c; 122 I2 myI2 = c; 123 I12 myI12 = c; 124 boolean bool = true; 125 B[] aB = new C[3]; 126 arrFunc(new C[3]); 127 128 while (bool) { 129 if (bool) { 130 i1 = myB; 131 i2 = myC; 132 i1 = aB[0]; 133 } else if (bool) { 134 i1 = myI12; 135 i2 = myI2; 136 } else { 137 i1 = myC; 138 i2 = myI12; 139 } 140 myB = b; 141 if (bool) 142 myI2 = i12; 143 else { 144 myI12 = d; 145 myI2 = e; 146 } 147 } 148 } 149 150 154 void DifficultArrayType () { 155 boolean bool = true; 156 B[] aB = new C[3]; 157 arrFunc(new C[3]); 158 C[][][][][] x = new C[4][3][4][][]; 159 int[][][][][] y = new int[1][2][][][]; 160 161 while (bool) { 162 if (bool) { 163 i1 = aB[0]; 164 aB[0] = b; 165 } 166 } 167 } 168 169 public void castTests() { 170 System.err.println(null instanceof int[]); 171 System.err.println(((Object )new int[4]) instanceof byte[]); 172 System.err.println(((Object )new byte[4]) instanceof int[]); 173 System.err.println(((Object )new int[4]) instanceof LocalTypes); 174 System.err.println(((Object )new int[4]) instanceof int[][]); 175 System.err.println(new Object [4] instanceof int[][]); 176 System.err.println(new int[5][4] instanceof java.io.Serializable []); 177 System.err.println(((Object )this) instanceof RuntimeException ); 178 System.err.println(((RuntimeException )(Object )this).getMessage()); 179 ((java.io.PrintStream )null).println("Hallo"); 180 ((LocalTypes) null).a = ((LocalTypes) null).b; 181 } 182 } 183 184 | Popular Tags |