Ben-Waters commented on code in PR #189:
URL: https://github.com/apache/commons-codec/pull/189#discussion_r3952646810
##########
src/main/java/org/apache/commons/codec/language/Nysiis.java:
##########
@@ -314,6 +315,12 @@ public String nysiis(String str) {
if (lastChar == 'A') {
key.deleteCharAt(key.length() - 1);
}
+
+ if (key.length() == 0) {
+ // We've removed the first character of the string. Likely
because it was an S or A
+ // We should return at least the first character
+ key.append(firstChar);
+ }
Review Comment:
Copilot is wrong on this. The check to remove a solitary 's' is already
happening before this final length check, at lines 300-303
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]