]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix capitalization of single character strings (#9880)
authorArtur <artur@vaadin.com>
Mon, 28 Aug 2017 13:13:46 +0000 (16:13 +0300)
committerHenri Sara <henri.sara@gmail.com>
Mon, 28 Aug 2017 13:13:46 +0000 (16:13 +0300)
shared/src/main/java/com/vaadin/shared/util/SharedUtil.java
shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java

index eaf8729a5e7fd23542a0a5825eea151eb8d03d92..974c45ae023c9e815aa8942c0ae9943559b3ff95 100644 (file)
@@ -199,7 +199,7 @@ public class SharedUtil implements Serializable {
         }
 
         if (string.length() <= 1) {
-            return string.toUpperCase();
+            return string.toUpperCase(Locale.ENGLISH);
         }
 
         return string.substring(0, 1).toUpperCase(Locale.ENGLISH)
index 791637e1b1128013b158945dd8889db4fb69d45e..b468093da18a78ed94fbc6945277d6fdb6fd5f3d 100644 (file)
@@ -113,6 +113,7 @@ public class SharedUtilTest {
         try {
             Locale.setDefault(new Locale("tr", "TR"));
             Assert.assertEquals("Integer", SharedUtil.capitalize("integer"));
+            Assert.assertEquals("I", SharedUtil.capitalize("i"));
         } finally {
             Locale.setDefault(defaultLocale);
         }