aboutsummaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-08-28 16:13:46 +0300
committerHenri Sara <henri.sara@gmail.com>2017-08-28 16:13:46 +0300
commit8109314f6ab0d86120b443251c9abbb335058269 (patch)
tree3702c4072201a24c8b972704d9a42e3c3ce9bf82 /shared
parente9d87f59dd9389f39d9a0a5a2f62e4095b12467d (diff)
downloadvaadin-framework-8109314f6ab0d86120b443251c9abbb335058269.tar.gz
vaadin-framework-8109314f6ab0d86120b443251c9abbb335058269.zip
Fix capitalization of single character strings (#9880)
Diffstat (limited to 'shared')
-rw-r--r--shared/src/main/java/com/vaadin/shared/util/SharedUtil.java2
-rw-r--r--shared/src/test/java/com/vaadin/shared/util/SharedUtilTest.java1
2 files changed, 2 insertions, 1 deletions
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);
}