On Wed, 17 May 2023 21:12:48 GMT, Andy Goryachev <[email protected]> wrote:

>> John Hendrikx has updated the pull request incrementally with three 
>> additional commits since the last revision:
>> 
>>  - Override hashCode with a comment explaining why
>>  - Fix style issues
>>  - Restore removed public method
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/css/BitSet.java line 233:
> 
>> 231:     @Override
>> 232:     public boolean containsAll(Collection<?> c) {
>> 233:         if (this.getClass() != c.getClass()) {
> 
> this change is not equivalent: in the old code, null `c` would return false, 
> in the new it'll throw an NPE

That's correct, before it broke the contract of `Set`.  It's not supposed to 
return `false` when the parameter is `null`.  This class is sometimes exposed 
as public API (via `ObservableSet`) and so must respect the `Set` contract.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1070#discussion_r1197092382

Reply via email to