Rawtypes warning in sun.nio.ch.CompletedFuture

Andrew John Hughes ahughes at redhat.com
Fri May 28 06:12:23 PDT 2010

The static method withFailure in sun.nio.ch.CompletedFuture creates a
CompletedFuture as a raw type rather than with the V type introduced
in the method signature:

     static <V> CompletedFuture<V> withFailure(Throwable exc) {
         // exception must be IOException or SecurityException
         if (!(exc instanceof IOException) && !(exc instanceof
             exc = new IOException(exc);
        return new CompletedFuture(null, exc);

This causes a rawtypes warning and the build to fail (due to the use
of -Werror) when JAVAC_MAX_WARNINGS is turned on.  Adding the
appropriate type to the creation of CompletedFuture (as I assumed was
originally intended by its introduction) fixes the issue.

I also removed the SuppressWarnings annotations as they don't actually
suppress any warnings.

The webrev is:


created against current tl.

Is this ok to push?  If so, can I have a bug ID for it?

Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8

More information about the nio-dev mailing list