| Summary: | [quick fix] Use MessageFormat for string concatenation :: removes comments that are inlined in the message construction | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | thomas menzel <tmenzel> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | daniel_megert |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | stalebug | ||
another even better solution is to retain the comments where they are at that respective location and split the const. pattern string accordingly.
e.g. like so:
String string = MessageFormat.format("sdfsdf" // test comment
+ "{0}", 32434);
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. |
WHAT infoking the quickfix on this code: String string = "sdfsdf" //test comment + 32434 + ""; will yield : String string = MessageFormat.format("sdfsdf{0}", 32434); and thus deletes the comment, which IMO it should not do the QF for the stringbuilder retains the comment: StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("sdfsdf" //test comment ); stringBuilder.append(32434); stringBuilder.append(""); String string = stringBuilder.toString(); SUGGESTION move the inlined comment(s) above the MessageFormat.format(...)