RFR: 8279876: Clean up: isAssignableFrom usages in xpath and jdk internal classes [v2]

Joe Wang joehw at openjdk.java.net
Wed Apr 6 01:23:16 UTC 2022


On Tue, 5 Apr 2022 23:55:22 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> Joe Wang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   replace with instanceof
>
> src/java.xml/share/classes/jdk/xml/internal/JdkXmlFeatures.java line 326:
> 
>> 324:     public void setFeature(int index, State state, Object value) {
>> 325:         boolean temp;
>> 326:         if (Boolean.class.isInstance(value)) {
> 
> Could this be `value instanceof Boolean`?

Looks like instanceof is preferable in this case. Replaced.

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

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


More information about the core-libs-dev mailing list