Bug 45508 - wrong formatting for "if () for {} else"
Summary: wrong formatting for "if () for {} else"
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-24 11:00 EDT by Rafael Chaves CLA
Modified: 2003-10-24 13:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Chaves CLA 2003-10-24 11:00:42 EDT
3.0 M4

The following code:

boolean b = true;
if (b)
	for (int i = 0; i < 10; i++) {
		System.out.println(i);
	} 
else
	System.out.println("nothing to do");

when formatted using the code formatters becomes:

boolean b = true;
if (b)
	for (int i = 0; i < 10; i++) {
		System.out.println(i);
	} else
	System.out.println("nothing to do");
Comment 1 Olivier Thomann CLA 2003-10-24 13:07:12 EDT
You should enable the new formatter in Preferences>Java>Work in progress.
This is fixed with the new formatter.
Comment 2 Olivier Thomann CLA 2003-10-24 13:12:48 EDT
Regression test added.
Close as INVALID.