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

Naoto Sato naoto at openjdk.java.net
Tue Apr 5 23:59:43 UTC 2022


On Tue, 5 Apr 2022 23:05:47 GMT, Joe Wang <joehw at openjdk.org> wrote:

> Clean up the usages of isAssignableFrom in a few xpath and jdk/internal classes where the checks were really about equality or whether they were the exact class types. It was why they worked nonetheless even though some of them were backwards.
> 
> Test: existing tests passed.

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`?

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

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


More information about the core-libs-dev mailing list