void permutateIfNeeded(PermutationType type, Requirement req, Candidates permutation) { List<Capability> candidates = permutation.getCandidates(req); if ((candidates != null) && (candidates.size() > 1)) { if ((type == PermutationType.SUBSTITUTE)) { if (!m_sub_mutated.add(req)) { return; } } else if (!m_mutated.add(req)) { return; } // If we haven't already permutated the existing // import, do so now. addPermutation(type, permutation.permutate(req)); } }
void permutateIfNeeded(PermutationType type, Requirement req, Candidates permutation) { List<Capability> candidates = permutation.getCandidates(req); if ((candidates != null) && (candidates.size() > 1)) { if ((type == PermutationType.SUBSTITUTE)) { if (!m_sub_mutated.add(req)) { return; } } else if (!m_mutated.add(req)) { return; } // If we haven't already permutated the existing // import, do so now. addPermutation(type, permutation.permutate(req)); } }
void permutateIfNeeded(PermutationType type, Requirement req, Candidates permutation) { List<Capability> candidates = permutation.getCandidates(req); if ((candidates != null) && (candidates.size() > 1)) { if ((type == PermutationType.SUBSTITUTE)) { if (!m_sub_mutated.add(req)) { return; } } else if (!m_mutated.add(req)) { return; } // If we haven't already permutated the existing // import, do so now. addPermutation(type, permutation.permutate(req)); } }
void permutateIfNeeded(PermutationType type, Requirement req, Candidates permutation) { List<Capability> candidates = permutation.getCandidates(req); if ((candidates != null) && (candidates.size() > 1)) { if ((type == PermutationType.SUBSTITUTE)) { if (!m_sub_mutated.add(req)) { return; } } else if (!m_mutated.add(req)) { return; } // If we haven't already permutated the existing // import, do so now. addPermutation(type, permutation.permutate(req)); } }
void permutateIfNeeded(PermutationType type, Requirement req, Candidates permutation) { List<Capability> candidates = permutation.getCandidates(req); if ((candidates != null) && (candidates.size() > 1)) { if ((type == PermutationType.SUBSTITUTE)) { if (!m_sub_mutated.add(req)) { return; } } else if (!m_mutated.add(req)) { return; } // If we haven't already permutated the existing // import, do so now. addPermutation(type, permutation.permutate(req)); } }
void permutateIfNeeded(PermutationType type, Requirement req, Candidates permutation) { List<Capability> candidates = permutation.getCandidates(req); if ((candidates != null) && (candidates.size() > 1)) { if ((type == PermutationType.SUBSTITUTE)) { if (!m_sub_mutated.add(req)) { return; } } else if (!m_mutated.add(req)) { return; } // If we haven't already permutated the existing // import, do so now. addPermutation(type, permutation.permutate(req)); } }
static void permutateIfNeeded( Candidates allCandidates, Requirement req, List<Candidates> permutations) { List<Capability> candidates = allCandidates.getCandidates(req); if ((candidates != null) && (candidates.size() > 1)) { // Check existing permutations to make sure we haven't // already permutated this requirement. This check for // duplicate permutations is simplistic. It assumes if // there is any permutation that contains a different // initial candidate for the requirement in question, // then it has already been permutated. boolean permutated = false; for (Candidates existingPerm : permutations) { List<Capability> existingPermCands = existingPerm.getCandidates(req); if (!existingPermCands.get(0).equals(candidates.get(0))) { permutated = true; } } // If we haven't already permutated the existing // import, do so now. if (!permutated) { permutate(allCandidates, req, permutations); } } }
private static void permutate( Candidates allCandidates, Requirement req, List<Candidates> permutations) { if (!Util.isMultiple(req)) { List<Capability> candidates = allCandidates.getCandidates(req); if ((candidates != null) && (candidates.size() > 1 || Util.isOptional(req))) { Candidates perm = allCandidates.copy(); candidates = perm.getCandidates(req); candidates.remove(0); if (candidates.isEmpty()) { perm.clearCandidates(req); } permutations.add(perm); } } }
private static Map<Resource, List<Wire>> populateDynamicWireMap( ResolveContext rc, Resource resource, Requirement dynReq, Map<Resource, Packages> resourcePkgMap, Map<Resource, List<Wire>> wireMap, Candidates allCandidates) { wireMap.put(resource, (List<Wire>) Collections.EMPTY_LIST); List<Wire> packageWires = new ArrayList<Wire>(); // Get the candidates for the current dynamic requirement. List<Capability> candCaps = allCandidates.getCandidates(dynReq); // Record the dynamic candidate. Capability dynCand = candCaps.get(0); if (!rc.getWirings().containsKey(dynCand.getResource())) { populateWireMap(rc, dynCand.getResource(), resourcePkgMap, wireMap, allCandidates); } packageWires.add( new WireImpl( resource, dynReq, getDeclaredResource(dynCand.getResource()), getDeclaredCapability(dynCand))); wireMap.put(resource, packageWires); return wireMap; }
private static Wire createWire(Requirement requirement, Candidates allCandidates) { List<Capability> candidates = allCandidates.getCandidates(requirement); if (candidates == null || candidates.isEmpty()) { return null; } Capability cand = candidates.get(0); return new WireImpl( getDeclaredResource(requirement.getResource()), getDeclaredRequirement(requirement), getDeclaredResource(cand.getResource()), getDeclaredCapability(cand)); }
private boolean checkMultiple( ResolveSession session, UsedBlames usedBlames, Blame usedBlame, Candidates permutation) { // Check the root requirement to see if it is a multiple cardinality // requirement. List<Capability> candidates = null; Requirement req = usedBlame.m_reqs.get(0); if (Util.isMultiple(req)) { // Create a copy of the current permutation so we can remove the // candidates causing the blame. if (session.getMultipleCardCandidates() == null) { session.setMultipleCardCandidates(permutation.copy()); } // Get the current candidate list and remove all the offending root // cause candidates from a copy of the current permutation. candidates = session.getMultipleCardCandidates().getCandidates(req); candidates.removeAll(usedBlames.getRootCauses(req)); } // We only are successful if there is at least one candidate left // for the requirement return (candidates != null) && !candidates.isEmpty(); }
List<Capability> cands = allCandidates.getCandidates(req); if ((cands != null) && !cands.isEmpty())
if ((value != null) && value.equals(BundleNamespace.VISIBILITY_REEXPORT) && (allCandidates.getCandidates(req) != null)) current, currentReq, allCandidates.getCandidates(req).iterator().next(), resourcePkgMap, allCandidates,
List<Capability> cands = allCandidates.getCandidates(req); if (cands != null)
List<Capability> candCaps = allCandidates.getCandidates(req);
List<Capability> candCaps = allCandidates.getCandidates(req);
List<Capability> candCaps = allCandidates.getCandidates(req);
List<Capability> candCaps = allCandidates.getCandidates(req);
List<Capability> candCaps = allCandidates.getCandidates(req);
List<Capability> candCaps = allCandidates.getCandidates(req);