Code formatting for long boolean return statement

I'm using the "Equals and HashCode Deluxe Generator" plugin to generate Java 7 style equals().

The resulting return statement is all on one line and I'd like to reformat this with line breaks but I can't find any options in the Code Style settings to reformat a long return statement, is this possible?

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        final Account other = (Account) obj;
        return Objects.equals(, && Objects.equals(this.accountType, other.accountType) && Objects.equals(this.currency, other.currency) && Objects.equals(this.description, other.description) && Objects.equals(this.entries, other.entries) && Objects.equals(,;


Hi Phill,

Try to set 'Project Settings | Code Style | Java | Wrapping and Braces | Binary expressions' to 'Wrap if long'. Optionally you can also check 'Binary expressions | Align when multiline' box.



That's the one! works thanks.


Please sign in to leave a comment.