| Summary: | [Change Method Signature] incorrectly rewrites type variable with concrete type | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Tobias Widmer <tobias_widmer> |
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | michschn |
| Version: | 3.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | stalebug | ||
Markus, can you please investigate. That's a difficult problem. When you change Sub#add(String) to add(Object...), then I can't change Top#add(E) to add(E...), since the methods would then not override any more and introduce a name clash in Sub. The current behavior is the best you can get in this situation, unless you change the type argument in the extends clause (which we certainly won't do in change method signature). However, when you start the refactoring on Top#add(E) and change the type to E..., then you currently get an error telling that the refactoring may fail, and Sub#add(String) is changed to add(E...) instead of add(String...). This case could be improved by playing the substitution rules, but that's IMO out of scope for 3.1. Unhappy, but fixing this really sounds to risky. However, we have to understand this better in the 3.2 cycle. At least we should flag an error in this case to warn the user about this problem. Markus, can we detect this ? Moving to 3.2 then. *** Bug 302832 has been marked as a duplicate of this bug. *** 3.2? ;) > 3.2? ;)
You can always attach a patch to speed things up ;-).
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. |
3.1 RC2 Steps to reproduce: - Consider following snippet: class Top<E> { void add(E e) {} } class Sub extends Top<String> { void add(String s) {} } - Invoke CMS, change String in Sub to Object... -> E in Top is replaced by Object... -> Should rewrite using E...