[ 
https://issues.apache.org/jira/browse/CODEC-347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18128428#comment-18128428
 ] 

Gary D. Gregory edited comment on CODEC-347 at 10/18/26 1:39 PM:
-----------------------------------------------------------------

[~aryanrg] 

Fixed in git master and snapshot builds.

Note the additional commit f13dd50f566c318283c4138820b15d75c26a0217

commit f13dd50f566c318283c4138820b15d75c26a0217:
{quote}Clarify Match Rating Approach comparison contract and tests.

PR #448 correctly fixed CODEC-347, but left the existing Javadoc
claiming
that matching requires identical encodings. The method uses an MRA
similarity threshold and also accepts inputs equal ignoring case after
its initial input checks.

Document these rules, including false results for cleaned-empty names
and the existing shortcut for identical punctuation or whitespace
inputs.
Add tests preserving that shortcut and parameterize the six regression
cases so each failure is reported independently.
{quote}

PR merged. Please verify and close.


was (Author: garydgregory):
[~aryanrg] 

Fixed in git master and snapshot builds.

Note the additional commit f13dd50f566c318283c4138820b15d75c26a0217

commit f13dd50f566c318283c4138820b15d75c26a0217:
{quote}Clarify Match Rating Approach comparison contract and tests.

PR #448 correctly fixed CODEC-347, but left the existing Javadoc
claiming
that matching requires identical encodings. The method uses an MRA
similarity threshold and also accepts inputs equal ignoring case after
its initial input checks.

Document these rules, including false results for cleaned-empty names
and the existing shortcut for identical punctuation or whitespace
inputs.
Add tests preserving that shortcut and parameterize the six regression
cases so each failure is reported independently.
{quote}

> MatchRatingApproachEncoder.isEncodeEquals throws when cleaning removes all 
> characters
> -------------------------------------------------------------------------------------
>
>                 Key: CODEC-347
>                 URL: https://issues.apache.org/jira/browse/CODEC-347
>             Project: Commons Codec
>          Issue Type: Bug
>            Reporter: Aryan Ganjoo
>            Priority: Minor
>             Fix For: 1.23.1
>
>
> MatchRatingApproachEncoder.isEncodeEquals(String, String) accepts nonempty 
> input such as "--" but cleanName() removes every character. The subsequent 
> removeVowels() calls substring(0, 1) on the empty string and throws 
> StringIndexOutOfBoundsException. This is through the public comparison API, 
> rather than a package-private helper.
> Reproduction (current master):
> {code:java}
> new MatchRatingApproachEncoder().isEncodeEquals("--", "Smith");
> {code}
> Expected: false, as there is no usable name to compare (consistent with 
> encode(String) returning an empty string after cleaning). Actual: 
> StringIndexOutOfBoundsException. The same occurs with punctuation-only and 
> multi-space input.
> A local regression covering both argument positions and several cleaned-empty 
> inputs fails on the original source and passes with an early false return 
> immediately after cleanName(). Focused MatchRatingApproachEncoder tests: 99 
> passed; full local mvn test: 19,921 tests, 21 skipped. No public patch has 
> been submitted yet.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to