From: Artur Signell Date: Fri, 31 May 2013 10:46:27 +0000 (+0300) Subject: Do not log legacy warnings in JUnit tests (#11963) X-Git-Tag: 7.1.0~90^2~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cccff37c0c679515491a2cdd4244dbcd7e038629;p=vaadin-framework.git Do not log legacy warnings in JUnit tests (#11963) Change-Id: I5549a524d7fae32b1ef201073ab48cadcc4e8212 --- diff --git a/server/src/com/vaadin/data/util/LegacyPropertyHelper.java b/server/src/com/vaadin/data/util/LegacyPropertyHelper.java index 3eb22524f8..551d7223d6 100644 --- a/server/src/com/vaadin/data/util/LegacyPropertyHelper.java +++ b/server/src/com/vaadin/data/util/LegacyPropertyHelper.java @@ -77,8 +77,8 @@ public class LegacyPropertyHelper implements Serializable { */ public static boolean isLegacyToStringEnabled() { if (VaadinService.getCurrent() == null) { - // This should really not happen but we need to handle it somehow. - // IF it happens it seems more safe to use the legacy mode and log. + // This will happen at least in JUnit tests. We do not what the real + // value should be but it seems more safe to use the legacy mode. return true; } return VaadinService.getCurrent().getDeploymentConfiguration() @@ -87,9 +87,9 @@ public class LegacyPropertyHelper implements Serializable { private static boolean logLegacyToStringWarning() { if (VaadinService.getCurrent() == null) { - // This should really not happen but we need to handle it somehow. - // IF it happens it seems more safe to use the legacy mode and log. - return true; + // This will happen at least in JUnit tests. We do not want to spam + // the log with these messages in this case. + return false; } return VaadinService.getCurrent().getDeploymentConfiguration() .getLegacyPropertyToStringMode() == LegacyProperyToStringMode.WARNING;