Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 156823 Details for
Bug 300133
[1.5][compiler] Local classes inside enum constants generate default constructor without implicit constructor call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_300133.txt (text/plain), 2.99 KB, created by
Olivier Thomann
on 2010-01-21 12:25:16 EST
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-01-21 12:25:16 EST
Size:
2.99 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v >retrieving revision 1.414 >diff -u -r1.414 Parser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 7 Jan 2010 20:18:49 -0000 1.414 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 21 Jan 2010 17:21:53 -0000 >@@ -3196,6 +3196,8 @@ > anonymousType.modifiers = 0; > anonymousType.bodyStart = this.scanner.currentPosition; > markEnclosingMemberWithLocalType(); >+ consumeNestedType(); >+ this.variablesCounter[this.nestedType]++; > pushOnAstStack(anonymousType); > QualifiedAllocationExpression allocationExpression = new QualifiedAllocationExpression(anonymousType); > allocationExpression.enumConstant = enumConstant; >@@ -3316,6 +3318,8 @@ > fieldDeclaration.declarationEnd = this.endStatementPosition; > fieldDeclaration.declarationSourceEnd = anonymousType.declarationSourceEnd; > this.intPtr --; // remove end position of the arguments >+ this.variablesCounter[this.nestedType] = 0; >+ this.nestedType--; > } > protected void consumeEnumDeclaration() { > // EnumDeclaration ::= EnumHeader ClassHeaderImplementsopt EnumBody >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java,v >retrieving revision 1.151 >diff -u -r1.151 EnumTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 24 Sep 2009 16:21:26 -0000 1.151 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 21 Jan 2010 17:21:57 -0000 >@@ -33,7 +33,7 @@ > // All specified tests which does not belong to the class are skipped... > static { > // TESTS_NAMES = new String[] { "test000" }; >-// TESTS_NUMBERS = new int[] { 180 }; >+// TESTS_NUMBERS = new int[] { 181 }; > // TESTS_RANGE = new int[] { 21, 50 }; > } > public static Test suite() { >@@ -6524,4 +6524,29 @@ > "", > null); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=300133 >+public void test181() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public enum X {\n" + >+ " A {\n" + >+ " @Override\n" + >+ " public Object foo(final String s) {\n" + >+ " class Local {\n" + >+ " public String toString() {\n" + >+ " return s;\n" + >+ " }\n" + >+ " }\n" + >+ " return new Local();\n" + >+ " }\n" + >+ " };\n" + >+ " public abstract Object foo(String s);\n" + >+ " public static void main(String... args) {\n" + >+ " System.out.println(A.foo(\"SUCCESS\"));\n" + >+ " }\n" + >+ "}" >+ }, >+ "SUCCESS"); >+} > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 300133
:
156594
| 156823