Fri, 24 May 2013 15:27:12 +0100
8014649: Regression: bug in Resolve.resolveOperator
Summary: Missing curly braces causes Resolve.findMethod to be called spuriously
Reviewed-by: jjg, vromero
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 4074421 4277278 4785453
4 * @summary Verify that a local class cannot be redefined within its scope.
5 * @author William Maddox (maddox)
6 *
7 * @compile/fail/ref=LocalClasses_2.out -XDrawDiagnostics LocalClasses_2.java
8 */
10 class LocalClasses_2 {
12 void foo() {
13 class Local { }
14 {
15 class Local { } // ERROR
16 }
17 }
19 void bar() {
21 class Local { }
23 class Baz {
24 void quux() {
25 class Local { } // OK
26 }
27 }
29 class Quux {
30 void baz() {
31 class Random {
32 void quem() {
33 class Local { } // OK
34 }
35 }
36 }
37 }
38 }
39 }