RFR: 8274835: Remove unnecessary castings in java.base

Joe Darcy darcy at openjdk.java.net
Wed Oct 6 17:15:08 UTC 2021

On Thu, 9 Sep 2021 20:12:47 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

> Redundant castings make code harder to read.
> Found them by IntelliJ IDEA.
> I tried to select only casts which are definitely safe to remove. Also didn't touch primitive types casts.

Curious. The JDK build is done with javac -Xlint:cast warning enabled (JDK-8032734) which is intended to catch issues like this. Perhaps IntelliJ is using a different (or sharper) analysis.


PR: https://git.openjdk.java.net/jdk/pull/5454

More information about the security-dev mailing list