Thu, 07 Jun 2012 20:30:57 -0700
7170079: Adjustments to build-infra makefiles
Reviewed-by: ohair, ohrstrom, ihse, jonas
Contributed-by: jonas <jonas.oreland@oracle.com>, erikj <erik.joelsson@oracle.com>, ihse <magnus.ihse.bursie@oracle.com>, tgranat <torbjorn.granat@oracle.com>, ykantser <yekaterina.kantserova@oracle.com>
duke@1 | 1 | /* |
duke@1 | 2 | * @test /nodynamiccopyright/ |
duke@1 | 3 | * @bug 4319507 4785453 |
duke@1 | 4 | * @summary Verify correct implementation of JLS2e 6.6.2.1 |
duke@1 | 5 | * @author maddox |
duke@1 | 6 | * |
jjg@611 | 7 | * @compile/fail/ref=ProtectedMemberAccess2.out -XDdiags=-simpleNames -XDdiagsFormat=%b:%l:%_%m ProtectedMemberAccess2.java |
duke@1 | 8 | */ |
duke@1 | 9 | |
duke@1 | 10 | // 71 errors expected. |
duke@1 | 11 | |
duke@1 | 12 | import pkg.SuperClass; |
duke@1 | 13 | |
duke@1 | 14 | class ProtectedMemberAccess2 { |
duke@1 | 15 | |
duke@1 | 16 | // Since this class is not a subclass of the class in which the |
duke@1 | 17 | // protected members are declared, all of the accesses are illegal. |
duke@1 | 18 | |
duke@1 | 19 | pkg.SuperClass x = new pkg.SuperClass(); |
duke@1 | 20 | |
duke@1 | 21 | static pkg.SuperClass sx = new pkg.SuperClass(); |
duke@1 | 22 | |
duke@1 | 23 | int i = x.pi; // illegal |
duke@1 | 24 | int j = x.spi; // illegal |
duke@1 | 25 | |
duke@1 | 26 | int n = sx.pi; // illegal |
duke@1 | 27 | int m = sx.spi; // illegal |
duke@1 | 28 | |
duke@1 | 29 | static int sn = sx.pi; // illegal |
duke@1 | 30 | static int sm = sx.spi; // illegal |
duke@1 | 31 | |
duke@1 | 32 | int w = x.pm(); // illegal |
duke@1 | 33 | int y = x.spm(); // illegal |
duke@1 | 34 | |
duke@1 | 35 | int u = sx.pm(); // illegal |
duke@1 | 36 | int v = sx.spm(); // illegal |
duke@1 | 37 | |
duke@1 | 38 | pkg.SuperClass.pC obj1; // illegal |
duke@1 | 39 | pkg.SuperClass.spC obj2; // illegal |
duke@1 | 40 | |
duke@1 | 41 | pkg.SuperClass.pI obj3; // illegal |
duke@1 | 42 | pkg.SuperClass.spI obj4; // illegal |
duke@1 | 43 | |
duke@1 | 44 | Object o1 = (pkg.SuperClass.pC) null; // illegal |
duke@1 | 45 | Object o2 = (pkg.SuperClass.spC) null; // illegal |
duke@1 | 46 | |
duke@1 | 47 | Object o3 = (pkg.SuperClass.pI) null; // illegal |
duke@1 | 48 | Object o4 = (pkg.SuperClass.spI) null; // illegal |
duke@1 | 49 | |
duke@1 | 50 | class C1 extends pkg.SuperClass.pC {} // illegal |
duke@1 | 51 | class C2 extends pkg.SuperClass.spC {} // illegal |
duke@1 | 52 | |
duke@1 | 53 | interface I1 extends pkg.SuperClass.pI {} // illegal |
duke@1 | 54 | interface I2 extends pkg.SuperClass.spI {} // illegal |
duke@1 | 55 | |
duke@1 | 56 | static { |
duke@1 | 57 | |
duke@1 | 58 | pkg.SuperClass lx = new pkg.SuperClass(); |
duke@1 | 59 | |
duke@1 | 60 | sx.pi = 1; // illegal |
duke@1 | 61 | sx.spi = 2; // illegal |
duke@1 | 62 | |
duke@1 | 63 | lx.pi = 1; // illegal |
duke@1 | 64 | lx.spi = 2; // illegal |
duke@1 | 65 | |
duke@1 | 66 | int n = sx.pi; // illegal |
duke@1 | 67 | int m = sx.spi; // illegal |
duke@1 | 68 | |
duke@1 | 69 | int k = lx.pi; // illegal |
duke@1 | 70 | int l = lx.spi; // illegal |
duke@1 | 71 | |
duke@1 | 72 | int u = sx.pm(); // illegal |
duke@1 | 73 | int v = sx.spm(); // illegal |
duke@1 | 74 | |
duke@1 | 75 | int w = lx.pm(); // illegal |
duke@1 | 76 | int z = lx.spm(); // illegal |
duke@1 | 77 | |
duke@1 | 78 | pkg.SuperClass.pC obj1; // illegal |
duke@1 | 79 | pkg.SuperClass.spC obj2; // illegal |
duke@1 | 80 | |
duke@1 | 81 | pkg.SuperClass.pI obj3; // illegal |
duke@1 | 82 | pkg.SuperClass.spI obj4; // illegal |
duke@1 | 83 | |
duke@1 | 84 | Object o1 = (pkg.SuperClass.pC) null; // illegal |
duke@1 | 85 | Object o2 = (pkg.SuperClass.spC) null; // illegal |
duke@1 | 86 | |
duke@1 | 87 | Object o3 = (pkg.SuperClass.pI) null; // illegal |
duke@1 | 88 | Object o4 = (pkg.SuperClass.spI) null; // illegal |
duke@1 | 89 | |
duke@1 | 90 | //class C1 extends pkg.SuperClass.pC {} |
duke@1 | 91 | class C2 extends pkg.SuperClass.spC {} // illegal |
duke@1 | 92 | |
duke@1 | 93 | //interface I1 extends pkg.SuperClass.pI {} |
duke@1 | 94 | //interface I2 extends pkg.SuperClass.spI {} |
duke@1 | 95 | |
duke@1 | 96 | } |
duke@1 | 97 | |
duke@1 | 98 | void m() { |
duke@1 | 99 | |
duke@1 | 100 | pkg.SuperClass lx = new pkg.SuperClass(); |
duke@1 | 101 | |
duke@1 | 102 | x.pi = 1; // illegal |
duke@1 | 103 | x.spi = 2; // illegal |
duke@1 | 104 | |
duke@1 | 105 | sx.pi = 1; // illegal |
duke@1 | 106 | sx.spi = 2; // illegal |
duke@1 | 107 | |
duke@1 | 108 | lx.pi = 1; // illegal |
duke@1 | 109 | lx.spi = 2; // illegal |
duke@1 | 110 | |
duke@1 | 111 | int t = x.pm(); // illegal |
duke@1 | 112 | int y = x.spm(); // illegal |
duke@1 | 113 | |
duke@1 | 114 | int u = sx.pm(); // illegal |
duke@1 | 115 | int v = sx.spm(); // illegal |
duke@1 | 116 | |
duke@1 | 117 | int w = lx.pm(); // illegal |
duke@1 | 118 | int z = lx.spm(); // illegal |
duke@1 | 119 | |
duke@1 | 120 | int i = x.pi; // illegal |
duke@1 | 121 | int j = x.spi; // illegal |
duke@1 | 122 | |
duke@1 | 123 | int n = sx.pi; // illegal |
duke@1 | 124 | int m = sx.spi; // illegal |
duke@1 | 125 | |
duke@1 | 126 | int k = lx.pi; // illegal |
duke@1 | 127 | int l = lx.spi; // illegal |
duke@1 | 128 | |
duke@1 | 129 | pkg.SuperClass.pC obj1; // illegal |
duke@1 | 130 | pkg.SuperClass.spC obj2; // illegal |
duke@1 | 131 | |
duke@1 | 132 | pkg.SuperClass.pI obj3; // illegal |
duke@1 | 133 | pkg.SuperClass.spI obj4; // illegal |
duke@1 | 134 | |
duke@1 | 135 | Object o1 = (pkg.SuperClass.pC) null; // illegal |
duke@1 | 136 | Object o2 = (pkg.SuperClass.spC) null; // illegal |
duke@1 | 137 | |
duke@1 | 138 | Object o3 = (pkg.SuperClass.pI) null; // illegal |
duke@1 | 139 | Object o4 = (pkg.SuperClass.spI) null; // illegal |
duke@1 | 140 | |
duke@1 | 141 | class C1 extends pkg.SuperClass.pC {} // illegal |
duke@1 | 142 | class C2 extends pkg.SuperClass.spC {} // illegal |
duke@1 | 143 | |
duke@1 | 144 | //interface I1 extends pkg.SuperClass.pI {} |
duke@1 | 145 | //interface I2 extends pkg.SuperClass.spI {} |
duke@1 | 146 | |
duke@1 | 147 | } |
duke@1 | 148 | |
duke@1 | 149 | } |