RFR: 7083187: Class CSS.CssValue is missing implementations of equals() and hashCode() [v8]
Alexey Ivanov
aivanov at openjdk.org
Mon May 22 11:03:54 UTC 2023
On Mon, 22 May 2023 09:50:21 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> Two CSS AttributeSet-s can be compared using the AttributeSet.isEqual() method which can fail due to missing implementation of equals method in CSS subclasses.
>> In this issue, even when two CSS AttributeSet has same 42 font size string value, Object equality fails.
>> Fixed by implementing the equality and hashCode method for CSS.FontSize class.
>>
>> All jtreg/jck tests are ok
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> Test and fix updated as per review comments
Changes requested by aivanov (Reviewer).
src/java.desktop/share/classes/javax/swing/text/html/CSS.java line 2235:
> 2233: return value == size.value;
> 2234: }
> 2235: return false;
Is it not enough to compare `value`, `index` and `lu` fields of `FontSize` object?
Parsing the value string does not look good.
-------------
PR Review: https://git.openjdk.org/jdk/pull/13405#pullrequestreview-1436370423
PR Review Comment: https://git.openjdk.org/jdk/pull/13405#discussion_r1200351364
More information about the client-libs-dev
mailing list