OpenJDK compiler 6b20pre on Maverick doesn't recognize Generics Correctly
Bug #611284 reported by
Lorenzo Zoffoli
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openjdk-6 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
OpenJDK compiler can't unify custom type defined in signature by generics.
Example:
import java.util.List;
public class GenericBug {
public <X extends String, Y extends List<X>, Z extends List<X>> Z add(X element, Y list){
return list;
}
}
This code compile correctly on Sun JDK but OpenJDK compiler displays error:
"incompatible types
required: Z
found: Y"
But btw Z and Y is the same type: List<X>
description: | updated |
description: | updated |
To post a comment you must log in.
Status changed to 'Confirmed' because the bug affects multiple users.