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

Bug 404427

Summary: Line wrapping indentation policy "Indent on column" fails for nested function call expressions
Product: [Eclipse Project] JDT Reporter: Niclas Wiberg <niclas.wiberg>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3    
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
The main method shows both the actual and the expected indentation none

Description Niclas Wiberg CLA 2013-03-27 05:44:31 EDT
Created attachment 229079 [details]
The main method shows both the actual and the expected indentation

Indentation policy "Indent on column" fails for some complex multi-line expression. This occurs when there are multiple nested function calls.

Tab policy is "Spaces only"
Line wrapping is "never join already wrapped lines"
Indentation policy for Function calls set to "Indent on column"

Eclipse Platform Version: 4.2.1

Example follows below, also attached.

package indentation;

public class IndentationTest {

    public static void main(String... args) {

        // Manual line breaks, automatic indentation
        // Indentation policy for Function calls
        // (under Line wrapping tab) set to "Indent on column"
        // Argument line-up is erroneous:
        System.out.println(plus(times(pow(2, 3),
                                      pow(4, 5)),
                                      times(6, 7)));

        // It should look like this:
        System.out.println(plus(times(pow(2, 3),
                                      pow(4, 5)),
                                times(6, 7)));
    }
    
    private static int plus(int a, int b) {
        return a + b;
    }
    
    private static int times(int a, int b) {
        return a * b;
    }
    
    private static int pow(int a, int b) {
        return (int) Math.pow(a, b);
    }
}
Comment 1 Eclipse Genie CLA 2020-02-03 17:12:27 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.