Bug 51263 - Old formatter indents wrong with single-line comment.
Summary: Old formatter indents wrong with single-line comment.
Status: VERIFIED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-05 15:38 EST by Deven T. Corzine CLA
Modified: 2014-07-29 04:42 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deven T. Corzine CLA 2004-02-05 15:38:23 EST
Using 3.0M6, the old formatter will misindent the following code:

class Foo
{
	class Bar
	{
	}

	void foo()
	{
		Bar obj = new Bar()
		{
			public void bar()
			{
				// Here is the problem.
				return;
			}
		};
	}
}

Here's the result after formatting:

class Foo
{
	class Bar
	{
	}

	void foo()
	{
		Bar obj = new Bar()
		{
			public void bar()
			{
					// Here is the problem.
	return;
			}
		};
	}
}

This bug only occurs if that innermost block starts with a // single-line
comment.  If a /* block comment */ is used, it indents correctly.  If no comment
appears, it also indents correctly.
Comment 1 Olivier Thomann CLA 2004-02-05 16:28:04 EST
The old formatter won't be maintained.
I will check that the new formatter has not the same bug.
Comment 2 Olivier Thomann CLA 2004-02-09 09:29:19 EST
Verified that the new formatter is handling this code fine.
Close as WONTFIX.