Source:
synchronized void createWires() throws KuraException { logger.debug(message.creatingWires()); final List<WireConfiguration> cloned = CollectionUtil.newArrayList(); for (final WireConfiguration wc : this.wireConfigs) { cloned.add(new WireConfiguration(wc.getEmitterPid(), wc.getReceiverPid(), wc.getFilter())); } for (final WireConfiguration conf : cloned) { final String emitterPid = conf.getEmitterPid(); final String receiverPid = conf.getReceiverPid(); final boolean emitterFound = this.trackerCustomizer.getWireEmitters().contains(emitterPid); final boolean receiverFound = this.trackerCustomizer.getWireReceivers().contains(receiverPid); if (emitterFound && receiverFound) { logger.info(message.creatingWire(emitterPid, receiverPid)); final String emitterServicePid = this.wireHelperService.getServicePid(emitterPid); final String receiverServicePid = this.wireHelperService.getServicePid(receiverPid); if ((emitterServicePid != null) && (receiverServicePid != null)) { if (conf.getWire() == null) { try { final Wire[] wires = this.wireAdmin.getWires(conf.getFilter()); boolean found = false; if (wires != null) { for (final Wire w : wires) { if (w.getProperties().get(WIREADMIN_PRODUCER_PID).equals(emitterServicePid) && w .getProperties().get(WIREADMIN_CONSUMER_PID).equals(receiverServicePid)) { found = true; break; } } } if (!found) { final Wire wire = this.wireAdmin.createWire(emitterServicePid, receiverServicePid, null); conf.setWire(wire); } } catch (final InvalidSyntaxException e) { logger.error(ThrowableUtil.stackTraceAsString(e)); } } } } } logger.debug(message.creatingWiresDone()); }

Target:
synchronized void createWires() throws KuraException { logger.debug(message.creatingWires()); final List<WireConfiguration> cloned = CollectionUtil.newArrayList(); for (final WireConfiguration wc : this.wireConfigs) { cloned.add(new WireConfiguration(wc.getEmitterPid(), wc.getReceiverPid(), wc.getFilter())); } for (final WireConfiguration conf : cloned) { final String emitterPid = conf.getEmitterPid(); final String receiverPid = conf.getReceiverPid(); final boolean emitterFound = this.trackerCustomizer.getWireEmitters().contains(emitterPid); final boolean receiverFound = this.trackerCustomizer.getWireReceivers().contains(receiverPid); if (emitterFound && receiverFound) { logger.info(message.creatingWire(emitterPid, receiverPid)); final String emitterServicePid = this.wireHelperService.getServicePid(emitterPid); final String receiverServicePid = this.wireHelperService.getServicePid(receiverPid); if ((emitterServicePid != null) && (receiverServicePid != null)) { if (conf.getWire() == null) { try { final Wire[] wires = this.wireAdmin.getWires(conf.getFilter()); boolean found = false; if (wires != null) { for (final Wire w : wires) { if (w.getProperties().get(WIREADMIN_PRODUCER_PID).equals(emitterServicePid) && w .getProperties().get(WIREADMIN_CONSUMER_PID).equals(receiverServicePid)) { found = true; break; } } } if (!found) { final Wire wire = this.wireAdmin.createWire(emitterServicePid, receiverServicePid, null); conf.setWire(wire); } } catch (final InvalidSyntaxException e) { logger.error(e.getMessage(), e); } } } } } logger.debug(message.creatingWiresDone()); }