| Summary: | [refactoring] [dcr] New refactoring: create single exit point | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | David Saff <david> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | martinae |
| Version: | 3.1 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Not easy to find a good plase for this. A new refactoring is an overkill (we can't add much more refactorings to the menu), so maybe better a quick assist but it would be hard to find by the user. No plans at the moment, contributions welcome. The deferment is understandable, but the reason given is a little confusing. It looks like you're saying that there's a limit on the number of refactorings and quick assists that can be reasonably added. Isn't this a problem regardless of whether the Eclipse team or an outside contributor decides to do the implementation? Is this a good place to have such a discussion? I set this one to later as we don't plan to implement this in the near future. One reason is surely that I don't see clearly we would fit such a 'niche' refactoring in our current structure. A external contributer would surely run into the same problem. I don't have a solution for that at the moment. It's surely an area where things have to be tried out. For example as a quick assist (where we have no problem of increasing the list), but with better visibility so it is detectable by the user. Is there any way to reorganize the Refactoring menu so that it could be open to such contributions, "niche" or not? As much as I enjoy the experience of hitting Control-1 and discovering some new thing I wasn't expecting, it's also nice to have some sort of overview of possible code actions. As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you. |
I sometimes have methods like this: int findIndex(List<String> list, String entry) { for (int i = 0; i < list.size(); i++) { if (list.get(i).equals(entry)) return i; } return -1; } This method doesn't play well with refactorings like Inline Method. I'd like to be able to safely, automatically, convert it to a single-entry-point style: int findIndex(List<String> list, String entry) { int returnThis = -1; for (int i = 0; i < list.size(); i++) { if (list.get(i).equals(entry)) { returnThis = i; break; } } return returnThis; } This is non-trivial to automate, but it's also non-trivial to do by hand, and can easily be a source of mistakes.