6956840: (ch) Rawtype warning when compiling sun.nio.ch.CompletedFuture
authorandrew
Fri, 28 May 2010 16:59:44 +0100
changeset 5625 84f7c40fa33e
parent 5623 5c9695dc013a
child 5626 f0a0028ce788
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
jdk/src/share/classes/sun/nio/ch/CompletedFuture.java
--- a/jdk/src/share/classes/sun/nio/ch/CompletedFuture.java	Tue May 25 15:39:38 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/ch/CompletedFuture.java	Fri May 28 16:59:44 2010 +0100
@@ -44,20 +44,17 @@
         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);