Fix java 9 build

We removed a cast we needed to appease Java 9. I've recreated it
in simpler form and left a comment about why we need it.
This commit is contained in:
Nik Everett 2016-12-19 17:34:09 -05:00
parent 8de4be9e4d
commit e508f2ef6a
1 changed files with 3 additions and 1 deletions

View File

@ -249,7 +249,9 @@ public abstract class AbstractSortTestCase<T extends SortBuilder<T>> extends EST
@SuppressWarnings("unchecked")
private T copy(T original) throws IOException {
return copyWriteable(original, namedWriteableRegistry,
/* The cast below is required to make Java 9 happy. Java 8 infers the T in copyWriterable to be the same as AbstractSortTestCase's
* T but Java 9 infers it to be SortBuilder. */
return (T) copyWriteable(original, namedWriteableRegistry,
namedWriteableRegistry.getReader(SortBuilder.class, original.getWriteableName()));
}
}