private static void walkKnownBundleDependenciesUp()

in nbm-maven-plugin/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java [990:1022]


    private static void walkKnownBundleDependenciesUp(List<BundleTuple> known, List<BundleTuple> toProcess) {
        boolean atLeastOneWasFound = false;
        for (Iterator<BundleTuple> it = toProcess.iterator(); it.hasNext();) {
            BundleTuple bundleTuple = it.next();
            boolean found = false;
            for (BundleTuple knownBT : known) {
                if (!intersection(bundleTuple.manifest.getOsgiImports(), knownBT.manifest.getOsgiExports()).isEmpty()) {
                    found = true;
                    bundleTuple.cluster = knownBT.cluster;
                    break;
                }
                //dependencyTokens are requireBundle - matches the module property
                if (bundleTuple.manifest.getDependencyTokens().contains(knownBT.manifest.getModule())) {
                    found = true;
                    bundleTuple.cluster = knownBT.cluster;
                    break;
                }

            }
            if (found) {
                atLeastOneWasFound = true;
                it.remove();
                known.add(bundleTuple);
            }

        }
        if (!toProcess.isEmpty() && atLeastOneWasFound) {
            walkKnownBundleDependenciesDown(known, toProcess);
        }
        if (!toProcess.isEmpty() && atLeastOneWasFound) {
            walkKnownBundleDependenciesUp(known, toProcess);
        }
    }