| Summary: | [typing] Line indents too much on return | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Eric Jain <eric.jain> |
| Component: | Text | Assignee: | Dani Megert <daniel_megert> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | daniel_megert, deepakazad, Olivier_Thomann, rthakkar |
| Version: | 3.7 | ||
| Target Milestone: | 3.7 M4 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
I can attach my code formatter settings if there is any problem reproducing the issue. Note that the formatter handles this code fine, the extra indentation appears only when hitting enter. Moving to JDT/Text I've reverted all recently made indent fixes. Verified for 3.7M4 with I20101206-1800. |
Build Identifier: I20101028-1441 Looks like this only happens after the first line of an else (or else if) block when the preceding else (or else if) block ends with a foreach block. Reproducible: Always Steps to Reproduce: public int sum(int... values) { int sum = 0; if (values != null) { for (int value : values) { sum += value; } } else { sum = -1; // hit return at the end of this line } return sum; } -> the new line after 'sum = -1' is indented 5 instead of 3 levels