RFR: 8353845: com.sun.javafx.css.BitSet.equals(null) throws NPE [v2]
Ambarish Rapte
arapte at openjdk.org
Wed Apr 9 12:30:40 UTC 2025
On Wed, 9 Apr 2025 09:07:40 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> Fixes the bug that `BitSet.equals(null)` throws NPE.
>>
>> A single reviewer should be sufficient.
>
> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>
> obj == null
modules/javafx.graphics/src/main/java/com/sun/javafx/css/BitSet.java line 540:
> 538: return false;
> 539: }
> 540:
Here is a suggestion to modify this source as:
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return equalsBitSet((BitSet<?>) obj);
and with this the call to `super.equals()` won't be necessary. It seems it was unnecessary earlier too. it might have been added only to avoid missing return error.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1766#discussion_r2035261514
More information about the openjfx-dev
mailing list