Source:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand() is called, with itemName '" + itemName + "' and Command '" + command + "'!"); if (loggedIn) { Cardio2eTransaction transaction; Cardio2eBindingConfig config = null; boolean reverseOrder; Cardio2eBindingProvider provider = null; if (!providers.isEmpty()) { provider = providers.iterator().next(); logger.debug("Checking provider with names {}", provider.getItemNames()); transaction = null; reverseOrder = false; if (command instanceof UpDownType) { if ((UpDownType) command == UpDownType.UP) { reverseOrder = true; } } if (reverseOrder) { config = provider.getReverseOrderConfig(itemName); } else { config = provider.getConfig(itemName); } for (Cardio2eBindingConfigItem configItem : config) { try { synchronized (configItem.transaction) { transaction = configItem.transaction.deepClone(); } if (!(configItem.reverseMode)) { switch (transaction.getObjectType()) { case SECURITY: case SCENARIO: Cardio2eTransactionParser.commandToTransaction(command, transaction, securityCode); break; case DATE_AND_TIME: pendingDateTimeUpdate.setDateTime(null); logger.debug("Cancelled any date and time update task"); default: Cardio2eTransactionParser.commandToTransaction(command, transaction, null); } if (transaction.mustBeSent) { transaction.primitiveStringTransaction = transaction.toString(); com.sendTransaction(transaction); logger.debug("Added '" + transaction.primitiveStringTransaction.substring(0, transaction.primitiveStringTransaction.length() - 1) + "' to Cardio 2é RS-232 send queue"); } else { logger.debug("No command sent to Cardio 2è because it is not necessary to send current object value again"); } } else { logger.debug("No command sent to Cardio 2è because item is configured as 'reverse mode'"); } } catch (Exception e) { logger.error("Error processing command. " + e); } } } else { logger.error("No command will sent to Cardio 2è because no provider is available"); } } else { logger.error("Can not send command to Cardio 2è because we are not logged in"); } }

Target:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug( "internalReceiveCommand() is called, with itemName '{}' and Command '{}'!", itemName, command); if (loggedIn) { Cardio2eTransaction transaction; Cardio2eBindingConfig config = null; boolean reverseOrder; Cardio2eBindingProvider provider = null; if (!providers.isEmpty()) { provider = providers.iterator().next(); logger.debug("Checking provider with names {}", provider.getItemNames()); transaction = null; reverseOrder = false; if (command instanceof UpDownType) { if ((UpDownType) command == UpDownType.UP) { reverseOrder = true; } } if (reverseOrder) { config = provider.getReverseOrderConfig(itemName); } else { config = provider.getConfig(itemName); } for (Cardio2eBindingConfigItem configItem : config) { try { synchronized (configItem.transaction) { transaction = configItem.transaction.deepClone(); } if (!(configItem.reverseMode)) { switch (transaction.getObjectType()) { case SECURITY: case SCENARIO: Cardio2eTransactionParser.commandToTransaction( command, transaction, securityCode); break; case DATE_AND_TIME: pendingDateTimeUpdate.setDateTime(null); logger.debug("Cancelled any date and time update task"); default: Cardio2eTransactionParser.commandToTransaction( command, transaction, null); } if (transaction.mustBeSent) { transaction.primitiveStringTransaction = transaction .toString(); logger.debug( "Adding '{}' to Cardio 2é RS-232 send queue", transaction.primitiveStringTransaction .substring( 0, transaction.primitiveStringTransaction .length() - 1)); com.sendTransaction(transaction); } else { logger.debug("No command sent to Cardio 2é because it is not necessary to send current object value again"); } } else { logger.debug("No command sent to Cardio 2é because item is configured as 'reverse mode'"); } } catch (Exception ex) { logger.warn("Error in processing command: '{}'", ex.toString()); } } } else { logger.warn("No command will sent to Cardio 2é because no provider is available"); } } else { logger.warn("Can not send command to Cardio 2é because we are not logged in"); } }