-
Bug
-
Resolution: Won't Fix
-
P5
-
None
-
5.0, 6
-
generic
-
generic
From: ###@###.###
Date: Thu, 24 Mar 2005 19:21:27 +0100
public class AttributeList extends ArrayList {
public AttributeList(AttributeList al) {...}
public AttributeList(List<Attribute> l) {...}
}
For some surprising compatibility reasons, AttributeList can't extend
ArrayList<Attribute>, even though that is what it really is. It just
extends raw ArrayList.
What we're seeing is that the following code:
AttributeList al =
new AttributeList(new AttributeList());
gives the following error:
AL.java:6: reference to AttributeList is ambiguous, both method
AttributeList(javax.management.AttributeList) in
javax.management.AttributeList and method
AttributeList(java.util.List<javax.management.Attribute>) in
javax.management.AttributeList match
AttributeList al = new AttributeList(new AttributeList());
^
###@###.### 2005-03-24 20:00:46 GMT
Date: Thu, 24 Mar 2005 19:21:27 +0100
public class AttributeList extends ArrayList {
public AttributeList(AttributeList al) {...}
public AttributeList(List<Attribute> l) {...}
}
For some surprising compatibility reasons, AttributeList can't extend
ArrayList<Attribute>, even though that is what it really is. It just
extends raw ArrayList.
What we're seeing is that the following code:
AttributeList al =
new AttributeList(new AttributeList());
gives the following error:
AL.java:6: reference to AttributeList is ambiguous, both method
AttributeList(javax.management.AttributeList) in
javax.management.AttributeList and method
AttributeList(java.util.List<javax.management.Attribute>) in
javax.management.AttributeList match
AttributeList al = new AttributeList(new AttributeList());
^
###@###.### 2005-03-24 20:00:46 GMT
- duplicates
-
JDK-6245990 Compiler says constructor invocation is ambiguous when it is not
-
- Closed
-
- relates to
-
JDK-6250772 Some classes in JMX API mix generic and raw types
-
- Resolved
-