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 27321 Details for
Bug 109963
[dom] Two VariableDeclarationStatements in switch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
patch_109963_tests_model.txt (text/plain), 2.84 KB, created by
Olivier Thomann
on 2005-09-20 21:44:42 EDT
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-09-20 21:44:42 EDT
Size:
2.84 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v >retrieving revision 1.65 >diff -u -r1.65 ASTConverterTestAST3_2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 15 Sep 2005 18:48:55 -0000 1.65 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 21 Sep 2005 01:44:11 -0000 >@@ -106,7 +106,7 @@ > > static { > // TESTS_NAMES = new String[] {"test0602"}; >-// TESTS_NUMBERS = new int[] { 619 }; >+// TESTS_NUMBERS = new int[] { 621 }; > } > public static Test suite() { > return buildTestSuite(ASTConverterTestAST3_2.class); >@@ -6746,8 +6746,8 @@ > ICompilationUnit workingCopy = null; > try { > String contents = >- "public class X {\r\n" + >- " String f = \"\" + \"\" - 1;\r\n" + >+ "public class X {\n" + >+ " String f = \"\" + \"\" - 1;\n" + > "}"; > workingCopy = getWorkingCopy("/Converter/src/X.java", false/*resolve*/); > ASTNode node = buildAST( >@@ -6812,4 +6812,42 @@ > VariableDeclarationStatement declarationStatement = (VariableDeclarationStatement) statement2; > assertEquals("Wrong number of fragments", 4, declarationStatement.fragments().size()); > } >+ /** >+ * http://dev.eclipse.org/bugs/show_bug.cgi?id=109646 >+ */ >+ public void test0621() throws JavaModelException { >+ ICompilationUnit workingCopy = null; >+ try { >+ String contents = >+ "public class X {\n" + >+ " public void foo(int y) {\n" + >+ " switch (y) {\n" + >+ " case 1:\n" + >+ " int i,j;\n" + >+ " }\n" + >+ " }\n" + >+ "}"; >+ workingCopy = getWorkingCopy("/Converter/src/X.java", false/*resolve*/); >+ ASTNode node = buildAST( >+ contents, >+ workingCopy, >+ false); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize(unit, 0); >+ node = getASTNode(unit, 0, 0, 0); >+ assertNotNull("No node", node); >+ assertEquals("Not a switch statement", ASTNode.SWITCH_STATEMENT, node.getNodeType()); >+ SwitchStatement switchStatement = (SwitchStatement) node; >+ List statements = switchStatement.statements(); >+ assertEquals("Wrong size", 2, statements.size()); >+ Statement statement = (Statement) statements.get(1); >+ assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, statement.getNodeType()); >+ VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement; >+ assertEquals("Wrong size", 2, variableDeclarationStatement.fragments().size()); >+ } finally { >+ if (workingCopy != null) >+ workingCopy.discardWorkingCopy(); >+ } >+ } > }
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 109963
:
27320
| 27321