Source:
public void initialize() { logger.debug("Initializing WeatherUnderground handler."); WeatherUndergroundConfiguration config = getConfigAs(WeatherUndergroundConfiguration.class); logger.debug("config location = {}", config.location); logger.debug("config language = {}", config.language); logger.debug("config refresh = {}", config.refresh); boolean validConfig = true; String errors = ""; String statusDescr = null; bridge = this.getBridge(); if (bridge == null) { logger.error("Error: you must configure a bridge"); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Bridge uninitialized"); } else { WeatherUndergroundBridgeHandler handler = (WeatherUndergroundBridgeHandler) bridge.getHandler(); logger.debug("config apikey = {}", handler.getApikey()); if (StringUtils.trimToNull(handler.getApikey()) == null) { errors += " Parameter 'apikey' must be configured."; statusDescr = "@text/offline.conf-error-missing-apikey"; validConfig = false; } } if (StringUtils.trimToNull(config.location) == null) { errors += " Parameter 'location' must be configured."; statusDescr = "@text/offline.conf-error-missing-location"; validConfig = false; } if (config.language != null) { String lang = StringUtils.trimToEmpty(config.language); if (lang.length() != 2) { errors += " Parameter 'language' must be 2 letters."; statusDescr = "@text/offline.conf-error-syntax-language"; validConfig = false; } } if (config.refresh != null && config.refresh < 5) { errors += " Parameter 'refresh' must be at least 5 minutes."; statusDescr = "@text/offline.conf-error-min-refresh"; validConfig = false; } errors = errors.trim(); if (validConfig) { startAutomaticRefresh(); } else { logger.debug("Disabling thing '{}': {}", getThing().getUID(), errors); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, statusDescr); } }

Target:
public void initialize() { logger.debug("Initializing WeatherUnderground handler."); WeatherUndergroundConfiguration config = getConfigAs(WeatherUndergroundConfiguration.class); logger.debug("config location = {}", config.location); logger.debug("config language = {}", config.language); logger.debug("config refresh = {}", config.refresh); boolean validConfig = true; String errors = ""; String statusDescr = null; if (this.getBridge() == null) { logger.error("Error: you must configure a bridge"); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Bridge uninitialized"); } if (StringUtils.trimToNull(config.location) == null) { errors += " Parameter 'location' must be configured."; statusDescr = "@text/offline.conf-error-missing-location"; validConfig = false; } if (config.language != null) { String lang = StringUtils.trimToEmpty(config.language); if (lang.length() != 2) { errors += " Parameter 'language' must be 2 letters."; statusDescr = "@text/offline.conf-error-syntax-language"; validConfig = false; } } if (config.refresh != null && config.refresh < 5) { errors += " Parameter 'refresh' must be at least 5 minutes."; statusDescr = "@text/offline.conf-error-min-refresh"; validConfig = false; } errors = errors.trim(); if (validConfig) { startAutomaticRefresh(); } else { logger.debug("Disabling thing '{}': {}", getThing().getUID(), errors); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, statusDescr); } }