Community
Participate
Working Groups
Build Identifier: I20110613-1736 Extract interface with the option to use the extracted interface where possible will produce uncompilable code and also does not handle generics. public class Concrete { public int a; public int b; public int getA() { return a; } public Concrete(int a, int b) { super(); this.a = a; this.b = b; } public void setA(int a) { this.a = a; } public int getB() { return b; } public void setB(int b) { this.b = b; } } public interface IGeneric<V,T> { V getKey(); T getValue(); } public class Impl implements IConrete { @Override public String getKey() { // TODO Auto-generated method stub return null; } @Override public Concrete getValue() { List<Concrete> list = new ArrayList<Concrete>(); return list.get(0); } } public interface IConcrete extends IGeneric<String,Concrete> { } Extracting interface from Concrete to ISomeInterface will generate: public class Impl implements IConcrete { @Override public String getKey() { // TODO Auto-generated method stub return null; } @Override public ISomeInterface getValue() /* COMPILER ERROR. IConcrete was not refactored so the return type of getValue() is incorrect */ { /*Missed opportunity to refactor type of List<Concrete> */ List<Concrete> list = new ArrayList<Concrete>(); return list.get(0); } } Reproducible: Always Steps to Reproduce: See description
Can reproduce with 3.8 build I20111021-0800. As for updating the list: /*Missed opportunity to refactor type of List<Concrete> */ List<Concrete> list = new ArrayList<Concrete>(); see bug 107192.
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.