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

Bug 393715

Summary: [use supertype] Invoking the refactoring on a class that extend a generic class and is declared in a generic class yields compilation error
Product: [Eclipse Project] JDT Reporter: Milos Gligoric <milos.gligoric>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: manju656
Version: 4.2.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Milos Gligoric CLA 2012-11-06 16:37:58 EST
Steps to reproduce:
1. Invoke "Use Supertype Where Possible" refactoring on "MyMap" class.
2. There is a compilation error as the result of the refactoring.

import java.util.HashMap;

public class UseSupertypeWherePossibleBug<T> {
    private MyMap field;

    static class MyMap extends HashMap<Integer, Integer> {
        public MyMap m2() {
            return null;
        }
    }

    public UseSupertypeWherePossibleBug(MyMap field) {
        this.field = field;
    }

    void m1() {
        MyMap local = field.m2();
        new UseSupertypeWherePossibleBug<T>(local);
    }
}

Maybe the same as https://bugs.eclipse.org/bugs/show_bug.cgi?id=393516
Comment 1 Martin Mathew CLA 2012-12-17 03:08:15 EST
Issue is reproducible using I20121210-0800. The refactoring results in compiler error. bug 393516 looks related but not the same.
Comment 2 Eclipse Genie CLA 2020-01-25 04:38:33 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.