pluralize in upper case (IDEA-78999)
authoranna <Anna.Kozlova@jetbrains.com>
Tue, 20 Dec 2011 14:38:32 +0000 (15:38 +0100)
committeranna <Anna.Kozlova@jetbrains.com>
Tue, 20 Dec 2011 14:41:34 +0000 (15:41 +0100)
platform/util/src/com/intellij/openapi/util/text/StringUtil.java

index 24a42c481a60fb84c34526ba22a64107fa6c9c9c..c71ed0094d4a46bbc46f3036fdd0ff37a010bf56 100644 (file)
@@ -756,12 +756,12 @@ public class StringUtil {
       return suggestion + "ren";
     }
 
-    if (endsWithChar(suggestion, 's') || endsWithChar(suggestion, 'x') || suggestion.endsWith("ch")) {
+    if (endsWithIgnoreCase(suggestion, "s") || endsWithIgnoreCase(suggestion, "x") || endsWithIgnoreCase(suggestion, "ch")) {
       return suggestion + "es";
     }
 
     int len = suggestion.length();
-    if (endsWithChar(suggestion, 'y') && len > 1 && !isVowel(suggestion.charAt(len - 2))) {
+    if (endsWithIgnoreCase(suggestion, "y") && len > 1 && !isVowel(toLowerCase(suggestion.charAt(len - 2)))) {
       return suggestion.substring(0, len - 1) + "ies";
     }