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 4094658 4785453
4 * @summary Test enforcement of JLS 6.6.1 and 6.6.2 rules requiring that
5 * the type to which a component member belongs be accessible in qualified
6 * names.
7 *
8 * @compile/fail/ref=QualifiedAccess_3.out -XDrawDiagnostics QualifiedAccess_3.java
9 */
11 import pack1.P1;
13 class CMain {
15 class Foo {
16 class Bar {}
17 }
19 static class Baz {
20 private static class Quux {
21 static class Quem {}
22 }
23 }
25 // These are all OK.
26 CMain z = new CMain();
27 Foo x = z.new Foo();
28 Foo.Bar y = x.new Bar();
30 void test() {
31 P1 p1 = new P1();
33 // These are NOT errors, and should NOT be detected, as observed.
34 /*------------------------------------*
35 Baz.Quux z = null;
36 Baz.Quux.Quem y = null;
37 *------------------------------------*/
39 P1.Foo.Bar x = null; // ERROR - 'P1.Foo' not accessible
40 int i = p1.a.length; // ERROR - Type of 'a' not accessible
41 // The type of the expression from which a component
42 // is selected must be accessible.
43 p1.p2.privatei = 3; // ERROR - Type of 'p1.p2' not accessible.
44 System.out.println (p1.p2.privatei); // ERROR - Type of 'p1.p2' not accessible.
45 }
47 }