RFR: 7083187: Class CSS.CssValue is missing implementations of equals() and hashCode() [v10]

Prasanta Sadhukhan psadhukhan at openjdk.org
Wed May 31 09:28:04 UTC 2023


On Wed, 31 May 2023 08:53:56 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> It is because only the float "value" is being considered and not the `lu` units px/pt
>
> Yet `equals` currently just compares `svalue`… It looks weird.

It might looks weird but it is the one which is working.
For example, for `{"font-size: 42px", "font-size: 22px"}`

`value` is 0.0
`svalue` is 42px, 22px
index false
lu.units px
so if I check 


return val instanceof CSS.FontSize size
                   && value == size.value
                   && index == size.index
                   && Objects.equals(lu, size.lu);



it will return equals `true `even though it should not be equal which is why I used `svalue`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13405#discussion_r1211357733



More information about the client-libs-dev mailing list