Bug 35173 - Code formatter incorrectly formats this case:
Summary: Code formatter incorrectly formats this case:
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-17 17:43 EST by dan CLA
Modified: 2003-10-14 07:11 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 dan CLA 2003-03-17 17:43:24 EST
Using RC2, on W2K.

Formatter options selected - 
Insert new line before opening brace
Insert new lines in control statements
Insert a new line inside an empty block

The following block of code formats correctly:
publishAction = new Action()
{
	public void run()
	{
		System.out.println("");
		// TODO implement;
		// publishContent();

	}
};


The same block, only this time having a comments as the first line inside the
run block, formats incorrectly:

publishAction = new Action()
{
	public void run()
	{
		//
		System.out.println("");
		// TODO implement;
		// publishContent();

	}
};

Comes out something like this:


publishAction = new Action()
{
	public void run()
	{
			//
System.out.println("");
		// TODO implement;
		// publishContent();
	}
};
Comment 1 Philipe Mulet CLA 2003-03-18 06:16:58 EST
Post 2.1
Comment 2 Philipe Mulet CLA 2003-06-12 06:35:51 EDT
Resurrecting for 3.0
Comment 3 Olivier Thomann CLA 2003-06-12 15:59:03 EDT
Reopen for 3.0 consideration.
Comment 4 Olivier Thomann CLA 2003-10-03 10:20:44 EDT
This is addressed in the new formatter.
Fixed and released in HEAD.
Regression test added.
Comment 5 David Audel CLA 2003-10-14 07:11:46 EDT
Verified.