Bug 7439 - incorrect formatting: empty inner class
Summary: incorrect formatting: empty inner class
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-10 12:08 EST by Grant Gayed CLA
Modified: 2003-10-13 09:15 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 Grant Gayed CLA 2002-01-10 12:08:37 EST
Integration build: Jan. 8

Paste the following into a java editor, right-click -> Format.  The 
trailing "}" of the empty inner class is indented incorrectly.  My formatting 
preferences are all the defaults.


package grant;

import org.eclipse.swt.widgets.*;
import org.eclipse.swt.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.custom.*;

public class FormatterProblem {

public static void main(String args[]) {
new FormatterProblem().buildGUI();
}

private void buildGUI() {
Shell shell = new Shell();
final Display d = shell.getDisplay();
shell.setBounds(100, 100, 300, 100);
shell.setLayout(new GridLayout());
Composite buttonGroup = new Composite(shell, SWT.BORDER);
buttonGroup.setLayout(new GridLayout());
buttonGroup.setLayoutData(new GridData());
final Button addButton = new Button(buttonGroup, SWT.PUSH);
addButton.setLayoutData(new GridData());
SelectionAdapter buttonSelection = new SelectionAdapter() {
//....
};
addButton.addSelectionListener(buttonSelection);

shell.open();
		
while (!shell.isDisposed()) {
if (!d.readAndDispatch())
d.sleep();
}
}
}
Comment 1 Philipe Mulet CLA 2002-01-16 10:04:05 EST
Formatter issues will be reconsidered post 2.0
Comment 2 Philipe Mulet CLA 2002-07-25 06:30:56 EDT
Resurrecting formatter issues in 2.1 stream.
Comment 3 Philipe Mulet CLA 2002-07-25 06:32:44 EDT
Clearing resolution
Comment 4 Olivier Thomann CLA 2003-01-15 13:22:52 EST
We need to clear 2.1 bug reports that won't be addressed before 2.1. The new 
implementation is still in the works. Therefore we cannot include it for 2.1. 
Not enough testing and we need to polish the preferences. This will be address 
for 2.2 as stated in the JDT/Core plan.
Comment 5 Philipe Mulet CLA 2003-06-12 06:35:56 EDT
Resurrecting for 3.0
Comment 6 Philipe Mulet CLA 2003-08-28 12:29:28 EDT
Resurrecting
Comment 7 Olivier Thomann CLA 2003-10-03 09:46:01 EDT
This is addressed in the new formatter.
Fixed and released in HEAD.
Regression test added.
Comment 8 David Audel CLA 2003-10-13 09:15:11 EDT
Verified.