-
Bug
-
Resolution: Fixed
-
P2
-
5.0
-
b51
-
generic
-
generic
The following code appears to be legal but does not compile:
public class AOV {
protected <T extends Object & Comparable<? super T>> void
addObjectValue(String elementName,
Class<T> classType,
T defaultValue,
Comparable<? super T> minValue,
Comparable<? super T> maxValue,
boolean minInclusive,
boolean maxInclusive)
{ }
static class Sub extends AOV {
protected <T extends Object & Comparable<? super T>> void
addObjectValue(String elementName,
Class<T> classType,
T defaultValue,
Comparable<? super T> minValue,
Comparable<? super T> maxValue,
boolean minInclusive,
boolean maxInclusive)
{ }
}
}
% /java/re/jdk/1.5/promoted/all/b49/binaries/linux-i586/bin/javac -source 1.5 AOV.java
AOV.java:14: name clash: <T>addObjectValue(java.lang.String,java.lang.Class<T>,T,java.lang.Comparable<? super T>,java.lang.Comparable<? super T>,boolean,boolean) in AOV.Sub and <T>addObjectValue(java.lang.String,java.lang.Class<T>,T,java.lang.Comparable<? super T>,java.lang.Comparable<? super T>,boolean,boolean) in AOV have the same erasure, yet neither overrides the other
static class Sub extends AOV {
^
1 error
%
It doesn't compile on b32, b47, or b48 either.
-- ###@###.### 2004/5/2
public class AOV {
protected <T extends Object & Comparable<? super T>> void
addObjectValue(String elementName,
Class<T> classType,
T defaultValue,
Comparable<? super T> minValue,
Comparable<? super T> maxValue,
boolean minInclusive,
boolean maxInclusive)
{ }
static class Sub extends AOV {
protected <T extends Object & Comparable<? super T>> void
addObjectValue(String elementName,
Class<T> classType,
T defaultValue,
Comparable<? super T> minValue,
Comparable<? super T> maxValue,
boolean minInclusive,
boolean maxInclusive)
{ }
}
}
% /java/re/jdk/1.5/promoted/all/b49/binaries/linux-i586/bin/javac -source 1.5 AOV.java
AOV.java:14: name clash: <T>addObjectValue(java.lang.String,java.lang.Class<T>,T,java.lang.Comparable<? super T>,java.lang.Comparable<? super T>,boolean,boolean) in AOV.Sub and <T>addObjectValue(java.lang.String,java.lang.Class<T>,T,java.lang.Comparable<? super T>,java.lang.Comparable<? super T>,boolean,boolean) in AOV have the same erasure, yet neither overrides the other
static class Sub extends AOV {
^
1 error
%
It doesn't compile on b32, b47, or b48 either.
-- ###@###.### 2004/5/2
- relates to
-
JDK-6180021 REGRESSION: javac throws exception: CompletionFailure during TypeTrans
-
- Closed
-