aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/main/java/com/vaadin')
-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
18 files changed, 54 insertions, 37 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);
}
/**