Bug 136580 - [ast rewrite] Comma is missing between update expressions in the ForStatement
Summary: [ast rewrite] Comma is missing between update expressions in the ForStatement
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-13 05:00 EDT by Raimar Falke CLA
Modified: 2006-04-28 14:25 EDT (History)
2 users (show)

See Also:


Attachments
suggested fix (4.90 KB, patch)
2006-04-13 08:45 EDT, Martin Aeschlimann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raimar Falke CLA 2006-04-13 05:00:12 EDT
If a block is copied with ASTNode.copySubtree where the 
block contains a for statement with multiple updaters 
the comma will be missing in the rewritten document.

Looking at the source the problem is also there in CVS HEAD.

One solution is to change in org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFlattener.visit(ForStatement) something like the following:

-        visitList(node, ForStatement.UPDATERS_PROPERTY, null);
+        visitList(node, ForStatement.UPDATERS_PROPERTY, ", ");
Comment 1 Martin Aeschlimann CLA 2006-04-13 08:45:03 EDT
Created attachment 38506 [details]
suggested fix
Comment 2 Martin Aeschlimann CLA 2006-04-13 08:46:23 EDT
Phlippe, I suggest to include this fix in RC2. Do you approve?
Comment 3 Philipe Mulet CLA 2006-04-25 05:32:50 EDT
+1 for 3.2RC2
Comment 4 Martin Aeschlimann CLA 2006-04-25 06:24:26 EDT
patch released > 20060425
Comment 5 Olivier Thomann CLA 2006-04-28 14:25:06 EDT
Verified with I20060427-1600 for 3.2RC2 (checking the source code).