| Summary: | [typing] Ctrl-I (Correct indentation) re-indentation of string argument to method call is incorrect. | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Gary <gebarnes> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux-GTK | ||
| Whiteboard: | |||
Type in two lines of code that look like this into a Java unit: xxx( yyy, "zzz"); Position your text cursor so that it is immediately in front of the first " of the string. Press the Enter/Return key. You will now have this: xxx( yyy, "zzz"); which is fine. Now type Ctrl-I (or the "Correct indentation" item on the Source menu). You will now have this: xxx( yyy, "zzz"); Interestingly enough if you add an unnecessary '+ ""' to the string expression, the indentation does not change. This: xxx( yyy, "zzz" + ""); changes to: xxx( yyy, "zzz" + ""); and stays that way even after the Ctrl-I is typed. Under the Java preferences for Java > Code Style > Formatter I am using these "Settings for arguments": "Line wrapping poliy" is "Wrap only when necessary" and "Indentation policy" is "Indent by one"