RFR: 8318113: CSS.BackgroundImage doesn't implement equals [v3]

Andrey Turbanov aturbanov at openjdk.org
Thu Nov 16 10:22:39 UTC 2023


On Fri, 10 Nov 2023 21:12:16 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use Objects.hashCode and add bugid
>
> src/java.desktop/share/classes/javax/swing/text/html/CSS.java line 2971:
> 
>> 2969:         @Override
>> 2970:         public int hashCode() {
>> 2971:             return (this.svalue != null) ? this.svalue.hashCode() : 0;
> 
> This change look fine, but this line can be simplified by the Objects.hashCode();

@prsadhuk idea was to replace whole expression with `Objects.hashCode` (it allows nulls).
Current code looks confusing.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16613#discussion_r1395471343


More information about the client-libs-dev mailing list