| Summary: | [quick fix] create method in super types | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Andrew Taylor <andy> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | jasonab, markus.kell.r, martinae, mn |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Moving to JDT UI Andrew, and what this quick fix should suggest for something like 'SpecializedSprocket extends Sprocket implements A, B, C, D'? Hmmm, perhaps - create in Sprocket - create in A - create in B - create in C - create in D If it's created in A-D (interfaces) it needs to be created in an impl, but that can be left, I think. There will be another error to resolve but that is easy enough and can be done at the appropriate place (ie the root impl of the changed interface or descendants, mark abstract, etc). If there are many interfaces, the quickfix could get ugly, but in reality, it's rare that I use more than 2, personally. Hmm, more accurately: - Create doSomethingElse() - create Sprocket.doSomethingElse() - create A.doSomethingElse() - create B.doSomethingElse() - create C.doSomethingElse() - create D.doSomethingElse() This bug appears to have been implemented in another one. (In reply to comment #5) > This bug appears to have been implemented in another one. I don't see the quick fix requested here. There is a quick fix for super.doSomethingElse(), but that's something else. *** This bug has been marked as a duplicate of bug 50749 *** |
When choosing quick fix where create method is an option, if the current class descends from another class, a choice should be offered to create in super. Ie: public class SpecializedSprocket extends Sprocket { public void something() { doSomethingElse(); // ^-- quick fix on non-existant method here } } quick fix panel should contain - create doSomethingElse() - create Sprocket.doSomethingElse() Created method should be protected, of course. Thoughts? Thanks for making my life easier :)