-
Bug
-
Resolution: Not an Issue
-
P3
-
7u45
The following code:
import java.util.Comparator;
class GenericMethod {
<E extends Comparable<E>> Comparator<E> getComparator() {
return null;
}
<E> void useComparator(Comparator<? super E> comparator) {
}
void test() {
useComparator(this.getComparator());
}
}
Compiles with javac8 -target 7 but fails to compile with javac7 target 7.
import java.util.Comparator;
class GenericMethod {
<E extends Comparable<E>> Comparator<E> getComparator() {
return null;
}
<E> void useComparator(Comparator<? super E> comparator) {
}
void test() {
useComparator(this.getComparator());
}
}
Compiles with javac8 -target 7 but fails to compile with javac7 target 7.
- relates to
-
JDK-8033718 Inference ignores capture variable as upper bound
-
- Closed
-