提交 e400c365 编写于 作者: A andrew

6956840: (ch) Rawtype warning when compiling sun.nio.ch.CompletedFuture

Summary: Add missing generic type to CompletedFuture construction and remove unneeded SuppressWarnings annotations.
Reviewed-by: alanb
上级 35679bbf
......@@ -44,20 +44,17 @@ final class CompletedFuture<V> implements Future<V> {
this.exc = exc;
}
@SuppressWarnings("unchecked")
static <V> CompletedFuture<V> withResult(V result) {
return new CompletedFuture<V>(result, null);
}
@SuppressWarnings("unchecked")
static <V> CompletedFuture<V> withFailure(Throwable exc) {
// exception must be IOException or SecurityException
if (!(exc instanceof IOException) && !(exc instanceof SecurityException))
exc = new IOException(exc);
return new CompletedFuture(null, exc);
return new CompletedFuture<V>(null, exc);
}
@SuppressWarnings("unchecked")
static <V> CompletedFuture<V> withResult(V result, Throwable exc) {
if (exc == null) {
return withResult(result);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册