| Summary: | [extract method] Extract code in a method that returns generic type causes compilation error | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Milos Gligoric <milos.gligoric> |
| Component: | UI | Assignee: | Deepak Azad <deepakazad> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | deepakazad, markus.kell.r, reprogrammer |
| Version: | 3.7.1 | ||
| Target Milestone: | 3.8 M5 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Refactorings have a few other bugs in handling generics (See Bug 94639, Bug 240353, and Bug 357998). We were not copying the type bounds, simple fix. Fixed in master - e5035aaa0b268ce1b0110eaddb3424e954aa45eb |
Build Identifier: Version: 3.7.1 Build id: I20110613-1736 Extract method refactoring introduces incorrect return type for the extracted method. Reproducible: Always Steps to Reproduce: 1. Mark "toExtract(list)" in the example below 2. Perform ExtractMethod refactoring 3. The resulting code is not compilable class ExtractMethod { class C { void m() { } } <T extends Comparable<? super T>> void method(List<T> list) { toExtract(list).m(); } static <T extends Comparable<? super T>> C toExtract(List<T> list) { return null; } }