Bug 109963

Summary: [dom] Two VariableDeclarationStatements in switch
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 110956    
Attachments:
Description Flags
Proposed fix
none
Regression test none

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.