public synchronized void addDependencyQualification(QualifiedDependency newQDep, String tagInf) throws CoreException { NodeQuery qualifiedQuery = query.addDependencyQualification(newQDep); if (qualifiedQuery == query) // // Old query already declared the needed purposes. // return; VersionRange newVd = qualifiedQuery.getVersionRange(); if (resolution != null) { // Re-resolve might be necessary // if ((newVd == null || newVd.isIncluded(resolution.getVersion())) && query .getQualifiedDependency() .hasAllAttributes(qualifiedQuery.getRequiredAttributes())) { // Nope, the resolution is still valid for this new query // query = qualifiedQuery; if (tagInfo != null) qualifiedQuery.getContext().addTagInfo(qualifiedQuery.getComponentRequest(), tagInf); return; } } // New version constraints or new attributes were introduced that // invalidated the // current resolution. We need to invalidate what we have and make sure // its done // again. // resolution = null; children = noChildren; query = qualifiedQuery; invalidateRun = true; if (tagInfo != null) qualifiedQuery.getContext().addTagInfo(qualifiedQuery.getComponentRequest(), tagInf); }
private boolean versionRangePatternMatches(Version version) { if (versionRangeReq == null) return true; return versionRangeReq.isIncluded(version); }