Bug 198362 - Formatter stops working when source code contains following line
Summary: Formatter stops working when source code contains following line
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.3.1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-31 03:21 EDT by Amit Monbaz CLA
Modified: 2008-09-16 09:44 EDT (History)
5 users (show)

See Also:


Attachments
Proposed fix (2.53 KB, patch)
2007-07-31 13:33 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 Amit Monbaz CLA 2007-07-31 03:21:15 EDT
Build ID: I20070625-1500

Steps To Reproduce:
Enter the following line in any source code file:
int i = (2+3+2)+2;
and the formatter will stop working for that file.

A more complete example of a file on which the formatter will not work:
public class Main {
	public static void main(String[] args) {
		int i = (2+3+2)+2;
	}
}

More information:
Comment 1 Dani Megert CLA 2007-07-31 03:40:25 EDT
Can reproduce on I20070724-0800.
Comment 2 Olivier Thomann CLA 2007-07-31 10:06:17 EDT
This is due to a problem when the CombinedBinaryExpression is built.
I don't know why, but the parenthesis are not set on the right expression leading to the failure while formatting the code.
Comment 3 Olivier Thomann CLA 2007-07-31 13:33:23 EDT
Created attachment 75062 [details]
Proposed fix
Comment 4 Olivier Thomann CLA 2007-07-31 15:03:58 EDT
Released for 3.4M1.
Added regression test in org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test668.

Philippe, candidate for 3.3.1?
Comment 5 Frederic Fusier CLA 2007-08-07 07:18:46 EDT
Verified for 3.4M1 using build I20070806-1800.
Comment 6 Olivier Thomann CLA 2007-08-13 13:55:38 EDT
Jérôme,

+1 for 3.3.1 ?
Comment 7 Jerome Lanneluc CLA 2007-08-14 07:16:09 EDT
+1 for backporting to 3.3.1
Comment 8 Olivier Thomann CLA 2007-08-14 11:09:54 EDT
Reopen for 3.3.1.
Comment 9 Olivier Thomann CLA 2007-08-14 11:15:18 EDT
Released for 3.3.1.
Added regression test in
org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test668.
Comment 10 David Audel CLA 2007-09-03 09:00:35 EDT
Verified for 3.3.1 using build M20070831-2000.