From: Artur Date: Mon, 28 Aug 2017 13:13:46 +0000 (+0300) Subject: Fix capitalization of single character strings (#9880) X-Git-Tag: 8.2.0.alpha1~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8109314f6ab0d86120b443251c9abbb335058269;p=vaadin-framework.git Fix capitalization of single character strings (#9880) --- diff --git a/shared/src/main/java/com/vaadin/shared/util/SharedUtil.java b/shared/src/main/java/com/vaadin/shared/util/SharedUtil.java index eaf8729a5e..974c45ae02 100644 --- a/shared/src/main/java/com/vaadin/shared/util/SharedUtil.java +++ b/shared/src/main/java/com/vaadin/shared/util/SharedUtil.java @@ -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) diff --git a/shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java b/shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java index 791637e1b1..b468093da1 100644 --- a/shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java +++ b/shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java @@ -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); }