Tue, 03 Jun 2008 13:26:47 -0700
4075303: Use javap to enquire aboput a specific inner class
4348375: Javap is not internationalized
4459541: "javap -l" shows line numbers as signed short; they should be unsigned
4501660: change diagnostic of -help as 'print this help message and exit'
4776241: unused source file in javap...
4870651: javap should recognize generics, varargs, enum
4876942: javap invoked without args does not print help screen
4880663: javap could output whitespace between class name and opening brace
4975569: javap doesn't print new flag bits
6271787: javap dumps LocalVariableTypeTable attribute in hex, needs to print a table
6305779: javap: support annotations
6439940: Clean up javap implementation
6469569: wrong check of searchpath in JavapEnvironment
6474890: javap does not open .zip files in -classpath
6587786: Javap throws error : "ERROR:Could not find <classname>" for JRE classes
6622215: javap ignores certain relevant access flags
6622216: javap names some attributes incorrectly
6622232: javap gets whitespace confused
6622260: javap prints negative bytes incorrectly in hex
Reviewed-by: ksrini
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 * @run shell QualifiedAccess_3.sh
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 }