Tue, 10 Apr 2012 08:15:25 -0700
7074397: Build infrastructure changes (makefile re-write)
Summary: New makefiles transition, old and new living side by side for now.
Reviewed-by: ohair, jjg, dholmes, ohrstrom, erikj, ihse, tgranat, ykantser
Contributed-by: ohrstrom <fredrik.ohrstrom@oracle.com>, erikj <erik.joelsson@oracle.com>, ihse <magnus.ihse.bursie@oracle.com>, tgranat <torbjorn.granat@oracle.com>, ykantser <yekaterina.kantserova@oracle.com>
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 4319507 4785453
4 * @summary Verify correct implementation of JLS2e 6.6.2.1
5 * @author maddox
6 *
7 * @compile/fail/ref=ProtectedMemberAccess3.out -XDdiags=-simpleNames -XDdiagsFormat=%b:%l:%_%m ProtectedMemberAccess3.java
8 */
10 // 46 errors expected.
12 import pkg.SuperClass;
14 class ProtectedMemberAccess3 {
16 // Since this class is not a subclass of the class in which the
17 // protected members are declared, all of the accesses are illegal.
19 pkg.SuperClass x = new pkg.SuperClass();
21 static pkg.SuperClass sx = new pkg.SuperClass();
23 class Inner {
25 int i = x.pi; // illegal
26 int j = x.spi; // illegal
28 int n = sx.pi; // illegal
29 int m = sx.spi; // illegal
31 //static int sn = sx.pi;
32 //static int sm = sx.spi;
34 int w = x.pm(); // illegal
35 int y = x.spm(); // illegal
37 int u = sx.pm(); // illegal
38 int v = sx.spm(); // illegal
40 pkg.SuperClass.pC obj1; // illegal
41 pkg.SuperClass.spC obj2; // illegal
43 pkg.SuperClass.pI obj3; // illegal
44 pkg.SuperClass.spI obj4; // illegal
46 Object o1 = (pkg.SuperClass.pC) null; // illegal
47 Object o2 = (pkg.SuperClass.spC) null; // illegal
49 Object o3 = (pkg.SuperClass.pI) null; // illegal
50 Object o4 = (pkg.SuperClass.spI) null; // illegal
52 class C1 extends pkg.SuperClass.pC {} // illegal
53 class C2 extends pkg.SuperClass.spC {} // illegal
55 //interface I1 extends pkg.SuperClass.pI {}
56 //interface I2 extends pkg.SuperClass.spI {}
58 // Not allowed in inner classes.
59 // static { ... }
61 void m() {
63 pkg.SuperClass lx = new pkg.SuperClass();
65 x.pi = 1; // illegal
66 x.spi = 2; // illegal
68 sx.pi = 1; // illegal
69 sx.spi = 2; // illegal
71 lx.pi = 1; // illegal
72 lx.spi = 2; // illegal
74 int t = x.pm(); // illegal
75 int y = x.spm(); // illegal
77 int u = sx.pm(); // illegal
78 int v = sx.spm(); // illegal
80 int w = lx.pm(); // illegal
81 int z = lx.spm(); // illegal
83 int i = x.pi; // illegal
84 int j = x.spi; // illegal
86 int n = sx.pi; // illegal
87 int m = sx.spi; // illegal
89 int k = lx.pi; // illegal
90 int l = lx.spi; // illegal
92 pkg.SuperClass.pC obj1; // illegal
93 pkg.SuperClass.spC obj2; // illegal
95 pkg.SuperClass.pI obj3; // illegal
96 pkg.SuperClass.spI obj4; // illegal
98 Object o1 = (pkg.SuperClass.pC) null; // illegal
99 Object o2 = (pkg.SuperClass.spC) null; // illegal
101 Object o3 = (pkg.SuperClass.pI) null; // illegal
102 Object o4 = (pkg.SuperClass.spI) null; // illegal
104 class C1 extends pkg.SuperClass.pC {} // illegal
105 class C2 extends pkg.SuperClass.spC {} // illegal
107 //interface I1 extends pkg.SuperClass.pI {}
108 //interface I2 extends pkg.SuperClass.spI {}
110 }
112 }
114 }