return conflicts;
}
VersionMatcher versionMatcher = getSettings().getVersionMatcher();
Iterator iter = conflicts.iterator();
IvyNode node = (IvyNode) iter.next();
ModuleRevisionId mrid = node.getResolvedId();
if (versionMatcher.isDynamic(mrid)) {
while (iter.hasNext()) {
IvyNode other = (IvyNode) iter.next();
if (versionMatcher.isDynamic(other.getResolvedId())) {
// two dynamic versions in conflict, not enough information yet
return null;
} else if (!versionMatcher.accept(mrid, other.getResolvedId())) {
// incompatibility found
if (!handleIncompatibleConflict(parent, conflicts, node, other)) {
return null;
}
}
}
// no incompatibility nor dynamic version found, let's return the latest static version
if (conflicts.size() == 2) {
// very common special case of only two modules in conflict,
// let's return the second one (static)
Iterator it = conflicts.iterator();
it.next();
return Collections.singleton(it.next());
}
Collection newConflicts = new LinkedHashSet(conflicts);
newConflicts.remove(node);
return super.resolveConflicts(parent, newConflicts);
} else {
// the first node is a static revision, let's see if all other versions match
while (iter.hasNext()) {
IvyNode other = (IvyNode) iter.next();
if (!versionMatcher.accept(other.getResolvedId(), mrid)) {
// incompatibility found
if (!handleIncompatibleConflict(parent, conflicts, node, other)) {
return null;
}
}