From 3c811e29a79da46a8124239e69ec473ad3dafcde Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Wed, 8 Jul 2015 09:23:18 +0300 Subject: Eliminate unguarded Profiler string concatenation Even though the call to Profiler.enter would be eliminated by the compiler, it would still include the string concatenation since it can't prove it wouldn't have any side effects. Change-Id: Iae3f6d18c409f019d2207d212d00ecb78078bc3e --- .../src/com/vaadin/client/ui/AbstractComponentConnector.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'client/src') diff --git a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java index 24a0438476..1f09c14fb0 100644 --- a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java @@ -103,11 +103,15 @@ public abstract class AbstractComponentConnector extends AbstractConnector @Override public Widget getWidget() { if (widget == null) { - Profiler.enter("AbstractComponentConnector.createWidget for " - + getClass().getSimpleName()); + if (Profiler.isEnabled()) { + Profiler.enter("AbstractComponentConnector.createWidget for " + + getClass().getSimpleName()); + } widget = createWidget(); - Profiler.leave("AbstractComponentConnector.createWidget for " - + getClass().getSimpleName()); + if (Profiler.isEnabled()) { + Profiler.leave("AbstractComponentConnector.createWidget for " + + getClass().getSimpleName()); + } } return widget; -- cgit v1.2.3