-
Bug
-
Resolution: Fixed
-
P3
-
8u20, 9
-
b39
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085453 | emb-9 | Maurizio Cimadamore | P3 | Resolved | Fixed | team |
Here's the repro:
===
import java.util.List;
class Test {
interface TypeToken<B> {}
interface TypeMap<B> {
<T extends B> T getInstance(TypeToken<T> type);
}
void m(TypeMap<Iterable<?>[]> map, TypeToken<List<Integer>[]> type) {
List<Integer>[] result = map.getInstance(type);
}
}
===
$ javac Test.java
...
java.lang.NullPointerException
at com.sun.tools.javac.comp.Infer$IncorporationStep$7.apply(Infer.java:874)
at com.sun.tools.javac.comp.Infer.checkWithinBounds(Infer.java:596)
at com.sun.tools.javac.comp.Infer$GraphSolver.solve(Infer.java:1681)
at com.sun.tools.javac.comp.Infer$InferenceContext.solve(Infer.java:2315)
at com.sun.tools.javac.comp.Infer$InferenceContext.solve(Infer.java:2307)
at com.sun.tools.javac.comp.Infer$InferenceContext.solve(Infer.java:2322)
at com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:201)
at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:568)
at com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:606)
...
===
import java.util.List;
class Test {
interface TypeToken<B> {}
interface TypeMap<B> {
<T extends B> T getInstance(TypeToken<T> type);
}
void m(TypeMap<Iterable<?>[]> map, TypeToken<List<Integer>[]> type) {
List<Integer>[] result = map.getInstance(type);
}
}
===
$ javac Test.java
...
java.lang.NullPointerException
at com.sun.tools.javac.comp.Infer$IncorporationStep$7.apply(Infer.java:874)
at com.sun.tools.javac.comp.Infer.checkWithinBounds(Infer.java:596)
at com.sun.tools.javac.comp.Infer$GraphSolver.solve(Infer.java:1681)
at com.sun.tools.javac.comp.Infer$InferenceContext.solve(Infer.java:2315)
at com.sun.tools.javac.comp.Infer$InferenceContext.solve(Infer.java:2307)
at com.sun.tools.javac.comp.Infer$InferenceContext.solve(Infer.java:2322)
at com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:201)
at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:568)
at com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:606)
...
- backported by
-
JDK-8085453 Inference: NullPointerException during bound incorporation
-
- Resolved
-