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

Bug 322913

Summary: [typing] Correct indentation does not work for return statements
Product: [Eclipse Project] JDT Reporter: Ulli Hafner <Knut.Friedhelm>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Ulli Hafner CLA 2010-08-17 11:34:23 EDT
I'm not sure if this one is related (or duplicate) to the existing correct indentation bugs. If I have a multi-line return statement, then the correct indentation function (clean up or save action) does not work correctly.

When using the eclipse formatter I get the following correct formatting (|| has an indentation with respect to return): 

public class New {
    boolean foo() {
        return "long                                                                            string ".length() == 0
                || "very long                                                                            string ".length() == 0;
    }
}

If I save that file with option 'correct indentation' I get the following result (|| is now aligned with return), which is not correct:

public class New {
    boolean foo() {
        return "long                                                                            string ".length() == 0
        || "very long                                                                            string ".length() == 0;
    }
}
Comment 1 Dani Megert CLA 2010-08-18 03:48:29 EDT

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