summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/com/vaadin/server/DefaultDeploymentConfiguration.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java b/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java
index a55c3231f3..0a8096e84c 100644
--- a/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java
+++ b/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java
@@ -86,17 +86,25 @@ public class DefaultDeploymentConfiguration implements DeploymentConfiguration {
}
private void checkLegacyPropertyToString() {
+ // Verify that the default value has not changed without also
+ // updating logic here
+ assert DEFAULT_LEGACY_PROPERTY_TO_STRING.toString().equals("warning");
+
String param = getApplicationOrSystemProperty(
- Constants.SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING,
- DEFAULT_LEGACY_PROPERTY_TO_STRING.name().toLowerCase());
+ Constants.SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING, "warning");
- try {
- legacyPropertyToStringMode = LegacyProperyToStringMode
- .valueOf(param.toUpperCase());
- } catch (IllegalArgumentException e) {
- getLogger().log(Level.WARNING,
- Constants.WARNING_UNKNOWN_LEGACY_PROPERTY_TOSTRING_VALUE,
- param);
+ if ("true".equals(param)) {
+ legacyPropertyToStringMode = LegacyProperyToStringMode.ENABLED;
+ } else if ("false".equals(param)) {
+ legacyPropertyToStringMode = LegacyProperyToStringMode.DISABLED;
+ } else {
+ if (!"warning".equals(param)) {
+ getLogger()
+ .log(Level.WARNING,
+ Constants.WARNING_UNKNOWN_LEGACY_PROPERTY_TOSTRING_VALUE,
+ param);
+
+ }
legacyPropertyToStringMode = DEFAULT_LEGACY_PROPERTY_TO_STRING;
}
}