commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex D Herbert (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (TEXT-151) JaroWinklerSimilarity uses Object.equals to test for equality
Date Fri, 08 Mar 2019 16:30:00 GMT

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

Alex D Herbert closed TEXT-151.
-------------------------------

> JaroWinklerSimilarity uses Object.equals to test for equality
> -------------------------------------------------------------
>
>                 Key: TEXT-151
>                 URL: https://issues.apache.org/jira/browse/TEXT-151
>             Project: Commons Text
>          Issue Type: Bug
>    Affects Versions: 1.7
>            Reporter: Alex D Herbert
>            Assignee: Alex D Herbert
>            Priority: Trivial
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Using Object.equals to test for equality of a {{CharSequence}} is wrong:
> {code:java}
> CharSequence cs1, cs2;
> cs1.equals(cs2);
> {code}
> The Unit test passes because the test uses the same String on both sides. When I changed
the unit test to wrap the string with a {{CharSequence}} interface it fails.
> It should be replaced with:
> {code:java}
> CharSequence cs1, cs2;
> StringUtils.equals(cs1, cs2);
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message