Source:
protected void receiveCommand(ItemCommandEvent commandEvent) { String itemName = commandEvent.getItemName(); final Command command = commandEvent.getItemCommand(); Set<ChannelUID> boundChannels = this.itemChannelLinkRegistry.getBoundChannels(itemName); for (final ChannelUID channelUID : boundChannels) { if (!channelUID.toString().equals(commandEvent.getSource())) { Thing thing = getThing(channelUID.getThingUID()); if (thing != null) { final ThingHandler handler = thing.getHandler(); if (handler != null) { if (isInitialized(thing)) { logger.debug("Delegating command '{}' for item '{}' to handler for channel '{}'", command, itemName, channelUID); try { SafeMethodCaller.call(new SafeMethodCaller.ActionWithException<Void>() { @Override public Void call() throws Exception { handler.handleCommand(channelUID, command); return null; } }); } catch (TimeoutException ex) { logger.warn("Handler for thing '{}' takes more than {}ms for processing event", handler.getThing().getUID(), SafeMethodCaller.DEFAULT_TIMEOUT); } catch (Exception ex) { logger.error("Exception occured while calling handler: " + ex.getMessage(), ex); } } else { logger.warn("Cannot delegate command '{}' for item '{}' to handler for channel '{}', " + "because thing is not initialized (must be in status ONLINE or OFFLINE).", command, itemName, channelUID); } } else { logger.warn("Cannot delegate command '{}' for item '{}' to handler for channel '{}', " + "because no handler is assigned. Maybe the binding is not installed or not " + "propertly initialized.", command, itemName, channelUID); } } else { logger.warn( "Cannot delegate command '{}' for item '{}' to handler for channel '{}', " + "because no thing with the UID '{}' could be found.", command, itemName, channelUID, channelUID.getThingUID()); } } } }

Target:
protected void receiveCommand(ItemCommandEvent commandEvent) { String itemName = commandEvent.getItemName(); final Command command = commandEvent.getItemCommand(); Set<ChannelUID> boundChannels = this.itemChannelLinkRegistry.getBoundChannels(itemName); for (final ChannelUID channelUID : boundChannels) { if (!channelUID.toString().equals(commandEvent.getSource())) { Thing thing = getThing(channelUID.getThingUID()); if (thing != null) { final ThingHandler handler = thing.getHandler(); if (handler != null) { if (isInitialized(thing)) { logger.debug("Delegating command '{}' for item '{}' to handler for channel '{}'", command, itemName, channelUID); try { SafeMethodCaller.call(new SafeMethodCaller.ActionWithException<Void>() { @Override public Void call() throws Exception { handler.handleCommand(channelUID, command); return null; } }); } catch (TimeoutException ex) { logger.warn("Handler for thing '{}' takes more than {}ms for processing event", handler.getThing().getUID(), SafeMethodCaller.DEFAULT_TIMEOUT); } catch (Exception ex) { logger.error("Exception occured while calling handler: " + ex.getMessage(), ex); } } else { logger.info("Not delegating command '{}' for item '{}' to handler for channel '{}', " + "because thing is not initialized (must be in status ONLINE or OFFLINE).", command, itemName, channelUID); } } else { logger.warn("Cannot delegate command '{}' for item '{}' to handler for channel '{}', " + "because no handler is assigned. Maybe the binding is not installed or not " + "propertly initialized.", command, itemName, channelUID); } } else { logger.warn( "Cannot delegate command '{}' for item '{}' to handler for channel '{}', " + "because no thing with the UID '{}' could be found.", command, itemName, channelUID, channelUID.getThingUID()); } } } }