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
@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;