mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-136624 Bad pluralization in suggested names
This commit is contained in:
@@ -765,6 +765,10 @@ public class StringUtil extends StringUtilRt {
|
||||
return "These";
|
||||
}
|
||||
|
||||
if (endsWithIgnoreCase(suggestion, "es")) {
|
||||
return suggestion;
|
||||
}
|
||||
|
||||
if (endsWithIgnoreCase(suggestion, "s") || endsWithIgnoreCase(suggestion, "x") || endsWithIgnoreCase(suggestion, "ch")) {
|
||||
return suggestion + "es";
|
||||
}
|
||||
|
||||
@@ -76,6 +76,11 @@ public class StringUtilTest extends TestCase {
|
||||
assertEquals("z", StringUtil.unpluralize("zs"));
|
||||
}
|
||||
|
||||
public void testPluralize() {
|
||||
assertEquals("values", StringUtil.pluralize("value"));
|
||||
assertEquals("values", StringUtil.pluralize("values"));
|
||||
}
|
||||
|
||||
public void testStartsWithConcatenation() {
|
||||
assertTrue(StringUtil.startsWithConcatenation("something.with.dot", "something", "."));
|
||||
assertTrue(StringUtil.startsWithConcatenation("something.with.dot", "", "something."));
|
||||
|
||||
Reference in New Issue
Block a user