Source:
<code>public synchronized boolean add(DiscoveryResult result) throws IllegalStateException { if (result != null) { ThingUID thingUID = result.getThingUID(); <START> Thing thing = getExistingThingForDiscoveryResult(result); <END> if (thing == null) { DiscoveryResult inboxResult = get(thingUID); if (inboxResult == null) { discoveryResultStorage.put(result.getThingUID().toString(), result); notifyListeners(result, EventType.added); logger.info("Added new thing '{}' to inbox.", thingUID); return true; } else { if (inboxResult instanceof DiscoveryResultImpl) { DiscoveryResultImpl resultImpl = (DiscoveryResultImpl) inboxResult; resultImpl.synchronize(result); discoveryResultStorage.put(result.getThingUID().toString(), resultImpl); notifyListeners(resultImpl, EventType.updated); logger.debug("Updated discovery result for '{}'.", thingUID); return true; } else { logger.warn("Cannot synchronize result with implementation class '{}'.", inboxResult.getClass().getName()); } } } else { logger.debug("Discovery result with thing '{}' not added as inbox entry." + " It is already present as thing in the ThingRegistry.", thingUID); boolean updated = synchronizeConfiguration(result.getThingTypeUID(), result.getProperties(), thing.getConfiguration()); if (updated) { logger.debug("The configuration for thing '{}' is updated...", thingUID); this.managedThingProvider.update(thing); } } } return false; }</code><technical_language>Hm. This change discussed approach in a ways: - changing existing behavior adding results, UID exists. I thought idea "auto-ignore" a configurable feature interfere existing logic. - If is considered "auto-ignore", is wrong here, add result. This feature unsymmetric: A result is present, ignored, if Discovery Result is added. is present, if is added manually is discovered. cleaner if AutomaticInboxProcessor listen Inbox events do ignore functionality in case</technical_language>

Target:
public synchronized boolean add(DiscoveryResult result) throws IllegalStateException { if (result != null) { ThingUID thingUID = result.getThingUID(); Thing thing = this.thingRegistry.get(thingUID); if (thing == null) { DiscoveryResult inboxResult = get(thingUID); if (inboxResult == null) { discoveryResultStorage.put(result.getThingUID().toString(), result); notifyListeners(result, EventType.added); logger.info("Added new thing '{}' to inbox.", thingUID); return true; } else { if (inboxResult instanceof DiscoveryResultImpl) { DiscoveryResultImpl resultImpl = (DiscoveryResultImpl) inboxResult; resultImpl.synchronize(result); discoveryResultStorage.put(result.getThingUID().toString(), resultImpl); notifyListeners(resultImpl, EventType.updated); logger.debug("Updated discovery result for '{}'.", thingUID); return true; } else { logger.warn("Cannot synchronize result with implementation class '{}'.", inboxResult.getClass().getName()); } } } else { logger.debug("Discovery result with thing '{}' not added as inbox entry." + " It is already present as thing in the ThingRegistry.", thingUID); boolean updated = synchronizeConfiguration(result.getThingTypeUID(), result.getProperties(), thing.getConfiguration()); if (updated) { logger.debug("The configuration for thing '{}' is updated...", thingUID); this.managedThingProvider.update(thing); } } } return false; }