On Thu, 16 Nov 2023 10:51:48 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

>> CSSBackgroundImage.equals() is implemented
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Use Objects.hashCode

src/java.desktop/share/classes/javax/swing/text/html/CSS.java line 2971:

> 2969:         @Override
> 2970:         public int hashCode() {
> 2971:             return Objects.hashCode(this.svalue);

Suggestion:

            return Objects.hashCode(svalue);

Using `this` is also redundant.

src/java.desktop/share/classes/javax/swing/text/html/CSS.java line 2977:

> 2975:         public boolean equals(Object val) {
> 2976:             return val instanceof CSS.BackgroundImage img
> 2977:                    && Objects.equals(this.svalue, img.svalue);

Suggestion:

            return val instanceof CSS.BackgroundImage img
                   && Objects.equals(svalue, img.svalue);

Using `this` is redundant. You didn't use it in other implementations.

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

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

Reply via email to