Community
Participate
Working Groups
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; } }
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