Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 184766

Summary: [extract interface] extract interface: problem with type param bound
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: lchen
Version: 3.2.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Adam Kiezun CLA 2007-04-30 14:59:34 EDT
3.2.2 

1. put the source in two files
2. select MList
3. extract interface Bag from MList, include add, addAll (exclude sort)
4. note, the outcome does not compile (bound of T changes from MList<E> to Bag<E>, but Bag does not include sort() so compiler complains)
5. Note that it works ok if both classes are in the same file (i.e. no compile errors)

public class Algo<E,T extends MList<E>> {
    public Algo<E,T> populate(T v5, E e1){
        return this;
    }
        
    public Algo<E,T> update(T v6,E e2){
        return this;
    }

    public void sortList(T v8) { v8.sort(); }
    
    public void print(T v9) {

    }
}
class MList<E> {

    public MList<E> add(E e) {
        return this;
    }


    public MList<E> addAll(MList<E> v1) {
        return this;
    }


    public void sort() { /* insertion sort */
    }
}
Comment 1 Eclipse Genie CLA 2020-03-02 08:40:15 EST
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.