diff options
author | Leif Åstrand <leif@vaadin.com> | 2015-07-08 09:23:18 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-07-11 06:33:23 +0000 |
commit | 3c811e29a79da46a8124239e69ec473ad3dafcde (patch) | |
tree | 112839f25036fbccd71460d5e563f54198bb67a6 | |
parent | 8f74bb0faadda823c0d2f6180e6e37ed4c61def9 (diff) | |
download | vaadin-framework-3c811e29a79da46a8124239e69ec473ad3dafcde.tar.gz vaadin-framework-3c811e29a79da46a8124239e69ec473ad3dafcde.zip |
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
-rw-r--r-- | client/src/com/vaadin/client/ui/AbstractComponentConnector.java | 12 |
1 files changed, 8 insertions, 4 deletions
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; |