Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322913 - [typing] Correct indentation does not work for return statements
Summary: [typing] Correct indentation does not work for return statements
Status: CLOSED DUPLICATE of bug 65317
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux-GTK
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-17 11:34 EDT by Ulli Hafner CLA
Modified: 2010-08-18 03:48 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 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 ***