Wed, 26 Jan 2011 13:45:25 -0800
7013272: Automatically generate info about how compiler resource keys are used
Reviewed-by: mcimadamore
duke@1 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@1 | 7 | * published by the Free Software Foundation. |
duke@1 | 8 | * |
duke@1 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 13 | * accompanied this code). |
duke@1 | 14 | * |
duke@1 | 15 | * You should have received a copy of the GNU General Public License version |
duke@1 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 18 | * |
ohair@554 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 20 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 21 | * questions. |
duke@1 | 22 | */ |
duke@1 | 23 | |
duke@1 | 24 | /* |
duke@1 | 25 | * @test |
duke@1 | 26 | * @bug 4319507 |
duke@1 | 27 | * @summary Verify correct implementation of JLS2e 6.6.2.1 |
duke@1 | 28 | * @author maddox |
duke@1 | 29 | * |
duke@1 | 30 | * @run compile ProtectedMemberAccess1.java |
duke@1 | 31 | */ |
duke@1 | 32 | |
duke@1 | 33 | import pkg.SuperClass; |
duke@1 | 34 | |
duke@1 | 35 | class ProtectedMemberAccess1a extends SuperClass { |
duke@1 | 36 | |
duke@1 | 37 | // Access to a protected member via its simple name |
duke@1 | 38 | // is always legal in a subclass of the class in |
duke@1 | 39 | // which the member is declared. |
duke@1 | 40 | |
duke@1 | 41 | int i = pi; |
duke@1 | 42 | int j = spi; |
duke@1 | 43 | |
duke@1 | 44 | int x = pm(); |
duke@1 | 45 | int y = spm(); |
duke@1 | 46 | |
duke@1 | 47 | pC obj1; |
duke@1 | 48 | spC obj2; |
duke@1 | 49 | |
duke@1 | 50 | pI obj3; |
duke@1 | 51 | spI obj4; |
duke@1 | 52 | |
duke@1 | 53 | Object o1 = (pC) null; |
duke@1 | 54 | Object o2 = (spC) null; |
duke@1 | 55 | |
duke@1 | 56 | Object o3 = (pI) null; |
duke@1 | 57 | Object o4 = (spI) null; |
duke@1 | 58 | |
duke@1 | 59 | class C1 extends pC {} |
duke@1 | 60 | class C2 extends spC {} |
duke@1 | 61 | |
duke@1 | 62 | interface I1 extends pI {} |
duke@1 | 63 | interface I2 extends spI {} |
duke@1 | 64 | |
duke@1 | 65 | static { |
duke@1 | 66 | |
duke@1 | 67 | spi = 2; |
duke@1 | 68 | |
duke@1 | 69 | int y = spm(); |
duke@1 | 70 | |
duke@1 | 71 | pC obj1; |
duke@1 | 72 | spC obj2; |
duke@1 | 73 | |
duke@1 | 74 | pI obj3; |
duke@1 | 75 | spI obj4; |
duke@1 | 76 | |
duke@1 | 77 | Object o1 = (pC) null; |
duke@1 | 78 | Object o2 = (spC) null; |
duke@1 | 79 | |
duke@1 | 80 | Object o3 = (pI) null; |
duke@1 | 81 | Object o4 = (spI) null; |
duke@1 | 82 | |
duke@1 | 83 | //class C1 extends pC {} |
duke@1 | 84 | class C2 extends spC {} |
duke@1 | 85 | |
duke@1 | 86 | //interface I1 extends pI {} |
duke@1 | 87 | //interface I2 extends spI {} |
duke@1 | 88 | |
duke@1 | 89 | } |
duke@1 | 90 | |
duke@1 | 91 | void m() { |
duke@1 | 92 | |
duke@1 | 93 | pi = 1; |
duke@1 | 94 | spi = 2; |
duke@1 | 95 | |
duke@1 | 96 | int x = pm(); |
duke@1 | 97 | int y = spm(); |
duke@1 | 98 | |
duke@1 | 99 | pC obj1; |
duke@1 | 100 | spC obj2; |
duke@1 | 101 | |
duke@1 | 102 | pI obj3; |
duke@1 | 103 | spI obj4; |
duke@1 | 104 | |
duke@1 | 105 | Object o1 = (pC) null; |
duke@1 | 106 | Object o2 = (spC) null; |
duke@1 | 107 | |
duke@1 | 108 | Object o3 = (pI) null; |
duke@1 | 109 | Object o4 = (spI) null; |
duke@1 | 110 | |
duke@1 | 111 | class C1 extends pC {} |
duke@1 | 112 | class C2 extends spC {} |
duke@1 | 113 | |
duke@1 | 114 | //interface I1 extends pI {} |
duke@1 | 115 | //interface I2 extends spI {} |
duke@1 | 116 | |
duke@1 | 117 | } |
duke@1 | 118 | |
duke@1 | 119 | class Inner { |
duke@1 | 120 | |
duke@1 | 121 | int i = pi; |
duke@1 | 122 | int j = spi; |
duke@1 | 123 | |
duke@1 | 124 | int x = pm(); |
duke@1 | 125 | int y = spm(); |
duke@1 | 126 | |
duke@1 | 127 | pC obj1; |
duke@1 | 128 | spC obj2; |
duke@1 | 129 | |
duke@1 | 130 | pI obj3; |
duke@1 | 131 | spI obj4; |
duke@1 | 132 | |
duke@1 | 133 | Object o1 = (pC) null; |
duke@1 | 134 | Object o2 = (spC) null; |
duke@1 | 135 | |
duke@1 | 136 | Object o3 = (pI) null; |
duke@1 | 137 | Object o4 = (spI) null; |
duke@1 | 138 | |
duke@1 | 139 | class C1 extends pC {} |
duke@1 | 140 | class C2 extends spC {} |
duke@1 | 141 | |
duke@1 | 142 | //interface I1 extends pI {} |
duke@1 | 143 | //interface I2 extends spI {} |
duke@1 | 144 | |
duke@1 | 145 | // Not allowed in inner classes. |
duke@1 | 146 | // static { ... } |
duke@1 | 147 | |
duke@1 | 148 | void m() { |
duke@1 | 149 | |
duke@1 | 150 | pi = 1; |
duke@1 | 151 | spi = 2; |
duke@1 | 152 | |
duke@1 | 153 | int x = pm(); |
duke@1 | 154 | int y = spm(); |
duke@1 | 155 | |
duke@1 | 156 | pC obj1; |
duke@1 | 157 | spC obj2; |
duke@1 | 158 | |
duke@1 | 159 | pI obj3; |
duke@1 | 160 | spI obj4; |
duke@1 | 161 | |
duke@1 | 162 | Object o1 = (pC) null; |
duke@1 | 163 | Object o2 = (spC) null; |
duke@1 | 164 | |
duke@1 | 165 | Object o3 = (pI) null; |
duke@1 | 166 | Object o4 = (spI) null; |
duke@1 | 167 | |
duke@1 | 168 | class C1 extends pC {} |
duke@1 | 169 | class C2 extends spC {} |
duke@1 | 170 | |
duke@1 | 171 | //interface I1 extends pI {} |
duke@1 | 172 | //interface I2 extends spI {} |
duke@1 | 173 | } |
duke@1 | 174 | } |
duke@1 | 175 | |
duke@1 | 176 | } |
duke@1 | 177 | |
duke@1 | 178 | class ProtectedMemberAccess2a extends pkg.SuperClass { |
duke@1 | 179 | |
duke@1 | 180 | // Access to a protected instance (non-static) field, instance method, |
duke@1 | 181 | // or member type by a qualified name is always legal in a subclass of |
duke@1 | 182 | // the class in which the member is declared. Such access to a protected |
duke@1 | 183 | // instance field or instance method is allowed if the qualifying type |
duke@1 | 184 | // or the type of the qualifying expression is (a subclass of) the class |
duke@1 | 185 | // in which the reference occurs. |
duke@1 | 186 | |
duke@1 | 187 | ProtectedMemberAccess2a x = |
duke@1 | 188 | new ProtectedMemberAccess2a(); |
duke@1 | 189 | |
duke@1 | 190 | static ProtectedMemberAccess2a sx = |
duke@1 | 191 | new ProtectedMemberAccess2a(); |
duke@1 | 192 | |
duke@1 | 193 | int i = x.pi; |
duke@1 | 194 | int j = x.spi; |
duke@1 | 195 | |
duke@1 | 196 | int n = sx.pi; |
duke@1 | 197 | int m = sx.spi; |
duke@1 | 198 | |
duke@1 | 199 | static int sn = sx.pi; |
duke@1 | 200 | static int sm = sx.spi; |
duke@1 | 201 | |
duke@1 | 202 | int w = x.pm(); |
duke@1 | 203 | int y = x.spm(); |
duke@1 | 204 | |
duke@1 | 205 | int u = sx.pm(); |
duke@1 | 206 | int v = sx.spm(); |
duke@1 | 207 | |
duke@1 | 208 | ProtectedMemberAccess2a.pC obj1; |
duke@1 | 209 | ProtectedMemberAccess2a.spC obj2; |
duke@1 | 210 | |
duke@1 | 211 | ProtectedMemberAccess2a.pI obj3; |
duke@1 | 212 | ProtectedMemberAccess2a.spI obj4; |
duke@1 | 213 | |
duke@1 | 214 | Object o1 = (ProtectedMemberAccess2a.pC) null; |
duke@1 | 215 | Object o2 = (ProtectedMemberAccess2a.spC) null; |
duke@1 | 216 | |
duke@1 | 217 | Object o3 = (ProtectedMemberAccess2a.pI) null; |
duke@1 | 218 | Object o4 = (ProtectedMemberAccess2a.spI) null; |
duke@1 | 219 | |
duke@1 | 220 | class C1 extends ProtectedMemberAccess2a.pC {} |
duke@1 | 221 | class C2 extends ProtectedMemberAccess2a.spC {} |
duke@1 | 222 | |
duke@1 | 223 | interface I1 extends ProtectedMemberAccess2a.pI {} |
duke@1 | 224 | interface I2 extends ProtectedMemberAccess2a.spI {} |
duke@1 | 225 | |
duke@1 | 226 | static { |
duke@1 | 227 | |
duke@1 | 228 | ProtectedMemberAccess2a lx = |
duke@1 | 229 | new ProtectedMemberAccess2a(); |
duke@1 | 230 | |
duke@1 | 231 | sx.pi = 1; |
duke@1 | 232 | sx.spi = 2; |
duke@1 | 233 | |
duke@1 | 234 | lx.pi = 1; |
duke@1 | 235 | lx.spi = 2; |
duke@1 | 236 | |
duke@1 | 237 | int n = sx.pi; |
duke@1 | 238 | int m = sx.spi; |
duke@1 | 239 | |
duke@1 | 240 | int k = lx.pi; |
duke@1 | 241 | int l = lx.spi; |
duke@1 | 242 | |
duke@1 | 243 | int u = sx.pm(); |
duke@1 | 244 | int v = sx.spm(); |
duke@1 | 245 | |
duke@1 | 246 | int w = lx.pm(); |
duke@1 | 247 | int z = lx.spm(); |
duke@1 | 248 | |
duke@1 | 249 | ProtectedMemberAccess2a.pC obj1; |
duke@1 | 250 | ProtectedMemberAccess2a.spC obj2; |
duke@1 | 251 | |
duke@1 | 252 | ProtectedMemberAccess2a.pI obj3; |
duke@1 | 253 | ProtectedMemberAccess2a.spI obj4; |
duke@1 | 254 | |
duke@1 | 255 | Object o1 = (ProtectedMemberAccess2a.pC) null; |
duke@1 | 256 | Object o2 = (ProtectedMemberAccess2a.spC) null; |
duke@1 | 257 | |
duke@1 | 258 | Object o3 = (ProtectedMemberAccess2a.pI) null; |
duke@1 | 259 | Object o4 = (ProtectedMemberAccess2a.spI) null; |
duke@1 | 260 | |
duke@1 | 261 | //class C1 extends ProtectedMemberAccess2a.pC {} |
duke@1 | 262 | class C2 extends ProtectedMemberAccess2a.spC {} |
duke@1 | 263 | |
duke@1 | 264 | //interface I1 extends ProtectedMemberAccess2a.pI {} |
duke@1 | 265 | //interface I2 extends ProtectedMemberAccess2a.spI {} |
duke@1 | 266 | |
duke@1 | 267 | } |
duke@1 | 268 | |
duke@1 | 269 | void m() { |
duke@1 | 270 | |
duke@1 | 271 | ProtectedMemberAccess2a lx = |
duke@1 | 272 | new ProtectedMemberAccess2a(); |
duke@1 | 273 | |
duke@1 | 274 | x.pi = 1; |
duke@1 | 275 | x.spi = 2; |
duke@1 | 276 | |
duke@1 | 277 | sx.pi = 1; |
duke@1 | 278 | sx.spi = 2; |
duke@1 | 279 | |
duke@1 | 280 | lx.pi = 1; |
duke@1 | 281 | lx.spi = 2; |
duke@1 | 282 | |
duke@1 | 283 | int t = x.pm(); |
duke@1 | 284 | int y = x.spm(); |
duke@1 | 285 | |
duke@1 | 286 | int u = sx.pm(); |
duke@1 | 287 | int v = sx.spm(); |
duke@1 | 288 | |
duke@1 | 289 | int w = lx.pm(); |
duke@1 | 290 | int z = lx.spm(); |
duke@1 | 291 | |
duke@1 | 292 | int i = x.pi; |
duke@1 | 293 | int j = x.spi; |
duke@1 | 294 | |
duke@1 | 295 | int n = sx.pi; |
duke@1 | 296 | int m = sx.spi; |
duke@1 | 297 | |
duke@1 | 298 | int k = lx.pi; |
duke@1 | 299 | int l = lx.spi; |
duke@1 | 300 | |
duke@1 | 301 | ProtectedMemberAccess2a.pC obj1; |
duke@1 | 302 | ProtectedMemberAccess2a.spC obj2; |
duke@1 | 303 | |
duke@1 | 304 | ProtectedMemberAccess2a.pI obj3; |
duke@1 | 305 | ProtectedMemberAccess2a.spI obj4; |
duke@1 | 306 | |
duke@1 | 307 | Object o1 = (ProtectedMemberAccess2a.pC) null; |
duke@1 | 308 | Object o2 = (ProtectedMemberAccess2a.spC) null; |
duke@1 | 309 | |
duke@1 | 310 | Object o3 = (ProtectedMemberAccess2a.pI) null; |
duke@1 | 311 | Object o4 = (ProtectedMemberAccess2a.spI) null; |
duke@1 | 312 | |
duke@1 | 313 | class C1 extends ProtectedMemberAccess2a.pC {} |
duke@1 | 314 | class C2 extends ProtectedMemberAccess2a.spC {} |
duke@1 | 315 | |
duke@1 | 316 | //interface I1 extends ProtectedMemberAccess2a.pI {} |
duke@1 | 317 | //interface I2 extends ProtectedMemberAccess2a.spI {} |
duke@1 | 318 | |
duke@1 | 319 | } |
duke@1 | 320 | |
duke@1 | 321 | class Inner { |
duke@1 | 322 | |
duke@1 | 323 | int i = x.pi; |
duke@1 | 324 | int j = x.spi; |
duke@1 | 325 | |
duke@1 | 326 | int n = sx.pi; |
duke@1 | 327 | int m = sx.spi; |
duke@1 | 328 | |
duke@1 | 329 | //static int sn = sx.pi; |
duke@1 | 330 | //static int sm = sx.spi; |
duke@1 | 331 | |
duke@1 | 332 | int w = x.pm(); |
duke@1 | 333 | int y = x.spm(); |
duke@1 | 334 | |
duke@1 | 335 | int u = sx.pm(); |
duke@1 | 336 | int v = sx.spm(); |
duke@1 | 337 | |
duke@1 | 338 | ProtectedMemberAccess2a.pC obj1; |
duke@1 | 339 | ProtectedMemberAccess2a.spC obj2; |
duke@1 | 340 | |
duke@1 | 341 | ProtectedMemberAccess2a.pI obj3; |
duke@1 | 342 | ProtectedMemberAccess2a.spI obj4; |
duke@1 | 343 | |
duke@1 | 344 | Object o1 = (ProtectedMemberAccess2a.pC) null; |
duke@1 | 345 | Object o2 = (ProtectedMemberAccess2a.spC) null; |
duke@1 | 346 | |
duke@1 | 347 | Object o3 = (ProtectedMemberAccess2a.pI) null; |
duke@1 | 348 | Object o4 = (ProtectedMemberAccess2a.spI) null; |
duke@1 | 349 | |
duke@1 | 350 | class C1 extends ProtectedMemberAccess2a.pC {} |
duke@1 | 351 | class C2 extends ProtectedMemberAccess2a.spC {} |
duke@1 | 352 | |
duke@1 | 353 | //interface I1 extends ProtectedMemberAccess2a.pI {} |
duke@1 | 354 | //interface I2 extends ProtectedMemberAccess2a.spI {} |
duke@1 | 355 | |
duke@1 | 356 | // Not allowed in inner classes. |
duke@1 | 357 | // static { ... } |
duke@1 | 358 | |
duke@1 | 359 | void m() { |
duke@1 | 360 | |
duke@1 | 361 | ProtectedMemberAccess2a lx = |
duke@1 | 362 | new ProtectedMemberAccess2a(); |
duke@1 | 363 | |
duke@1 | 364 | x.pi = 1; |
duke@1 | 365 | x.spi = 2; |
duke@1 | 366 | |
duke@1 | 367 | sx.pi = 1; |
duke@1 | 368 | sx.spi = 2; |
duke@1 | 369 | |
duke@1 | 370 | lx.pi = 1; |
duke@1 | 371 | lx.spi = 2; |
duke@1 | 372 | |
duke@1 | 373 | int t = x.pm(); |
duke@1 | 374 | int y = x.spm(); |
duke@1 | 375 | |
duke@1 | 376 | int u = sx.pm(); |
duke@1 | 377 | int v = sx.spm(); |
duke@1 | 378 | |
duke@1 | 379 | int w = lx.pm(); |
duke@1 | 380 | int z = lx.spm(); |
duke@1 | 381 | |
duke@1 | 382 | int i = x.pi; |
duke@1 | 383 | int j = x.spi; |
duke@1 | 384 | |
duke@1 | 385 | int n = sx.pi; |
duke@1 | 386 | int m = sx.spi; |
duke@1 | 387 | |
duke@1 | 388 | int k = lx.pi; |
duke@1 | 389 | int l = lx.spi; |
duke@1 | 390 | |
duke@1 | 391 | ProtectedMemberAccess2a.pC obj1; |
duke@1 | 392 | ProtectedMemberAccess2a.spC obj2; |
duke@1 | 393 | |
duke@1 | 394 | ProtectedMemberAccess2a.pI obj3; |
duke@1 | 395 | ProtectedMemberAccess2a.spI obj4; |
duke@1 | 396 | |
duke@1 | 397 | Object o1 = (ProtectedMemberAccess2a.pC) null; |
duke@1 | 398 | Object o2 = (ProtectedMemberAccess2a.spC) null; |
duke@1 | 399 | |
duke@1 | 400 | Object o3 = (ProtectedMemberAccess2a.pI) null; |
duke@1 | 401 | Object o4 = (ProtectedMemberAccess2a.spI) null; |
duke@1 | 402 | |
duke@1 | 403 | class C1 extends ProtectedMemberAccess2a.pC {} |
duke@1 | 404 | class C2 extends ProtectedMemberAccess2a.spC {} |
duke@1 | 405 | |
duke@1 | 406 | //interface I1 extends ProtectedMemberAccess2a.pI {} |
duke@1 | 407 | //interface I2 extends ProtectedMemberAccess2a.spI {} |
duke@1 | 408 | |
duke@1 | 409 | } |
duke@1 | 410 | |
duke@1 | 411 | } |
duke@1 | 412 | |
duke@1 | 413 | } |
duke@1 | 414 | |
duke@1 | 415 | |
duke@1 | 416 | class SubClass extends ProtectedMemberAccess3a { } |
duke@1 | 417 | |
duke@1 | 418 | class ProtectedMemberAccess3a extends pkg.SuperClass { |
duke@1 | 419 | |
duke@1 | 420 | // Access to a protected instance (non-static) field, instance method, |
duke@1 | 421 | // or member type by a qualified name is always legal in a subclass of |
duke@1 | 422 | // the class in which the member is declared. Such access to a protected |
duke@1 | 423 | // instance field or instance method is allowed if the qualifying type |
duke@1 | 424 | // or the type of the qualifying expression is (a subclass of) the class |
duke@1 | 425 | // in which the reference occurs. |
duke@1 | 426 | |
duke@1 | 427 | SubClass x = new SubClass(); |
duke@1 | 428 | |
duke@1 | 429 | static SubClass sx = new SubClass(); |
duke@1 | 430 | |
duke@1 | 431 | int i = x.pi; |
duke@1 | 432 | int j = x.spi; |
duke@1 | 433 | |
duke@1 | 434 | int n = sx.pi; |
duke@1 | 435 | int m = sx.spi; |
duke@1 | 436 | |
duke@1 | 437 | static int sn = sx.pi; |
duke@1 | 438 | static int sm = sx.spi; |
duke@1 | 439 | |
duke@1 | 440 | int w = x.pm(); |
duke@1 | 441 | int y = x.spm(); |
duke@1 | 442 | |
duke@1 | 443 | int u = sx.pm(); |
duke@1 | 444 | int v = sx.spm(); |
duke@1 | 445 | |
duke@1 | 446 | SubClass.pC obj1; |
duke@1 | 447 | SubClass.spC obj2; |
duke@1 | 448 | |
duke@1 | 449 | SubClass.pI obj3; |
duke@1 | 450 | SubClass.spI obj4; |
duke@1 | 451 | |
duke@1 | 452 | Object o1 = (SubClass.pC) null; |
duke@1 | 453 | Object o2 = (SubClass.spC) null; |
duke@1 | 454 | |
duke@1 | 455 | Object o3 = (SubClass.pI) null; |
duke@1 | 456 | Object o4 = (SubClass.spI) null; |
duke@1 | 457 | |
duke@1 | 458 | class C1 extends SubClass.pC {} |
duke@1 | 459 | class C2 extends SubClass.spC {} |
duke@1 | 460 | |
duke@1 | 461 | interface I1 extends SubClass.pI {} |
duke@1 | 462 | interface I2 extends SubClass.spI {} |
duke@1 | 463 | |
duke@1 | 464 | static { |
duke@1 | 465 | |
duke@1 | 466 | SubClass lx = new SubClass(); |
duke@1 | 467 | |
duke@1 | 468 | sx.pi = 1; |
duke@1 | 469 | sx.spi = 2; |
duke@1 | 470 | |
duke@1 | 471 | lx.pi = 1; |
duke@1 | 472 | lx.spi = 2; |
duke@1 | 473 | |
duke@1 | 474 | int n = sx.pi; |
duke@1 | 475 | int m = sx.spi; |
duke@1 | 476 | |
duke@1 | 477 | int k = lx.pi; |
duke@1 | 478 | int l = lx.spi; |
duke@1 | 479 | |
duke@1 | 480 | int u = sx.pm(); |
duke@1 | 481 | int v = sx.spm(); |
duke@1 | 482 | |
duke@1 | 483 | int w = lx.pm(); |
duke@1 | 484 | int z = lx.spm(); |
duke@1 | 485 | |
duke@1 | 486 | SubClass.pC obj1; |
duke@1 | 487 | SubClass.spC obj2; |
duke@1 | 488 | |
duke@1 | 489 | SubClass.pI obj3; |
duke@1 | 490 | SubClass.spI obj4; |
duke@1 | 491 | |
duke@1 | 492 | Object o1 = (SubClass.pC) null; |
duke@1 | 493 | Object o2 = (SubClass.spC) null; |
duke@1 | 494 | |
duke@1 | 495 | Object o3 = (SubClass.pI) null; |
duke@1 | 496 | Object o4 = (SubClass.spI) null; |
duke@1 | 497 | |
duke@1 | 498 | //class C1 extends SubClass.pC {} |
duke@1 | 499 | class C2 extends SubClass.spC {} |
duke@1 | 500 | |
duke@1 | 501 | //interface I1 extends SubClass.pI {} |
duke@1 | 502 | //interface I2 extends SubClass.spI {} |
duke@1 | 503 | |
duke@1 | 504 | } |
duke@1 | 505 | |
duke@1 | 506 | void m() { |
duke@1 | 507 | |
duke@1 | 508 | SubClass lx = new SubClass(); |
duke@1 | 509 | |
duke@1 | 510 | x.pi = 1; |
duke@1 | 511 | x.spi = 2; |
duke@1 | 512 | |
duke@1 | 513 | sx.pi = 1; |
duke@1 | 514 | sx.spi = 2; |
duke@1 | 515 | |
duke@1 | 516 | lx.pi = 1; |
duke@1 | 517 | lx.spi = 2; |
duke@1 | 518 | |
duke@1 | 519 | int t = x.pm(); |
duke@1 | 520 | int y = x.spm(); |
duke@1 | 521 | |
duke@1 | 522 | int u = sx.pm(); |
duke@1 | 523 | int v = sx.spm(); |
duke@1 | 524 | |
duke@1 | 525 | int w = lx.pm(); |
duke@1 | 526 | int z = lx.spm(); |
duke@1 | 527 | |
duke@1 | 528 | int i = x.pi; |
duke@1 | 529 | int j = x.spi; |
duke@1 | 530 | |
duke@1 | 531 | int n = sx.pi; |
duke@1 | 532 | int m = sx.spi; |
duke@1 | 533 | |
duke@1 | 534 | int k = lx.pi; |
duke@1 | 535 | int l = lx.spi; |
duke@1 | 536 | |
duke@1 | 537 | SubClass.pC obj1; |
duke@1 | 538 | SubClass.spC obj2; |
duke@1 | 539 | |
duke@1 | 540 | SubClass.pI obj3; |
duke@1 | 541 | SubClass.spI obj4; |
duke@1 | 542 | |
duke@1 | 543 | Object o1 = (SubClass.pC) null; |
duke@1 | 544 | Object o2 = (SubClass.spC) null; |
duke@1 | 545 | |
duke@1 | 546 | Object o3 = (SubClass.pI) null; |
duke@1 | 547 | Object o4 = (SubClass.spI) null; |
duke@1 | 548 | |
duke@1 | 549 | class C1 extends SubClass.pC {} |
duke@1 | 550 | class C2 extends SubClass.spC {} |
duke@1 | 551 | |
duke@1 | 552 | //interface I1 extends SubClass.pI {} |
duke@1 | 553 | //interface I2 extends SubClass.spI {} |
duke@1 | 554 | |
duke@1 | 555 | } |
duke@1 | 556 | |
duke@1 | 557 | class Inner { |
duke@1 | 558 | |
duke@1 | 559 | int i = x.pi; |
duke@1 | 560 | int j = x.spi; |
duke@1 | 561 | |
duke@1 | 562 | int n = sx.pi; |
duke@1 | 563 | int m = sx.spi; |
duke@1 | 564 | |
duke@1 | 565 | //static int sn = sx.pi; |
duke@1 | 566 | //static int sm = sx.spi; |
duke@1 | 567 | |
duke@1 | 568 | int w = x.pm(); |
duke@1 | 569 | int y = x.spm(); |
duke@1 | 570 | |
duke@1 | 571 | int u = sx.pm(); |
duke@1 | 572 | int v = sx.spm(); |
duke@1 | 573 | |
duke@1 | 574 | SubClass.pC obj1; |
duke@1 | 575 | SubClass.spC obj2; |
duke@1 | 576 | |
duke@1 | 577 | SubClass.pI obj3; |
duke@1 | 578 | SubClass.spI obj4; |
duke@1 | 579 | |
duke@1 | 580 | Object o1 = (SubClass.pC) null; |
duke@1 | 581 | Object o2 = (SubClass.spC) null; |
duke@1 | 582 | |
duke@1 | 583 | Object o3 = (SubClass.pI) null; |
duke@1 | 584 | Object o4 = (SubClass.spI) null; |
duke@1 | 585 | |
duke@1 | 586 | class C1 extends SubClass.pC {} |
duke@1 | 587 | class C2 extends SubClass.spC {} |
duke@1 | 588 | |
duke@1 | 589 | //interface I1 extends SubClass.pI {} |
duke@1 | 590 | //interface I2 extends SubClass.spI {} |
duke@1 | 591 | |
duke@1 | 592 | // Not allowed in inner classes. |
duke@1 | 593 | // static { ... } |
duke@1 | 594 | |
duke@1 | 595 | void m() { |
duke@1 | 596 | |
duke@1 | 597 | SubClass lx = new SubClass(); |
duke@1 | 598 | |
duke@1 | 599 | x.pi = 1; |
duke@1 | 600 | x.spi = 2; |
duke@1 | 601 | |
duke@1 | 602 | sx.pi = 1; |
duke@1 | 603 | sx.spi = 2; |
duke@1 | 604 | |
duke@1 | 605 | lx.pi = 1; |
duke@1 | 606 | lx.spi = 2; |
duke@1 | 607 | |
duke@1 | 608 | int t = x.pm(); |
duke@1 | 609 | int y = x.spm(); |
duke@1 | 610 | |
duke@1 | 611 | int u = sx.pm(); |
duke@1 | 612 | int v = sx.spm(); |
duke@1 | 613 | |
duke@1 | 614 | int w = lx.pm(); |
duke@1 | 615 | int z = lx.spm(); |
duke@1 | 616 | |
duke@1 | 617 | int i = x.pi; |
duke@1 | 618 | int j = x.spi; |
duke@1 | 619 | |
duke@1 | 620 | int n = sx.pi; |
duke@1 | 621 | int m = sx.spi; |
duke@1 | 622 | |
duke@1 | 623 | int k = lx.pi; |
duke@1 | 624 | int l = lx.spi; |
duke@1 | 625 | |
duke@1 | 626 | SubClass.pC obj1; |
duke@1 | 627 | SubClass.spC obj2; |
duke@1 | 628 | |
duke@1 | 629 | SubClass.pI obj3; |
duke@1 | 630 | SubClass.spI obj4; |
duke@1 | 631 | |
duke@1 | 632 | Object o1 = (SubClass.pC) null; |
duke@1 | 633 | Object o2 = (SubClass.spC) null; |
duke@1 | 634 | |
duke@1 | 635 | Object o3 = (SubClass.pI) null; |
duke@1 | 636 | Object o4 = (SubClass.spI) null; |
duke@1 | 637 | |
duke@1 | 638 | class C1 extends SubClass.pC {} |
duke@1 | 639 | class C2 extends SubClass.spC {} |
duke@1 | 640 | |
duke@1 | 641 | //interface I1 extends SubClass.pI {} |
duke@1 | 642 | //interface I2 extends SubClass.spI {} |
duke@1 | 643 | |
duke@1 | 644 | } |
duke@1 | 645 | |
duke@1 | 646 | } |
duke@1 | 647 | |
duke@1 | 648 | } |