public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof IRequirement)) return false; IRequirement other = (IRequirement) obj; if (filter == null) { if (other.getFilter() != null) return false; } else if (!filter.equals(other.getFilter())) return false; return min == other.getMin() && max == other.getMax() && greedy == other.isGreedy() && matchExpression.equals(other.getMatches()); }
Collection<IRequirement> reqs = metaIu.getRequirements(); for (IRequirement req : reqs) { if (req.getMin() > 0 || !req.isGreedy()) continue; IQueryResult<IInstallableUnit> matches = picker.query(QueryUtil.createMatchQuery(req.getMatches()), null);
private void expandRequirement(IInstallableUnit iu, IRequirement req) { if (req.getMax() == 0) return; IQueryResult<IInstallableUnit> matches = possibilites.query(QueryUtil.createMatchQuery(req.getMatches()), null); int validMatches = 0; for (Iterator<IInstallableUnit> iterator = matches.iterator(); iterator.hasNext();) { IInstallableUnit match = iterator.next(); if (!isApplicable(match)) continue; validMatches++; Map<Version, IInstallableUnit> iuSlice = slice.get(match.getId()); if (iuSlice == null || !iuSlice.containsKey(match.getVersion())) consider(match); } if (validMatches == 0) { if (req.getMin() == 0) { if (DEBUG) System.out.println("No IU found to satisfy optional dependency of " + iu + " on req " + req); //$NON-NLS-1$//$NON-NLS-2$ } else { result.add(new Status(IStatus.WARNING, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Planner_Unsatisfied_dependency, iu, req))); } } }
private void expandRequirement(IInstallableUnit iu, IRequirement req) { if (req.getMax() == 0) return; IQueryResult<IInstallableUnit> matches = possibilites.query(QueryUtil.createMatchQuery(req.getMatches()), null); int validMatches = 0; for (Iterator<IInstallableUnit> iterator = matches.iterator(); iterator.hasNext();) { IInstallableUnit match = iterator.next(); if (!isApplicable(match)) continue; validMatches++; Map<Version, IInstallableUnit> iuSlice = slice.get(match.getId()); if (iuSlice == null || !iuSlice.containsKey(match.getVersion())) consider(iu, match); } if (validMatches == 0) { if (req.getMin() == 0) { if (DEBUG) System.out.println("No IU found to satisfy optional dependency of " + iu + " on req " + req); //$NON-NLS-1$//$NON-NLS-2$ } else { result.add(new Status(IStatus.WARNING, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Planner_Unsatisfied_dependency, iu, req))); } } }
protected boolean isApplicable(IRequirement req) { //Every filter in this method needs to continue except when the filter does not pass if (!includeOptionalDependencies) if (req.getMin() == 0) return false; if (considerOnlyStrictDependency) { if (!RequiredCapability.isVersionStrict(req.getMatches())) return false; } //deal with filters if (considerFilter) { if (onlyFilteredRequirements && req.getFilter() == null) { return false; } return super.isApplicable(req); } if (req.getFilter() == null) { if (onlyFilteredRequirements) return false; return true; } return evalFilterTo; }
@Override protected boolean isApplicable(IRequirement req) { //Every filter in this method needs to continue except when the filter does not pass if (!includeOptionalDependencies) if (req.getMin() == 0) return false; if (considerOnlyStrictDependency) { if (!RequiredCapability.isStrictVersionRequirement(req.getMatches())) return false; } //deal with filters if (considerFilter) { if (onlyFilteredRequirements && req.getFilter() == null) { return false; } return super.isApplicable(req); } if (req.getFilter() == null) { if (onlyFilteredRequirements) return false; return true; } return evalFilterTo; }
List<IInstallableUnit> matches = getApplicableMatches(req); determinePotentialHostsForFragment(iu); if (req.getMin() > 0) { if (matches.isEmpty()) { if (iu == entryPoint && emptyBecauseFiltered) {
List<IInstallableUnit> matches = getApplicableMatches(req); determinePotentialHostsForFragment(iu); if (req.getMin() > 0) { if (matches.isEmpty()) { missingRequirement(patch, req); List<IInstallableUnit> matches = getApplicableMatches(req); determinePotentialHostsForFragment(iu); if (req.getMin() > 0) { if (matches.isEmpty()) { matches.add(patch); List<IInstallableUnit> matches = getApplicableMatches(req); determinePotentialHostsForFragment(iu); if (req.getMin() > 0) { if (matches.isEmpty()) { if (requiredPatches.isEmpty()) {
protected void writeRequirement(IRequirement requirement) { start(REQUIREMENT_ELEMENT); IMatchExpression<IInstallableUnit> match = requirement.getMatches(); if (requirement.getMax() > 0 && RequiredCapability.isSimpleRequirement(match)) { attribute(NAMESPACE_ATTRIBUTE, RequiredCapability.extractNamespace(match)); attribute(NAME_ATTRIBUTE, RequiredCapability.extractName(match)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(match)); attribute(CAPABILITY_OPTIONAL_ATTRIBUTE, requirement.getMin() == 0, false); attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, requirement.getMax() > 1, false); } else { writeMatchExpression(match); if (requirement.getMin() != 1) attribute(MIN_ATTRIBUTE, requirement.getMin()); if (requirement.getMax() != 1) attribute(MAX_ATTRIBUTE, requirement.getMax()); } attribute(CAPABILITY_GREED_ATTRIBUTE, requirement.isGreedy(), true); if (requirement.getFilter() != null) writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, requirement.getFilter().getParameters()[0].toString()); if (requirement.getDescription() != null) writeTrimmedCdata(REQUIREMENT_DESCRIPTION_ELEMENT, requirement.getDescription()); end(REQUIREMENT_ELEMENT); }
protected void writeRequirement(IRequirement requirement) { start(REQUIREMENT_ELEMENT); IMatchExpression<IInstallableUnit> match = requirement.getMatches(); if (requirement.getMax() > 0 && RequiredCapability.isSimpleRequirement(match)) { attribute(NAMESPACE_ATTRIBUTE, RequiredCapability.extractNamespace(match)); attribute(NAME_ATTRIBUTE, RequiredCapability.extractName(match)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(match)); attribute(CAPABILITY_OPTIONAL_ATTRIBUTE, requirement.getMin() == 0, false); attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, requirement.getMax() > 1, false); } else { writeMatchExpression(match); if (requirement.getMin() != 1) attribute(MIN_ATTRIBUTE, requirement.getMin()); if (requirement.getMax() != 1) attribute(MAX_ATTRIBUTE, requirement.getMax()); } attribute(CAPABILITY_GREED_ATTRIBUTE, requirement.isGreedy(), true); if (requirement.getFilter() != null) writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, requirement.getFilter().getParameters()[0].toString()); if (requirement.getDescription() != null) writeTrimmedCdata(REQUIREMENT_DESCRIPTION_ELEMENT, requirement.getDescription()); end(REQUIREMENT_ELEMENT); }
protected void writeRequirement(IRequirement requirement) { start(REQUIREMENT_ELEMENT); IMatchExpression<IInstallableUnit> match = requirement.getMatches(); if (requirement.getMax() > 0 && RequiredCapability.isSimpleRequirement(match)) { attribute(NAMESPACE_ATTRIBUTE, RequiredCapability.extractNamespace(match)); attribute(NAME_ATTRIBUTE, RequiredCapability.extractName(match)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(match)); attribute(CAPABILITY_OPTIONAL_ATTRIBUTE, requirement.getMin() == 0, false); attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, requirement.getMax() > 1, false); } else { writeMatchExpression(match); if (requirement.getMin() != 1) attribute(MIN_ATTRIBUTE, requirement.getMin()); if (requirement.getMax() != 1) attribute(MAX_ATTRIBUTE, requirement.getMax()); } attribute(CAPABILITY_GREED_ATTRIBUTE, requirement.isGreedy(), true); if (requirement.getFilter() != null) writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, requirement.getFilter().getParameters()[0].toString()); if (requirement.getDescription() != null) writeTrimmedCdata(REQUIREMENT_DESCRIPTION_ELEMENT, requirement.getDescription()); end(REQUIREMENT_ELEMENT); }