Fix Java 9 type inference issue

This commit fixes a compilation issue due to modified type inference in
the latest JDK 9 early access builds. We just have to lend a helping
hand to type inference by being explicit about the type.

Closes #14496
This commit is contained in:
Jason Tedor 2015-11-03 15:03:23 -05:00
parent b2c098630e
commit 2398f41db2
1 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,8 @@ public class Iterators {
throw new NullPointerException("iterators"); throw new NullPointerException("iterators");
} }
return new ConcatenatedIterator<>(iterators); // explicit generic type argument needed for type inference
return new ConcatenatedIterator<T>(iterators);
} }
static class ConcatenatedIterator<T> implements Iterator<T> { static class ConcatenatedIterator<T> implements Iterator<T> {