Bug 79173 - create class which inherits from generics base class
Summary: create class which inherits from generics base class
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-22 07:33 EST by mike andrews CLA
Modified: 2004-11-22 08:58 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mike andrews CLA 2004-11-22 07:33:42 EST
when creating class which inherits from generics base class, such as HashMap,
class is not generated correctly. resulting class throws compiler errors
relating to generics. see example below:

NOTE: first line should correctly be "public class LoggingMap<K, V> extends
HashMap<K, V> {"

------------------------------------------

package com.xx.xx;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 *
 * @author mike
 */
public class XyzMap extends HashMap {

    public XyzMap(int initialCapacity, float loadFactor) {
        super(initialCapacity, loadFactor);

    }

    public XyzMap(int initialCapacity) {
        super(initialCapacity);

    }

    public XyzMap() {
        super();

    }

    public XyzMap(Map< ? extends K, ? extends V> m) {
        super(m);

    }

}
Comment 1 mike andrews CLA 2004-11-22 07:35:28 EST
oops.... here is correction.... [get rid of reference to 'LoggingMap']

NOTE: first line should correctly be "public class XyzMap<K, V> extends
HashMap<K, V> {"

Comment 2 Philipe Mulet CLA 2004-11-22 08:58:38 EST
Testcase is properly rejected, as unable to resolve K or V.
When adding type parameters <K,V> to XyzMap, the example compiles clear in latest.
Closing as worksforme. Pls reopen if you still think something is wrong.