On Thu, 20 Jan 2022 01:34:20 GMT, Phil Race <p...@openjdk.org> wrote:

>In short I see insufficient value in the changes here and would prefer you 
>drop the client part so I don't have to worry about it.

I think, usage of `isInstance` is much clear for most java developers. Everyone 
knows about java _instanceof_ operator. And `isInstance` method javadoc is very 
straight forward: `This method is the dynamic equivalent of the Java language 
instanceof operator.`

Method `isAssignableFrom` is opposite: it brings unnecessary complexity in the 
code. And it's easy to confuse orders of parameters. Even JBS confirms that:
1. [Wrong isAssignableFrom test when adding Principal to Subject 
](https://bugs.openjdk.java.net/browse/JDK-8034820)
2. [isAssignableFrom checks in KeyFactorySpi.engineGetKeySpec appear to be 
backwards](https://bugs.openjdk.java.net/browse/JDK-8254717)
3. [isAssignableFrom checks in AlgorithmParametersSpi.engineGetParameterSpec 
appear to be backwards](https://bugs.openjdk.java.net/browse/JDK-8279800)

So, it gives all 3 points to prefer isInstance method: it's shorter, it's 
clearer for most java developers, it's faster.

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

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

Reply via email to