commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "yathos UG (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LANG-1356) Add bypass for basic JRE classes to recursive and reflective EqualsBuilder
Date Sat, 07 Oct 2017 13:03:00 GMT

     [ https://issues.apache.org/jira/browse/LANG-1356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

yathos UG updated LANG-1356:
----------------------------
    Attachment: LANG-1356.patch

String compare with reflective EqualsBuilder will fail if hashCode() has been called on one
instance but not on the other yet. I assume it as
Bug in String class not to declare hash field with transient modifier, although it is used
as lazily set cache.

To overcome this issue I wrote patch [^LANG-1356.patch] which lets you define a list of classes
which should be excluded from reflectionAppend and compared by its equals() method even.
This matches the further improvement the author of LANG-1034 had already suggested.

> Add bypass for basic JRE classes to recursive and reflective EqualsBuilder
> --------------------------------------------------------------------------
>
>                 Key: LANG-1356
>                 URL: https://issues.apache.org/jira/browse/LANG-1356
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.reflect.*
>            Reporter: Pascal Schumacher
>         Attachments: LANG-1356.patch
>
>
> {quote}String are now compared with internal data (hash and char[]). But sometimes hash
value is not initialized, this is probably a cache for the hashcode. So the comparison fails
even if the char[] content is the same.
> You should add the bypass for basic JRE classes (String, Datetime types, etc.){quote}
> reported at https://github.com/apache/commons-lang/pull/202#issuecomment-333874925



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message