JDK-8062385 : Remove @SuppressWarnings("cast") and casts for NIO related usages when JDK 9 becomes the bootstrap JDK
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-10-29
  • Updated: 2017-11-03
  • Resolved: 2017-10-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10 b29Fixed
Related Reports
Relates :  
Relates :  
Relates :  
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 for JDK-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.
Review thread: http://mail.openjdk.java.net/pipermail/compiler-dev/2017-October/011234.html