| Summary: | [formatter] Extra white space after a full lambda body when in a method invocation argument | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Petr Dolezal <petr.dolezal> |
| Component: | Core | Assignee: | Mateusz Matela <mateusz.matela> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | dusisarath, mateusz.matela |
| Version: | 4.5.1 | ||
| Target Milestone: | 4.5.2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 475793 *** Verified for Eclipse Mars 4.5.2 Build id: M20160113-1000 |
When a lambda body with braces appears as an argument in a method invocation and other parameter follows, the formatter puts an extra white space between the closing brace of the lambda body and the comma separating it from the next argument. Tested with Eclipse Mars 4.5.1, "Eclipse [built-in]" formatter. Consider function declaration like this: void foo(Consumer<Object> s, int dummy); Invocation like: foo(o -> { }, 0); is formatted as: foo(o -> { } , 0); Curiously, this does not happen with an anonymous class: foo(new Consumer<Object>() { public void accept(Object o) { } }, 1); It seems that enabling "white space after block closing brace" overrides disabling "white space before a comma". Guessing that either white space settings for method parameters should have higher precedence, or a special setting(s) for lambda body formatting are needed.