commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Herbert <>
Subject [Text, Lang] Matching two CharSequence instances
Date Sat, 02 Mar 2019 16:47:24 GMT
I am helping with the PR for TEXT-126 to add to the similarity package.

Part of the new algorithm requires identifying if two CharSequences are identical. Is there
a utility in Text to do something like this:

public static boolean CharSequenceUtils.equals(CharSequence, CharSequence);

I cannot find one with a quick regex search of the library. I am not familiar with Lang either
but this is a dependency so a method from there could be used.

The current PR is using left.equals(right) on the input CharSequence to compare to one to
another which is wrong if the two input CharSequences do not support matching, e.g. if the
input was a String and StringBuilder then String.equals(StringBuilder) would not match, even
if the characters were the same.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message