From cccff37c0c679515491a2cdd4244dbcd7e038629 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 31 May 2013 13:46:27 +0300 Subject: [PATCH] Do not log legacy warnings in JUnit tests (#11963) Change-Id: I5549a524d7fae32b1ef201073ab48cadcc4e8212 --- .../src/com/vaadin/data/util/LegacyPropertyHelper.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; -- 2.39.5