Uploaded image for project: 'Commons Text'
  1. Commons Text
  2. TEXT-151

JaroWinklerSimilarity uses Object.equals to test for equality

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.7
    • None
    • None

    Description

      Using Object.equals to test for equality of a CharSequence is wrong:

      CharSequence cs1, cs2;
      cs1.equals(cs2);
      

      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:

      CharSequence cs1, cs2;
      StringUtils.equals(cs1, cs2);
      

      Attachments

        Issue Links

          Activity

            People

              aherbert Alex Herbert
              aherbert Alex Herbert
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m