Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 130526

Summary: Correct indentation and smart Return don't indent complex boolean expressions
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2006-03-06 06:34:25 EST
I20060301-0800 (already wrong in 3.1.2)

public class Try {
	boolean test(int thisIsAVeryLongName, int anotherVeryLongName) {
		return (thisIsAVeryLongName == 1 && anotherVeryLongName == 1)
				|| thisIsAVeryLongName == 2; // 2 more tabs
	}
}

Format with default settings does not touch the code (good).

Correct Indentation left-aligns the line '|| thisIsAVeryLongName == 2;' with the return statement above. Typing return after first line of the return statement also places the caret on the next line, indented with 2 tabs. Expected: 4 tabs.
Comment 1 Tom Hofmann CLA 2006-03-06 06:36:31 EST

*** This bug has been marked as a duplicate of 65317 ***