The fix for JDK-4774077 introduced covariant return types in the NIO buffer hierarchy.
As a consequence that fix introduced redundant casts (and because of -Werror a build failure) in langtools when compiling with JDK 9, but the casts are still required when bootstrapping with JDK 8.
The fix forJDK-8062376 added @SuppressWarnings("cast") annotations to ensure no build failure.
When JDK 9 becomes the default bootstrap JDK the @SuppressWarnings("cast") and casts can be removed.
As a consequence that fix introduced redundant casts (and because of -Werror a build failure) in langtools when compiling with JDK 9, but the casts are still required when bootstrapping with JDK 8.
The fix for
When JDK 9 becomes the default bootstrap JDK the @SuppressWarnings("cast") and casts can be removed.
- relates to
 - 
                    
JDK-8189094 Change required boot jdk to JDK 9
-         
     - Resolved
 
 -         
 - 
                    
JDK-8062376 Suppress cast warnings when using NIO buffers
-         
     - Closed
 
 -         
 - 
                    
JDK-6723459 Compiler should flag where warning suppression is not required
-         
     - Open
 
 -         
 - 
                    
JDK-4774077 Use covariant return types in the NIO buffer hierarchy
-         
     - Closed
 
 -