aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-10-20 10:10:02 +0200
committerPéter Török <31210544+torok-peter@users.noreply.github.com>2017-10-20 11:10:02 +0300
commita9c83ba07e4dec90eb7d6e332b91adde9613ebb4 (patch)
tree7907a6c389ae740572197d949e27c6fd3c25491c /server/src
parent0a26d0e44169f9643e7d30ba370b8ecbbe128a56 (diff)
downloadvaadin-framework-a9c83ba07e4dec90eb7d6e332b91adde9613ebb4.tar.gz
vaadin-framework-a9c83ba07e4dec90eb7d6e332b91adde9613ebb4.zip
Use .toLowerCase and .toUpperCase(Locale.ROOT) (#10182)
* Use .toLowerCase and .toUpperCase(Locale.ROOT) * Spaces * add spaces after if(
Diffstat (limited to 'server/src')
-rw-r--r--server/src/main/java/com/vaadin/data/Binder.java2
-rw-r--r--server/src/main/java/com/vaadin/server/BootstrapHandler.java2
-rw-r--r--server/src/main/java/com/vaadin/server/DefaultDeploymentConfiguration.java10
-rw-r--r--server/src/main/java/com/vaadin/server/JsonCodec.java3
-rw-r--r--server/src/main/java/com/vaadin/server/JsonPaintTarget.java3
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinPortlet.java4
-rw-r--r--server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java9
-rw-r--r--server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java3
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractColorPicker.java5
-rw-r--r--server/src/main/java/com/vaadin/ui/components/grid/GridDropTarget.java3
-rw-r--r--server/src/main/java/com/vaadin/ui/components/grid/TreeGridDropTarget.java19
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/Design.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java7
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/dnd/DropTargetExtension.java3
-rw-r--r--server/src/main/java/com/vaadin/util/FileTypeResolver.java6
-rw-r--r--server/src/test/java/com/vaadin/data/BinderCustomPropertySetTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/components/grid/GridValueProvider.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java5
-rw-r--r--server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java3
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateFieldDeclarativeTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateTimeFieldDeclarativeTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java4
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/reachtextarea/RichTextAreaDeclarativeTest.java2
29 files changed, 69 insertions, 50 deletions
diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java
index 828130bd81..d417944f80 100644
--- a/server/src/main/java/com/vaadin/data/Binder.java
+++ b/server/src/main/java/com/vaadin/data/Binder.java
@@ -2585,7 +2585,7 @@ public class Binder<BEAN> implements Serializable {
}
private String minifyFieldName(String fieldName) {
- return fieldName.toLowerCase(Locale.ENGLISH).replace("_", "");
+ return fieldName.toLowerCase(Locale.ROOT).replace("_", "");
}
private <V> void fireValueChangeEvent(ValueChangeEvent<V> event) {
diff --git a/server/src/main/java/com/vaadin/server/BootstrapHandler.java b/server/src/main/java/com/vaadin/server/BootstrapHandler.java
index ff9e816013..bd87f78d67 100644
--- a/server/src/main/java/com/vaadin/server/BootstrapHandler.java
+++ b/server/src/main/java/com/vaadin/server/BootstrapHandler.java
@@ -662,7 +662,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler {
mainDiv.addClass("v-app");
mainDiv.addClass(context.getThemeName());
mainDiv.addClass(context.getUIClass().getSimpleName()
- .toLowerCase(Locale.ENGLISH));
+ .toLowerCase(Locale.ROOT));
if (style != null && !style.isEmpty()) {
mainDiv.attr("style", style);
}
diff --git a/server/src/main/java/com/vaadin/server/DefaultDeploymentConfiguration.java b/server/src/main/java/com/vaadin/server/DefaultDeploymentConfiguration.java
index 80db458c42..33f80015fb 100644
--- a/server/src/main/java/com/vaadin/server/DefaultDeploymentConfiguration.java
+++ b/server/src/main/java/com/vaadin/server/DefaultDeploymentConfiguration.java
@@ -16,6 +16,7 @@
package com.vaadin.server;
+import java.util.Locale;
import java.util.Properties;
import java.util.logging.Logger;
@@ -144,7 +145,8 @@ public class DefaultDeploymentConfiguration
}
// Try lowercased system properties
- val = System.getProperty(pkgName + parameterName.toLowerCase());
+ val = System
+ .getProperty(pkgName + parameterName.toLowerCase(Locale.ROOT));
if (val != null) {
return val;
}
@@ -170,7 +172,8 @@ public class DefaultDeploymentConfiguration
// Try lower case application properties for backward compatibility with
// 3.0.2 and earlier
- val = initParameters.getProperty(parameterName.toLowerCase());
+ val = initParameters
+ .getProperty(parameterName.toLowerCase(Locale.ROOT));
return val;
}
@@ -322,7 +325,8 @@ public class DefaultDeploymentConfiguration
Constants.SERVLET_PARAMETER_PUSH_MODE,
PushMode.DISABLED.toString());
try {
- pushMode = Enum.valueOf(PushMode.class, mode.toUpperCase());
+ pushMode = Enum.valueOf(PushMode.class,
+ mode.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException e) {
getLogger().warning(Constants.WARNING_PUSH_MODE_NOT_RECOGNIZED);
pushMode = PushMode.DISABLED;
diff --git a/server/src/main/java/com/vaadin/server/JsonCodec.java b/server/src/main/java/com/vaadin/server/JsonCodec.java
index a7f94de468..fc8e858b3b 100644
--- a/server/src/main/java/com/vaadin/server/JsonCodec.java
+++ b/server/src/main/java/com/vaadin/server/JsonCodec.java
@@ -33,6 +33,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -729,7 +730,7 @@ public class JsonCodec implements Serializable {
throw new RuntimeException("Can't encode "
+ valueType.getName()
+ " as it has multiple properties with the name "
- + fieldName.toLowerCase()
+ + fieldName.toLowerCase(Locale.ROOT)
+ ". This can happen if there are getters and setters for a public field (the framework can't know which to ignore) or if there are properties with only casing distinguishing between the names (e.g. getFoo() and getFOO())");
}
diff --git a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java
index b643fbb7a9..4cfb389851 100644
--- a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java
+++ b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java
@@ -26,6 +26,7 @@ import java.util.Deque;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
@@ -289,7 +290,7 @@ public class JsonPaintTarget implements PaintTarget {
for (int k = 0; k < 4 - ss.length(); k++) {
sb.append('0');
}
- sb.append(ss.toUpperCase());
+ sb.append(ss.toUpperCase(Locale.ROOT));
} else {
sb.append(ch);
}
diff --git a/server/src/main/java/com/vaadin/server/VaadinPortlet.java b/server/src/main/java/com/vaadin/server/VaadinPortlet.java
index d4a7d0e62d..c00b6461d9 100644
--- a/server/src/main/java/com/vaadin/server/VaadinPortlet.java
+++ b/server/src/main/java/com/vaadin/server/VaadinPortlet.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Enumeration;
+import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Level;
@@ -561,7 +562,8 @@ public class VaadinPortlet extends GenericPortlet
*/
protected VaadinPortletRequest createVaadinRequest(PortletRequest request) {
PortalContext portalContext = request.getPortalContext();
- String portalInfo = portalContext.getPortalInfo().toLowerCase().trim();
+ String portalInfo = portalContext.getPortalInfo()
+ .toLowerCase(Locale.ROOT).trim();
VaadinPortletService service = getService();
if (portalInfo.contains("gatein")) {
diff --git a/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java b/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java
index a313e8c0fe..d1cdf0dd63 100644
--- a/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java
+++ b/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java
@@ -24,6 +24,7 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -101,12 +102,12 @@ public class SASSAddonImportFileCreator {
// last
List<String> paths = new ArrayList<>(addonThemes.keySet());
Collections.sort(paths, (String path1, String path2) -> {
- if (path1.toLowerCase().endsWith(".css")
- && path2.toLowerCase().endsWith(".scss")) {
+ if (path1.toLowerCase(Locale.ROOT).endsWith(".css")
+ && path2.toLowerCase(Locale.ROOT).endsWith(".scss")) {
return -1;
}
- if (path1.toLowerCase().endsWith(".scss")
- && path2.toLowerCase().endsWith(".css")) {
+ if (path1.toLowerCase(Locale.ROOT).endsWith(".scss")
+ && path2.toLowerCase(Locale.ROOT).endsWith(".css")) {
return 1;
}
return 0;
diff --git a/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java b/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java
index 608f84782c..80c8fc7874 100644
--- a/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java
+++ b/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java
@@ -29,6 +29,7 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collection;
import java.util.HashSet;
+import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -180,7 +181,7 @@ public class WidgetSetBuilder {
}
static boolean isWidgetset(String gwtModuleName) {
- return gwtModuleName.toLowerCase().contains("widgetset");
+ return gwtModuleName.toLowerCase(Locale.ROOT).contains("widgetset");
}
private static String readFile(File widgetsetFile) throws IOException {
diff --git a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
index 608cdd9cfa..74b7e1f2b1 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
@@ -17,6 +17,7 @@ package com.vaadin.ui;
import java.io.Serializable;
import java.util.Collection;
+import java.util.Locale;
import java.util.Objects;
import org.jsoup.nodes.Attributes;
@@ -492,8 +493,8 @@ public abstract class AbstractColorPicker extends AbstractField<Color> {
doSetValue(new Color(Integer.parseInt(hexColor, 16)));
}
if (design.hasAttr("popup-style")) {
- setPopupStyle(PopupStyle.valueOf(
- "POPUP_" + attributes.get("popup-style").toUpperCase()));
+ setPopupStyle(PopupStyle.valueOf("POPUP_"
+ + attributes.get("popup-style").toUpperCase(Locale.ROOT)));
}
if (design.hasAttr("position")) {
String[] position = attributes.get("position").split(",");
diff --git a/server/src/main/java/com/vaadin/ui/components/grid/GridDropTarget.java b/server/src/main/java/com/vaadin/ui/components/grid/GridDropTarget.java
index 342946d5c9..edb1534a05 100644
--- a/server/src/main/java/com/vaadin/ui/components/grid/GridDropTarget.java
+++ b/server/src/main/java/com/vaadin/ui/components/grid/GridDropTarget.java
@@ -16,6 +16,7 @@
package com.vaadin.ui.components.grid;
import java.util.LinkedHashMap;
+import java.util.Locale;
import java.util.Map;
import com.vaadin.shared.Registration;
@@ -156,7 +157,7 @@ public class GridDropTarget<T> extends DropTargetExtension<Grid<T>> {
GridDropEvent<T> event = new GridDropEvent<>(getParent(),
dataPreserveOrder,
- DropEffect.valueOf(dropEffect.toUpperCase()),
+ DropEffect.valueOf(dropEffect.toUpperCase(Locale.ROOT)),
getUI().getActiveDragSource(), dropTargetRow, dropLocation,
mouseEventDetails);
diff --git a/server/src/main/java/com/vaadin/ui/components/grid/TreeGridDropTarget.java b/server/src/main/java/com/vaadin/ui/components/grid/TreeGridDropTarget.java
index 1d440b5fec..e471f350bc 100644
--- a/server/src/main/java/com/vaadin/ui/components/grid/TreeGridDropTarget.java
+++ b/server/src/main/java/com/vaadin/ui/components/grid/TreeGridDropTarget.java
@@ -16,6 +16,7 @@
package com.vaadin.ui.components.grid;
import java.util.LinkedHashMap;
+import java.util.Locale;
import java.util.Map;
import com.vaadin.shared.Registration;
@@ -30,7 +31,7 @@ import com.vaadin.ui.TreeGrid;
* counterpart of GridDropTargetExtensionConnector.
*
* @param <T>
- * Type of the TreeGrid bean.
+ * Type of the TreeGrid bean.
* @author Vaadin Ltd
* @since 8.1
*/
@@ -41,22 +42,22 @@ public class TreeGridDropTarget<T> extends GridDropTarget<T> {
* drop.
*
* @param target
- * TreeGrid to be extended.
+ * TreeGrid to be extended.
* @param dropMode
- * Drop mode that describes the allowed drop locations within the
- * TreeGrid's row.
+ * Drop mode that describes the allowed drop locations within the
+ * TreeGrid's row.
*/
public TreeGridDropTarget(TreeGrid<T> target, DropMode dropMode) {
super(target, dropMode);
}
/**
- * Attaches drop listener for the current drop target. {@link
- * TreeGridDropListener#drop(TreeGridDropEvent)} is called when drop event
- * happens on the client side.
+ * Attaches drop listener for the current drop target.
+ * {@link TreeGridDropListener#drop(TreeGridDropEvent)} is called when drop
+ * event happens on the client side.
*
* @param listener
- * Listener to handle drop event.
+ * Listener to handle drop event.
* @return Handle to be used to remove this listener.
*/
public Registration addTreeGridDropListener(
@@ -79,7 +80,7 @@ public class TreeGridDropTarget<T> extends GridDropTarget<T> {
TreeGridDropEvent<T> event = new TreeGridDropEvent<>(getParent(),
dataPreserveOrder,
- DropEffect.valueOf(dropEffect.toUpperCase()),
+ DropEffect.valueOf(dropEffect.toUpperCase(Locale.ROOT)),
getUI().getActiveDragSource(), dropTargetRow, dropLocation,
mouseEventDetails, depth, collapsed);
diff --git a/server/src/main/java/com/vaadin/ui/declarative/Design.java b/server/src/main/java/com/vaadin/ui/declarative/Design.java
index 61d35297d0..7c65992967 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/Design.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/Design.java
@@ -265,7 +265,7 @@ public class Design implements Serializable {
String prefix = context.getPackagePrefix(packageName);
if (prefix == null) {
prefix = packageName.replace('.', '_')
- .toLowerCase(Locale.ENGLISH);
+ .toLowerCase(Locale.ROOT);
context.addPackagePrefix(prefix, packageName);
}
prefix += "-";
diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java
index e8fa278aba..c508b693f8 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java
@@ -25,6 +25,7 @@ import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
@@ -330,7 +331,7 @@ public class DesignAttributeHandler implements Serializable {
if (builder.length() != 0) {
builder.append('-');
}
- builder.append(word.toLowerCase());
+ builder.append(word.toLowerCase(Locale.ROOT));
}
return builder.toString();
}
@@ -356,13 +357,13 @@ public class DesignAttributeHandler implements Serializable {
// written in lower case
if (matcher.group(1).isEmpty()) {
matcher.appendReplacement(result,
- matched.toLowerCase() + matcher.group(3));
+ matched.toLowerCase(Locale.ROOT) + matcher.group(3));
// otherwise the first character of the group stays uppercase,
// while the others are lower case
} else {
matcher.appendReplacement(result,
matcher.group(1) + matched.substring(0, 1)
- + matched.substring(1).toLowerCase()
+ + matched.substring(1).toLowerCase(Locale.ROOT)
+ matcher.group(3));
}
// in both cases the uppercase letter of the next word (or string's
diff --git a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java
index 2caecda8f4..f1e7e25329 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java
@@ -104,7 +104,7 @@ public class FieldBinder implements Serializable {
private void resolveFields(Class<?> classWithFields) {
for (Field memberField : getFields(classWithFields)) {
if (Component.class.isAssignableFrom(memberField.getType())) {
- fieldMap.put(memberField.getName().toLowerCase(Locale.ENGLISH),
+ fieldMap.put(memberField.getName().toLowerCase(Locale.ROOT),
memberField);
}
}
@@ -180,7 +180,7 @@ public class FieldBinder implements Serializable {
return false;
}
// validate that the field can be found
- Field field = fieldMap.get(fieldName.toLowerCase(Locale.ENGLISH));
+ Field field = fieldMap.get(fieldName.toLowerCase(Locale.ROOT));
if (field == null) {
getLogger()
.fine("No field was found by identifier " + identifier);
diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java
index de7f5ad5b7..1360671d00 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java
@@ -53,7 +53,7 @@ public class DesignEnumConverter<T extends Enum>
}
try {
T result = (T) Enum.valueOf(type,
- value.toUpperCase(Locale.ENGLISH));
+ value.toUpperCase(Locale.ROOT));
return Result.ok(result);
} catch (Exception e) {
return Result.error(e.getMessage());
@@ -66,7 +66,7 @@ public class DesignEnumConverter<T extends Enum>
return null;
}
- return value.name().toLowerCase(Locale.ENGLISH);
+ return value.name().toLowerCase(Locale.ROOT);
}
}
diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
index d3d2b13170..c0fa46469c 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
@@ -63,7 +63,7 @@ public class DesignResourceConverter implements Converter<String, Resource> {
String protocol = value.split("://")[0];
try {
ResourceConverterByProtocol converter = ResourceConverterByProtocol
- .valueOf(protocol.toUpperCase(Locale.ENGLISH));
+ .valueOf(protocol.toUpperCase(Locale.ROOT));
return Result.ok(converter.parse(value));
} catch (IllegalArgumentException iae) {
return Result.error("Unrecognized protocol: " + protocol);
diff --git a/server/src/main/java/com/vaadin/ui/dnd/DropTargetExtension.java b/server/src/main/java/com/vaadin/ui/dnd/DropTargetExtension.java
index 76c7195f60..5ee7b0e861 100644
--- a/server/src/main/java/com/vaadin/ui/dnd/DropTargetExtension.java
+++ b/server/src/main/java/com/vaadin/ui/dnd/DropTargetExtension.java
@@ -18,6 +18,7 @@ package com.vaadin.ui.dnd;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Objects;
@@ -75,7 +76,7 @@ public class DropTargetExtension<T extends AbstractComponent>
registerRpc(
(DropTargetRpc) (types, data, dropEffect, mouseEventDetails) ->
onDrop(types, data,
- DropEffect.valueOf(dropEffect.toUpperCase()),
+ DropEffect.valueOf(dropEffect.toUpperCase(Locale.ROOT)),
mouseEventDetails));
}
diff --git a/server/src/main/java/com/vaadin/util/FileTypeResolver.java b/server/src/main/java/com/vaadin/util/FileTypeResolver.java
index 500e8736e7..48d7916967 100644
--- a/server/src/main/java/com/vaadin/util/FileTypeResolver.java
+++ b/server/src/main/java/com/vaadin/util/FileTypeResolver.java
@@ -19,6 +19,7 @@ package com.vaadin.util;
import java.io.File;
import java.io.Serializable;
import java.util.Collections;
+import java.util.Locale;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.concurrent.ConcurrentHashMap;
@@ -270,7 +271,8 @@ public class FileTypeResolver implements Serializable {
}
// Return type from extension map, if found
- final String type = EXT_TO_MIME_MAP.get(ext.toLowerCase());
+ final String type = EXT_TO_MIME_MAP
+ .get(ext.toLowerCase(Locale.ROOT));
if (type != null) {
return type;
}
@@ -358,7 +360,7 @@ public class FileTypeResolver implements Serializable {
* the new mime-type for <code>extension</code>.
*/
public static void addExtension(String extension, String MIMEType) {
- EXT_TO_MIME_MAP.put(extension.toLowerCase(), MIMEType);
+ EXT_TO_MIME_MAP.put(extension.toLowerCase(Locale.ROOT), MIMEType);
}
/**
diff --git a/server/src/test/java/com/vaadin/data/BinderCustomPropertySetTest.java b/server/src/test/java/com/vaadin/data/BinderCustomPropertySetTest.java
index 31c48447a6..cde97441aa 100644
--- a/server/src/test/java/com/vaadin/data/BinderCustomPropertySetTest.java
+++ b/server/src/test/java/com/vaadin/data/BinderCustomPropertySetTest.java
@@ -79,7 +79,7 @@ public class BinderCustomPropertySetTest {
@Override
public String getCaption() {
- return name.toUpperCase(Locale.ENGLISH);
+ return name.toUpperCase(Locale.ROOT);
}
}
diff --git a/server/src/test/java/com/vaadin/tests/components/grid/GridValueProvider.java b/server/src/test/java/com/vaadin/tests/components/grid/GridValueProvider.java
index 6b3d85900d..00961487d3 100644
--- a/server/src/test/java/com/vaadin/tests/components/grid/GridValueProvider.java
+++ b/server/src/test/java/com/vaadin/tests/components/grid/GridValueProvider.java
@@ -69,7 +69,7 @@ public class GridValueProvider {
upperCasePerson);
persons.addFilter(col.getValueProvider(),
- value -> value.toUpperCase(Locale.ENGLISH).equals(value));
+ value -> value.toUpperCase(Locale.ROOT).equals(value));
List<Person> queryPersons = persons.fetch(new Query<>())
.collect(Collectors.toList());
diff --git a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java
index 9f6253067a..de346dd0aa 100644
--- a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java
+++ b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java
@@ -25,6 +25,7 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
+import java.util.Locale;
import java.util.TimeZone;
import org.junit.Before;
@@ -290,9 +291,9 @@ public class DesignFormatterTest {
formatter.format(new ThemeResource(themePath)));
assertEquals(fontAwesomeUrl, formatter.format(FontAwesome.AMBULANCE));
- assertEquals(someOtherFontUrl.toLowerCase(),
+ assertEquals(someOtherFontUrl.toLowerCase(Locale.ROOT),
formatter.format(new GenericFontIcon("SomeOther", 0xf0f9))
- .toLowerCase());
+ .toLowerCase(Locale.ROOT));
assertEquals(fileSystemPath,
formatter.format(new FileResource(new File(fileSystemPath))));
diff --git a/server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java b/server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java
index 738f0be806..bd0dbbc6e0 100644
--- a/server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java
+++ b/server/src/test/java/com/vaadin/tests/server/ClasspathHelper.java
@@ -69,7 +69,7 @@ public class ClasspathHelper {
.map(path -> getClassFromFile(path,
classesRoot.toPath()))
.filter(Objects::nonNull).collect(Collectors.toList());
- } else if (classesRoot.getName().toLowerCase(Locale.ENGLISH)
+ } else if (classesRoot.getName().toLowerCase(Locale.ROOT)
.endsWith(".jar")) {
URI uri = URI.create("jar:" + classesRoot.toURI());
FileSystem fileSystem;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java b/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java
index 8a31b8cf98..ba2c424a09 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java
@@ -7,6 +7,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.HashSet;
+import java.util.Locale;
import java.util.Set;
import org.easymock.EasyMock;
@@ -43,7 +44,7 @@ public abstract class AbstractListenerMethodsTestBase {
String packageName = "com.vaadin.tests.server";
if (Component.class.isAssignableFrom(c)) {
packageName += ".component."
- + c.getSimpleName().toLowerCase();
+ + c.getSimpleName().toLowerCase(Locale.ROOT);
continue;
}
diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateFieldDeclarativeTest.java
index 80040804cd..6f18a424b8 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateFieldDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateFieldDeclarativeTest.java
@@ -69,7 +69,7 @@ public abstract class AbstractLocalDateFieldDeclarativeTest<T extends AbstractLo
+ "date-out-of-range-message='%s' resolution='%s' "
+ "date-format='%s' lenient parse-error-message='%s'/>",
getComponentTag(), end, start, dateOutOfRange,
- resolution.name().toLowerCase(Locale.ENGLISH), dateFormat,
+ resolution.name().toLowerCase(Locale.ROOT), dateFormat,
parseErrorMsg);
T component = getComponentClass().newInstance();
diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateTimeFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateTimeFieldDeclarativeTest.java
index a4768c6f24..61fff27072 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateTimeFieldDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractLocalDateTimeFieldDeclarativeTest.java
@@ -74,7 +74,7 @@ public abstract class AbstractLocalDateTimeFieldDeclarativeTest<T extends Abstra
+ "date-format='%s' lenient parse-error-message='%s'/>",
getComponentTag(), DATE_FORMATTER.format(end),
DATE_FORMATTER.format(start), dateOutOfRange,
- resolution.name().toLowerCase(Locale.ENGLISH), dateFormat,
+ resolution.name().toLowerCase(Locale.ROOT), dateFormat,
parseErrorMsg);
T component = getComponentClass().newInstance();
diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java
index 7ba3e6aaca..2416620afe 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/abstracttextfield/AbstractTextFieldDeclarativeTest.java
@@ -43,7 +43,7 @@ public abstract class AbstractTextFieldDeclarativeTest<T extends AbstractTextFie
"<%s maxlength='%d' placeholder='%s' "
+ "value-change-mode='%s' value-change-timeout='%d'/>",
getComponentTag(), maxLength, placeholder,
- mode.name().toLowerCase(Locale.ENGLISH), timeout);
+ mode.name().toLowerCase(Locale.ROOT), timeout);
T component = getComponentClass().newInstance();
diff --git a/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java b/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java
index 8ebc620328..a9b23d7af0 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java
@@ -74,7 +74,7 @@ public class CustomLayoutTest {
field = list.get(0);
} else {
for (Field fld : list) {
- if (fld.getName().toLowerCase(Locale.ENGLISH)
+ if (fld.getName().toLowerCase(Locale.ROOT)
.startsWith("buffer")) {
field = fld;
break;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java
index 8d1d6c6955..a4f824d6fa 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java
@@ -82,9 +82,9 @@ public class GridDeclarativeTest extends AbstractListingDeclarativeTest<Grid> {
+ "<th plain-text column-ids='id'>Id</th></tr>"
+ "</thead></table></%s>",
getComponentTag(),
- heightMode.toString().toLowerCase(Locale.ENGLISH),
+ heightMode.toString().toLowerCase(Locale.ROOT),
frozenColumns, heightByRows,
- SelectionMode.MULTI.toString().toLowerCase(Locale.ENGLISH),
+ SelectionMode.MULTI.toString().toLowerCase(Locale.ROOT),
getComponentTag());
testRead(design, grid);
diff --git a/server/src/test/java/com/vaadin/tests/server/component/reachtextarea/RichTextAreaDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/reachtextarea/RichTextAreaDeclarativeTest.java
index e7cab55f94..6cac635c6a 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/reachtextarea/RichTextAreaDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/reachtextarea/RichTextAreaDeclarativeTest.java
@@ -61,7 +61,7 @@ public class RichTextAreaDeclarativeTest
int timeout = 67;
String design = String.format(
"<%s value-change-mode='%s' value-change-timeout='%d'/>",
- getComponentTag(), mode.name().toLowerCase(Locale.ENGLISH),
+ getComponentTag(), mode.name().toLowerCase(Locale.ROOT),
timeout);
RichTextArea component = new RichTextArea();