RFR: 8280035: Use Class.isInstance instead of Class.isAssignableFrom where applicable

ExE Boss duke at openjdk.java.net
Tue Mar 22 05:31:32 UTC 2022


On Mon, 21 Feb 2022 12:16:53 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> Method `isAssignableFrom` is opposite: it brings unnecessary complexity in the code. And it's easy to confuse orders of parameters. Even JBS confirms that:

Maybe we should add `Class::isSubclassOf(Class<?> that)` that performs `that.isAssignableFrom(this)`:

-------------

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


More information about the serviceability-dev mailing list