Source:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); MCP3424BindingConfig config = new MCP3424BindingConfig(item); JsonParserFactory factory = JsonParserFactory.getInstance(); JSONParser parser = factory.newJsonParser(); @SuppressWarnings("unchecked") Map<String, Object> jsonData = parser.parseJson(bindingConfig); try { logger.debug("processingBindingConfiguration in context " + context); config.setBusAddress(Integer.parseInt((String) jsonData.get("address"), 16)); config.setPin((Pin) MCP3424Pin.class.getField("GPIO_" + (String) jsonData.get("pin")).get(null)); } catch (IllegalArgumentException exception) { final String message = "Illegal argument exception in configuration string "; logger.error("{} '{}': {}", message, bindingConfig, exception.getMessage()); throw new BindingConfigParseException(message + "'" + bindingConfig + "'"); } catch (IllegalAccessException exception) { final String message = "Illegal access exception in configuration string "; logger.error("{} '{}': {}", message, bindingConfig, exception.getMessage()); throw new BindingConfigParseException(message + "'" + bindingConfig + "'"); } catch (NoSuchFieldException exception) { final String message = "No such field exception in configuration string "; logger.error("{} '{}': {}", message, bindingConfig, exception.getMessage()); throw new BindingConfigParseException(message + "'" + bindingConfig + "'"); } catch (SecurityException exception) { final String message = "Security exception in configuration string "; logger.error("{} '{}': {}", message, bindingConfig, exception.getMessage()); throw new BindingConfigParseException(message + "'" + bindingConfig + "'"); } try { config.setGain(Integer.parseInt((String) jsonData.get("gain"), 10)); } catch (Exception e) { logger.info("No configuration for gain. Using default: {}", config.getGain()); } try { config.setResolution(Integer.parseInt((String) jsonData.get("resolution"), 10)); } catch (Exception e) { logger.info("No configuration for resolution. Using default: {}", config.getResolution()); } addBindingConfig(item, config); }

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); MCP3424BindingConfig config = new MCP3424BindingConfig(item); JsonParserFactory factory = JsonParserFactory.getInstance(); JSONParser parser = factory.newJsonParser(); @SuppressWarnings("unchecked") Map<String, Object> jsonData = parser.parseJson(bindingConfig); try { logger.debug("processingBindingConfiguration in context {}", context); config.setBusAddress(Integer.parseInt((String) jsonData.get("address"), 16)); config.setPin((Pin) MCP3424Pin.class.getField("GPIO_" + (String) jsonData.get("pin")).get(null)); } catch (IllegalArgumentException exception) { final String message = "Illegal argument exception in configuration string "; logger.error("{} '{}': {}", message, bindingConfig, exception.getMessage()); throw new BindingConfigParseException(message + "'" + bindingConfig + "'"); } catch (IllegalAccessException exception) { final String message = "Illegal access exception in configuration string "; logger.error("{} '{}': {}", message, bindingConfig, exception.getMessage()); throw new BindingConfigParseException(message + "'" + bindingConfig + "'"); } catch (NoSuchFieldException exception) { final String message = "No such field exception in configuration string "; logger.error("{} '{}': {}", message, bindingConfig, exception.getMessage()); throw new BindingConfigParseException(message + "'" + bindingConfig + "'"); } catch (SecurityException exception) { final String message = "Security exception in configuration string "; logger.error("{} '{}': {}", message, bindingConfig, exception.getMessage()); throw new BindingConfigParseException(message + "'" + bindingConfig + "'"); } try { config.setGain(Integer.parseInt((String) jsonData.get("gain"), 10)); } catch (Exception e) { logger.info("No configuration for gain. Using default: {}", config.getGain()); } try { config.setResolution(Integer.parseInt((String) jsonData.get("resolution"), 10)); } catch (Exception e) { logger.info("No configuration for resolution. Using default: {}", config.getResolution()); } addBindingConfig(item, config); }