Bug 109963 - [dom] Two VariableDeclarationStatements in switch
Summary: [dom] Two VariableDeclarationStatements in switch
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 110956
  Show dependency tree
 
Reported: 2005-09-20 04:18 EDT by Benno Baumgartner CLA
Modified: 2005-09-28 12:34 EDT (History)
0 users

See Also:


Attachments
Proposed fix (975 bytes, patch)
2005-09-20 21:43 EDT, Olivier Thomann CLA
no flags Details | Diff
Regression test (2.84 KB, patch)
2005-09-20 21:44 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Baumgartner CLA 2005-09-20 04:18:22 EDT
Version: 3.1.0
Build id: I20050919-0010

The ast for:

switch (y) {
case 1:
	int i,j;
}

is:

SwitchStatement [71, 41]
|->SwitchCase [87, 7]
|->VariableDeclarationStatement [99, 8]
| |->VariableDeclarationFragment [103, 1] (i)
|->VariableDeclarationStatement [99, 8]
  |->VariableDeclarationFragment [105, 1] (j)

But I guess it should be one VariableDeclarationStatement containing two
fragments, one for i and one for j.
Comment 1 Olivier Thomann CLA 2005-09-20 21:43:45 EDT
Created attachment 27320 [details]
Proposed fix
Comment 2 Olivier Thomann CLA 2005-09-20 21:44:42 EDT
Created attachment 27321 [details]
Regression test
Comment 3 Philipe Mulet CLA 2005-09-21 16:01:04 EDT
+1 for 3.1.1
Comment 4 Olivier Thomann CLA 2005-09-22 17:31:35 EDT
Fixed and released in 3.1 maintenance stream.
Regression tests added in
org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2.test0615.
Comment 5 Olivier Thomann CLA 2005-09-26 14:31:12 EDT
Fixed
Comment 6 Olivier Thomann CLA 2005-09-26 14:31:30 EDT
Verified for 3.1.1 in M20050923-1430
Comment 7 Olivier Thomann CLA 2005-09-28 11:47:19 EDT
Fixed and released in HEAD.
Regression test added in
org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2.test0621.