| Summary: | Add "Introduce return value" refactoring [refactoring] | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Oyvind Harboe <oyvind.harboe> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | Keywords: | helpwanted |
| Version: | 3.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Move to JDT/UI Do you have an example where this would really be useful and worth to be implemented? Looks more like a quick fix than a refactoring. >Do you have an example where this would really be useful and worth to be >implemented? Refactoring is not only about changing existing code. I use it all the time when I write new code. E.g. I don't write methods anymore. I write the code I need inline, then I extract a method. The idea is to write code for a specific case, and then use refactoring to generalize. It lets me focus on one thing at the time. In the particular case I was working on, I wrote an inline piece of code, but when it came time to extract a method, I "discovered" that I had modified fields in the object and that there was no way to change the modification of a field to a return code. >Looks more like a quick fix than a refactoring. "x" in the example is a field in the class, and hence there is no error. I thought "quick fixes" only exists for errors? In practical terms there is little difference between "quick fix" and "small refactoring" for me. Both rewrite the program in the fashion I'd like to have it rewritten. Øyvind Given the current planning this will not happen for 3.1 without external help. As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you. |
I.e. foo(); void foo() { x=5; } "x" -> return value => x=foo(); int foo() { return 5; }