Bug 102022 - Classfile format after extending parameterized generic type incompatible with javac
Summary: Classfile format after extending parameterized generic type incompatible with...
Status: RESOLVED DUPLICATE of bug 101794
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: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-28 10:42 EDT by Andreas Hartl CLA
Modified: 2005-06-28 12:02 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Hartl CLA 2005-06-28 10:42:22 EDT
If one extends a generic class with type information already parameterized, the 
resulting class file is rejected by javac for an "undeclared type variable".

Sample:
public class ErrorList extends AbstractList<String> {

  public String get(int index) {
    return "Some string";
  }

  public int size() {
    return 5; // irrelevant
  }

}

public class ListTest {
  
  public static void main(String ... args) {
    System.out.println(ErrorList.class.getName());
  }

}


When compiling both classes with javac and Eclipse, respectively, ListTest 
prints "ErrorList", as expected. When compiling ErrorList with Eclipse and 
ListTest with javac, javac gives the following error message:

ListTest.java:26: cannot access ErrorList
bad class file: ..\bin\ErrorList.class
undeclared type variable: E
Please remove or make sure it appears in the correct subdirectory of the 
classpath.
    System.out.println(ErrorList.class.getName());
                       ^
1 error
Comment 1 Olivier Thomann CLA 2005-06-28 11:23:04 EDT
Could not reproduce with I20050627-1435.
Looks like a dup of bug 101794.
Could you please try to reproduce it with I20050627-1435?
Comment 2 Philipe Mulet CLA 2005-06-28 12:02:03 EDT
This indeed is a dup. Glad we resolved it for 3.1 in the end.

*** This bug has been marked as a duplicate of 101794 ***