Source:
<code>public List<String> getPidsFromTarget(GwtXSRFToken xsrfToken, String pid, String targetRef) throws GwtKuraException { this.checkXSRFToken(xsrfToken); List<String> result = new ArrayList<>(); final BundleContext context = FrameworkUtil.getBundle(GwtWireGraphService.class).getBundleContext(); ServiceReference<ServiceComponentRuntime> scrServiceRef = context .getServiceReference(ServiceComponentRuntime.class); try { final ServiceComponentRuntime scrService = context.getService(scrServiceRef); final Set<String> referenceInterfaces = scrService.getComponentDescriptionDTOs().stream().map(component -> { ReferenceDTO[] references = component.references; for (ReferenceDTO reference : references) { if (targetRef.equals(reference.name)) { return reference.interfaceName; } } return null; }).filter(Objects::nonNull).collect(Collectors.toSet()); <START> referenceInterfaces.forEach(reference -> { <END> try { ServiceReference<?>[] serviceReferences = context.getServiceReferences(reference, null); if (isNull(serviceReferences)) { return; } for (ServiceReference<?> serviceReference : serviceReferences) { String cloudServicePid = (String) serviceReference.getProperty(KURA_SERVICE_PID); result.add(cloudServicePid); ServiceLocator.getInstance().ungetService(serviceReference); } } catch (InvalidSyntaxException e) { } }); } finally { context.ungetService(scrServiceRef); } return result; }</code><technical_language>code creates referenceInterfaces consider references included in definition of component kura.service.pid=pid. getPidsFromTarget() method ignore pid argument completely. This incorrect interfaces added set included in search</technical_language>

Target:
public List<String> getPidsFromTarget(GwtXSRFToken xsrfToken, String pid, String targetRef) throws GwtKuraException { this.checkXSRFToken(xsrfToken); List<String> result = new ArrayList<>(); final BundleContext context = FrameworkUtil.getBundle(GwtWireGraphService.class).getBundleContext(); ServiceReference<ServiceComponentRuntime> scrServiceRef = context .getServiceReference(ServiceComponentRuntime.class); try { final ServiceComponentRuntime scrService = context.getService(scrServiceRef); final Set<String> referenceInterfaces = scrService.getComponentDescriptionDTOs().stream() .filter(componentDescription -> scrService.getComponentConfigurationDTOs(componentDescription) .stream().anyMatch(componentConfiguration -> { String kuraServicePid = (String) componentConfiguration.properties .get(ConfigurationService.KURA_SERVICE_PID); return kuraServicePid != null && kuraServicePid.equals(pid); })) .map(componentDescription -> { ReferenceDTO[] references = componentDescription.references; for (ReferenceDTO reference : references) { if (targetRef.equals(reference.name)) { return reference.interfaceName; } } return null; }).filter(Objects::nonNull).collect(Collectors.toSet()); referenceInterfaces.forEach(reference -> { try { ServiceReference<?>[] serviceReferences = context.getServiceReferences(reference, null); if (isNull(serviceReferences)) { return; } Arrays.stream(serviceReferences).forEach(serviceReference -> { result.add((String) serviceReference.getProperty(KURA_SERVICE_PID)); ServiceLocator.getInstance().ungetService(serviceReference); }); } catch (InvalidSyntaxException e) { } }); } finally { context.ungetService(scrServiceRef); } return result; }