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 173618 Details for
Bug 210419
[compiler] Invalid field initializer not flagged as error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed regression test
patch.txt (text/plain), 1.87 KB, created by
Srikanth Sankaran
on 2010-07-07 02:26:47 EDT
(
hide
)
Description:
Proposed regression test
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2010-07-07 02:26:47 EDT
Size:
1.87 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java,v >retrieving revision 1.28 >diff -u -r1.28 SyntaxErrorTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java 7 Jul 2010 05:55:47 -0000 1.28 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/SyntaxErrorTest.java 7 Jul 2010 06:26:06 -0000 >@@ -479,4 +479,46 @@ > expectedSyntaxErrorDiagnosis, > testName); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=210419 >+public void test15() { >+ >+ String s = >+ "package bug;\n" + >+ "public class Test {\n" + >+ " static int X;\n" + >+ " String field = { String str;\n" + >+ " switch (X) {\n" + >+ " case 0:\n" + >+ " str = \"zero\";\n" + >+ " break;\n" + >+ " default:\n" + >+ " str = \"other\";\n" + >+ " break;\n" + >+ " }\n" + >+ " this.field = str;\n" + >+ " };\n" + >+ " public static void main(String[] args) {\n" + >+ " System.out.println(new Test().field);\n" + >+ " }\n" + >+ "}\n"; >+ >+ String expectedSyntaxErrorDiagnosis = >+ "----------\n" + >+ "1. ERROR in <test> (at line 4)\n" + >+ " String field = { String str;\n" + >+ " ^^^^^^^^\n" + >+ "Syntax error on token(s), misplaced construct(s)\n" + >+ "----------\n" + >+ "2. ERROR in <test> (at line 4)\n" + >+ " String field = { String str;\n" + >+ " ^\n" + >+ "Syntax error on token \";\", { expected after this token\n" + >+ "----------\n"; >+ >+ String testName = "<test>"; >+ checkParse( >+ s.toCharArray(), >+ expectedSyntaxErrorDiagnosis, >+ testName); >+} > }
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 210419
: 173618