mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-152295 StringUtil.pluralize() is incorrect
This commit is contained in:
@@ -852,7 +852,8 @@ public class StringUtil extends StringUtilRt {
|
||||
return suggestion.substring(0, len - 2) + "en";
|
||||
}
|
||||
|
||||
if (endsWithIgnoreCase(suggestion, "s") || endsWithIgnoreCase(suggestion, "x") || endsWithIgnoreCase(suggestion, "ch")) {
|
||||
if (endsWithIgnoreCase(suggestion, "s") || endsWithIgnoreCase(suggestion, "x") ||
|
||||
endsWithIgnoreCase(suggestion, "ch") || endsWithIgnoreCase(suggestion, "sh")) {
|
||||
return suggestion + "es";
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ public class StringUtilTest {
|
||||
assertEquals("fixes", StringUtil.pluralize("fix"));
|
||||
assertEquals("men", StringUtil.pluralize("man"));
|
||||
assertEquals("media", StringUtil.pluralize("medium"));
|
||||
assertEquals("stashes", StringUtil.pluralize("stash"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user