Bug 167820

Summary: Code formatter: removing space after 'return' and 'throw' does not work
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: 3.3 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2006-12-13 05:14:00 EST
I20061212-0010

The checkboxes for code formatter settings White Space > Insert space: > Control statements > 'return'/'throw' > before parenthesized expression do nothing.

When formatting the class below, a space is always added. The preview also does not show a change. In 3.3M3, the option for 'return' worked as expected.


public class Foo {
	public void test() throws Exception {
		throw(new IllegalStateException());
	}
	
	int m() {
		return(1);
	}
	
	protected void tearDown() throws Exception {
		throw new IllegalStateException();
	}

	int xyz() {
		return 1;
	}
}
Comment 1 Martin Aeschlimann CLA 2006-12-15 16:48:19 EST
This seems to work fo me in I20061214-1445: In the preferences preview, as well when formatting. Maybe you have some other settings that override that setting? Olivier?
Comment 2 Markus Keller CLA 2006-12-15 17:21:47 EST
I have 'White Space > Expressions > Parenthesized expressions > before opening parenthesis' checked. If I uncheck that option, then the problem from comment 0 disappears.

I don't have a good idea right now how to make such dependencies more visible. OK to close if think it's OK as it is.
Comment 3 Olivier Thomann CLA 2006-12-22 15:29:22 EST
Different options might indeed interfere.
No way to prevent this kind of side effect.
Closing as INVALID.