View | Details | Raw Unified | Return to bug 300133
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (+4 lines)
Lines 3196-3201 Link Here
3196
      anonymousType.modifiers = 0;
3196
      anonymousType.modifiers = 0;
3197
      anonymousType.bodyStart = this.scanner.currentPosition;
3197
      anonymousType.bodyStart = this.scanner.currentPosition;
3198
      markEnclosingMemberWithLocalType();
3198
      markEnclosingMemberWithLocalType();
3199
      consumeNestedType();
3200
      this.variablesCounter[this.nestedType]++;
3199
      pushOnAstStack(anonymousType);
3201
      pushOnAstStack(anonymousType);
3200
      QualifiedAllocationExpression allocationExpression = new QualifiedAllocationExpression(anonymousType);
3202
      QualifiedAllocationExpression allocationExpression = new QualifiedAllocationExpression(anonymousType);
3201
      allocationExpression.enumConstant = enumConstant;
3203
      allocationExpression.enumConstant = enumConstant;
Lines 3316-3321 Link Here
3316
   fieldDeclaration.declarationEnd = this.endStatementPosition;
3318
   fieldDeclaration.declarationEnd = this.endStatementPosition;
3317
   fieldDeclaration.declarationSourceEnd = anonymousType.declarationSourceEnd;
3319
   fieldDeclaration.declarationSourceEnd = anonymousType.declarationSourceEnd;
3318
   this.intPtr --; // remove end position of the arguments
3320
   this.intPtr --; // remove end position of the arguments
3321
   this.variablesCounter[this.nestedType] = 0;
3322
   this.nestedType--;
3319
}
3323
}
3320
protected void consumeEnumDeclaration() {
3324
protected void consumeEnumDeclaration() {
3321
	// EnumDeclaration ::= EnumHeader ClassHeaderImplementsopt EnumBody
3325
	// EnumDeclaration ::= EnumHeader ClassHeaderImplementsopt EnumBody
(-)src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java (-1 / +26 lines)
Lines 33-39 Link Here
33
	// All specified tests which does not belong to the class are skipped...
33
	// All specified tests which does not belong to the class are skipped...
34
	static {
34
	static {
35
//		TESTS_NAMES = new String[] { "test000" };
35
//		TESTS_NAMES = new String[] { "test000" };
36
//		TESTS_NUMBERS = new int[] { 180 };
36
//		TESTS_NUMBERS = new int[] { 181 };
37
//		TESTS_RANGE = new int[] { 21, 50 };
37
//		TESTS_RANGE = new int[] { 21, 50 };
38
	}
38
	}
39
	public static Test suite() {
39
	public static Test suite() {
Lines 6524-6527 Link Here
6524
		"",
6524
		"",
6525
		null);
6525
		null);
6526
}
6526
}
6527
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=300133
6528
public void test181() {
6529
	this.runConformTest(
6530
		new String[] {
6531
				"X.java",
6532
				"public enum X {\n" + 
6533
				"	A {\n" + 
6534
				"		@Override\n" + 
6535
				"		public Object foo(final String s) {\n" + 
6536
				"			class Local {\n" + 
6537
				"				public String toString() {\n" + 
6538
				"					return s;\n" + 
6539
				"				}\n" + 
6540
				"			}\n" + 
6541
				"			return new Local();\n" + 
6542
				"		}\n" + 
6543
				"	};\n" + 
6544
				"	public abstract Object foo(String s);\n" + 
6545
				"	public static void main(String... args) {\n" + 
6546
				"		 System.out.println(A.foo(\"SUCCESS\"));\n" + 
6547
				"	}\n" + 
6548
				"}"
6549
		},
6550
		"SUCCESS");
6551
}
6527
}
6552
}

Return to bug 300133