| Summary: | [1.8][lambda][formatter] if/else within lambda is incorrectly formatted | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Brandon Pedersen <bpedman> |
| Component: | Core | Assignee: | Mateusz Matela <mateusz.matela> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, manju656, manoj.palat, noufaln26 |
| Version: | 4.4 | ||
| Target Milestone: | 4.6 M2 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | To be verified for 4.6 M4 | ||
This issue has been resolved by the formatter redesign bug 303519. Test case committed via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=f5f144eaadfc3b2a6a242fa2d3bde9667704484e *** This bug has been marked as a duplicate of bug 303519 *** |
Overview: If I have an if/else statement inside a lambda it gets incorrectly formatted with certain formatter settings Steps To Reproduce: - Open formatter settings - On braces tab select "next line" for blocks - On control statements check "Insert new line before 'else' in an 'if' statement - Create a simple test that uses an if/else inside a lambda, like so: Executors.newSingleThreadExecutor().execute(() -> { if (true) { System.err.println("foo"); } else { System.err.println("bar"); } }); Actual results: Not sure if bugzilla will format this correctly but the above example is what I see. The entire else block is shifted over to the right when it shouldn't be. Expected results: The else block should be lined up with the if statement Build: Has been happening on Kepler with java 8 patches as well as the 4.4 nightly/integration builds with java 8 added (on a Mac)