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 4037746 4277279 4350658 4785453
4 * @summary Verify that an inner class cannot have the same simple name as an enclosing one.
5 * @author William Maddox (maddox)
6 *
7 * @run shell NestedInnerClassNames.sh
8 */
10 /*
11 * This program should compile with errors as marked.
12 */
14 public class NestedInnerClassNames {
16 class NestedInnerClassNames {} // ERROR
18 void m1() {
19 class NestedInnerClassNames {} // ERROR
20 }
22 class foo {
23 class foo { } // ERROR
24 }
26 void m2 () {
27 class foo {
28 class foo { } // ERROR
29 }
30 }
32 class bar {
33 class foo { }
34 class NestedInnerClassNames {} // ERROR
35 }
37 void m3() {
38 class bar {
39 class foo { }
40 class NestedInnerClassNames {} // ERROR
41 }
42 }
44 class baz {
45 class baz { // ERROR
46 class baz { } // ERROR
47 }
48 }
50 void m4() {
51 class baz {
52 class baz { // ERROR
53 class baz { } // ERROR
54 }
55 }
56 }
58 class foo$bar {
59 class foo$bar { // ERROR
60 class foo { }
61 class bar { }
62 }
63 }
65 void m5() {
66 class foo$bar {
67 class foo$bar { // ERROR
68 class foo { }
69 class bar { }
70 }
71 }
72 }
74 class $bar {
75 class foo {
76 class $bar { } // ERROR
77 }
78 }
80 void m6() {
81 class $bar {
82 class foo {
83 class $bar { } // ERROR
84 }
85 }
86 }
88 class bar$bar {
89 class bar {
90 class bar{ } // ERROR
91 }
92 }
94 void m7() {
95 class bar$bar {
96 class bar {
97 class bar{ } // ERROR
98 }
99 }
100 }
102 // The name of the class below clashes with the name of the
103 // class created above for 'class foo { class foo {} }'.
104 // The clash follows from the naming requirements of the inner
105 // classes spec, but is most likely a specification bug.
107 // Error may be reported here. See 4278961.
108 // As of Merlin-beta b21, this now results in an error.
109 class foo$foo { } // ERROR
111 }