Find all conflicts found between two selection sets.

       Includes those found via spreading in fragments. Called when determining if conflicts exist
       between the sub-fields of two overlapping fields.
426202
def _find_conflicts_between_sub_selection_sets(
    context,  # type: ValidationContext
    cached_fields_and_fragment_names,  # type: Dict[SelectionSet, Tuple[Dict[str, List[Tuple[Union[GraphQLInterfaceType, GraphQLObjectType, None], Field, GraphQLField]]], List[str]]]
    compared_fragments,  # type: PairSet
    are_mutually_exclusive,  # type: bool
    parent_type1,  # type: Union[GraphQLInterfaceType, GraphQLObjectType, None]
    selection_set1,  # type: SelectionSet
    parent_type2,  # type: Union[GraphQLInterfaceType, GraphQLObjectType, None]
    selection_set2,  # type: SelectionSet
):
    # type: (...) ->  List[Tuple[Tuple[str, str], List[Node], List[Node]]]
    
    conflicts = []  # type: List[Tuple[Tuple[str, str], List[Node], List[Node]]]

    field_map1, fragment_names1 = _get_fields_and_fragments_names(
        context, cached_fields_and_fragment_names, parent_type1, selection_set1
    )

    field_map2, fragment_names2 = _get_fields_and_fragments_names(
        context, cached_fields_and_fragment_names, parent_type2, selection_set2
    )

    # (H) First, collect all conflicts between these two collections of field.
    _collect_conflicts_between(
        context,
        conflicts,
        cached_fields_and_fragment_names,
        compared_fragments,
        are_mutually_exclusive,
        field_map1,
        field_map2,
    )

    # (I) Then collect conflicts between the first collection of fields and
    # those referenced by each fragment name associated with the second.
    for fragment_name2 in fragment_names2:
        _collect_conflicts_between_fields_and_fragment(
            context,
            conflicts,
            cached_fields_and_fragment_names,
            compared_fragments,
            are_mutually_exclusive,
            field_map1,
            fragment_name2,
        )

    # (I) Then collect conflicts between the second collection of fields and
    #  those referenced by each fragment name associated with the first.
    for fragment_name1 in fragment_names1:
        _collect_conflicts_between_fields_and_fragment(
            context,
            conflicts,
            cached_fields_and_fragment_names,
            compared_fragments,
            are_mutually_exclusive,
            field_map2,
            fragment_name1,
        )

    # (J) Also collect conflicts between any fragment names by the first and
    # fragment names by the second. This compares each item in the first set of
    # names to each item in the second set of names.
    for fragment_name1 in fragment_names1:
        for fragment_name2 in fragment_names2:
            _collect_conflicts_between_fragments(
                context,
                conflicts,
                cached_fields_and_fragment_names,
                compared_fragments,
                are_mutually_exclusive,
                fragment_name1,
                fragment_name2,
            )

    return conflicts
1255711
def subfield_conflicts(
    conflicts: List[Conflict], response_name: str, node1: FieldNode, node2: FieldNode
) -> Optional[Conflict]:
    
    if conflicts:
        return (
            (response_name, [conflict[0] for conflict in conflicts]),
            list(chain([node1], *[conflict[1] for conflict in conflicts])),
            list(chain([node2], *[conflict[2] for conflict in conflicts])),
        )
    return None
707725
public static boolean overlaps(List<ByteBuffer> minColumnNames1, List<ByteBuffer> maxColumnNames1, List<ByteBuffer> minColumnNames2, List<ByteBuffer> maxColumnNames2, CellNameType comparator)
    {
        if (minColumnNames1.isEmpty() || maxColumnNames1.isEmpty() || minColumnNames2.isEmpty() || maxColumnNames2.isEmpty())
            return true;

        return !(compare(maxColumnNames1, minColumnNames2, comparator) < 0 || compare(minColumnNames1, maxColumnNames2, comparator) > 0);
    }
1267936
private boolean handleOverridesAndConflicts(JvmOperation operation, Multimap<String, AbstractResolvedOperation> processedOperations) {
		String simpleName = operation.getSimpleName();
		if (!processedOperations.containsKey(simpleName)) {
			return true;
		}
		List<AbstractResolvedOperation> conflictingOperations = null;
		for (AbstractResolvedOperation candidate : processedOperations.get(simpleName)) {
			OverrideTester overrideTester = candidate.getOverrideTester();
			IOverrideCheckResult checkResult = overrideTester.isSubsignature(candidate, operation, false);
			if (checkResult.getDetails().contains(OverrideCheckDetails.DEFAULT_IMPL_CONFLICT)) {
				// The current operation conflicts with the candidate
				if (conflictingOperations == null)
					conflictingOperations = Lists.newLinkedList();
				conflictingOperations.add(candidate);
			} else if (checkResult.isOverridingOrImplementing()) {
				return false;
			}
		}
		if (conflictingOperations != null) {
			if (conflictingOperations.size() == 1 && conflictingOperations.get(0) instanceof ConflictingDefaultOperation) {
				// The current operation contributes to the already existing conflict
				ConflictingDefaultOperation conflictingDefaultOperation = (ConflictingDefaultOperation) conflictingOperations.get(0);
				boolean isOverridden = false;
				for (IResolvedOperation conflictingOp : conflictingDefaultOperation.getConflictingOperations()) {
					if (conflictingOp.getResolvedDeclarator().isSubtypeOf(operation.getDeclaringType())) {
						isOverridden = true;
						break;
					}
				}
				if (!isOverridden)
					conflictingDefaultOperation.getConflictingOperations().add(createResolvedOperation(operation));
				return false;
			}
			// A new conflict of default implementations was found
			if (operation.isAbstract()) {
				ConflictingDefaultOperation resolvedOperation = createConflictingOperation(conflictingOperations.get(0).getDeclaration());
				resolvedOperation.getConflictingOperations().add(createResolvedOperation(operation));
				for (AbstractResolvedOperation conflictingOp : conflictingOperations) {
					processedOperations.remove(simpleName, conflictingOp);
					if (conflictingOp.getDeclaration() != resolvedOperation.getDeclaration()) {
						resolvedOperation.getConflictingOperations().add(conflictingOp);
					}
				}
				processedOperations.put(simpleName, resolvedOperation);
			} else {
				ConflictingDefaultOperation resolvedOperation = createConflictingOperation(operation);
				for (AbstractResolvedOperation conflictingOp : conflictingOperations) {
					processedOperations.remove(simpleName, conflictingOp);
					resolvedOperation.getConflictingOperations().add(conflictingOp);
				}
				processedOperations.put(simpleName, resolvedOperation);
			}
			return false;
		}
		return true;
	}
522319
def overlapping(self, other):
        """"""
        return (
            other.start in self.ref_range) or (
            self.start in other.ref_range)
20601
private void checkPossibleIslandsForRightOverlap(List<Island> possibleIslands) {
        Iterator<Island> candidates = possibleIslands.iterator();
        while (candidates.hasNext()) {
            Island island = candidates.next();
            // check whether there is complete overlap
            // if left end coordinate is not available there is no use in checking this island any longer
            if (doesCoordinateOverlapWithCommittedCoordinate(island.getLeftEnd())) {
                candidates.remove();
                continue;
            }
            // if right end coordinate is also available it means the whole island is available
            if (!doesCoordinateOverlapWithCommittedCoordinate(island.getRightEnd())) {
                // no further check necessary
                continue;
            }
            // remove this candidate from the possible islands
            candidates.remove();
            // partial overlap; find the starting point of the conflict
            Island smaller = findConflictingCoordinateAndCreateSmallerIslandSplitAtConflictingCoordinate(island);
            // add the smaller island to the priority queue
            // LOG.fine("Conflict detected! We add a smaller island! "+smaller);
            islandPriorityQueue.add(smaller);
        }
    }
88547
func (rule *overlappingFieldsCanBeMergedRule) findConflictsBetweenSubSelectionSets(areMutuallyExclusive bool, parentType1 Named, selectionSet1 *ast.SelectionSet, parentType2 Named, selectionSet2 *ast.SelectionSet) []conflict {
	conflicts := []conflict{}

	fieldsInfo1 := rule.getFieldsAndFragmentNames(parentType1, selectionSet1)
	fieldsInfo2 := rule.getFieldsAndFragmentNames(parentType2, selectionSet2)

	// (H) First, collect all conflicts between these two collections of field.
	conflicts = rule.collectConflictsBetween(conflicts, areMutuallyExclusive, fieldsInfo1, fieldsInfo2)

	// (I) Then collect conflicts between the first collection of fields and
	// those referenced by each fragment name associated with the second.
	for _, fragmentName2 := range fieldsInfo2.fragmentNames {
		conflicts = rule.collectConflictsBetweenFieldsAndFragment(conflicts, areMutuallyExclusive, fieldsInfo1, fragmentName2)
	}

	// (I) Then collect conflicts between the second collection of fields and
	// those referenced by each fragment name associated with the first.
	for _, fragmentName1 := range fieldsInfo1.fragmentNames {
		conflicts = rule.collectConflictsBetweenFieldsAndFragment(conflicts, areMutuallyExclusive, fieldsInfo2, fragmentName1)
	}

	// (J) Also collect conflicts between any fragment names by the first and
	// fragment names by the second. This compares each item in the first set of
	// names to each item in the second set of names.
	for _, fragmentName1 := range fieldsInfo1.fragmentNames {
		for _, fragmentName2 := range fieldsInfo2.fragmentNames {
			conflicts = rule.collectConflictsBetweenFragments(conflicts, areMutuallyExclusive, fragmentName1, fragmentName2)
		}
	}
	return conflicts
}
402222
public final boolean overlaps(HString other) {
      if (other == null) {
         return false;
      }
      return (document() != null && other.document() != null) &&
                (document() == other.document()) &&
                super.overlaps(other);
   }
247656
private static boolean confirmNoFileConflicts(Set<UpdatedFile> updatedFiles1, Set<UpdatedFile> updatedFiles2) {

        for (Iterator<UpdatedFile> iter1 = updatedFiles1.iterator(); iter1.hasNext();) {
            UpdatedFile currFile1 = iter1.next();
            for (Iterator<UpdatedFile> iter2 = updatedFiles2.iterator(); iter2.hasNext();) {
                UpdatedFile currFile2 = iter2.next();
                if (currFile1.getId().equals(currFile2.getId())) {
                    return false;
                }
            }
        }
        return true;
    }
159186
def conflicts_with(self, section):
        ""
        for p in section.periods:
            t = (p.int_days, p.start, p.end)
            if t in self:
                return True
        return False
138734
protected function subfieldConflicts(
        array $conflicts,
        string $responseName,
        FieldNode $nodeA,
        FieldNode $nodeB
    ): ?Conflict {
        if (empty($conflicts)) {
            return null;
        }

        return new Conflict(
            $responseName,
            array_map(function (Conflict $conflict) {
                return [$conflict->getResponseName(), $conflict->getReason()];
            }, $conflicts),
            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
                return array_merge($allFields, $conflict->getFieldsA());
            }, [$nodeA]),
            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
                return array_merge($allFields, $conflict->getFieldsB());
            }, [$nodeB])
        );
    }
1012438
private void check(MappingNode tree, MappingNode parent, String prefix) {
        MappingNode child = parent.getLeftMostChild();
        MappingNode sibling = null;
        while (child != null) {
            if (sibling != null) {
                if (child.compareTo(sibling) == 0) {
                    logger.error("mapping conflicts: '" + child.getMapping().getDefinition()
                            + "' conflicts with '" + sibling.getMapping().getDefinition()
                            + "' in '" + prefix + "'; here is the mapping tree, "
                            + "you can find the conflict in it:\n" + PrinteHelper.list(tree));
                    throw new IllegalArgumentException("mapping conflicts: '"
                            + child.getMapping().getDefinition() + "' conflicts with '"
                            + sibling.getMapping().getDefinition() + "' in '" + prefix + "'");
                }
            }
            check(tree, child, prefix + child.getMapping().getDefinition());
            sibling = child;
            child = child.getSibling();
        }

    }
156910
func (rule *overlappingFieldsCanBeMergedRule) collectConflictsBetweenFieldsAndFragment(conflicts []conflict, areMutuallyExclusive bool, fieldsInfo *fieldsAndFragmentNames, fragmentName string) []conflict {
	fragment := rule.context.Fragment(fragmentName)
	if fragment == nil {
		return conflicts
	}

	fieldsInfo2 := rule.getReferencedFieldsAndFragmentNames(fragment)

	// (D) First collect any conflicts between the provided collection of fields
	// and the collection of fields represented by the given fragment.
	conflicts = rule.collectConflictsBetween(conflicts, areMutuallyExclusive, fieldsInfo, fieldsInfo2)

	// (E) Then collect any conflicts between the provided collection of fields
	// and any fragment names found in the given fragment.
	for _, fragmentName2 := range fieldsInfo2.fragmentNames {
		conflicts = rule.collectConflictsBetweenFieldsAndFragment(conflicts, areMutuallyExclusive, fieldsInfo2, fragmentName2)
	}

	return conflicts

}
1196403
def check_overlap(current, hit, overlap = 200):
    
    for prev in current:
        p_coords = prev[2:4]
        coords = hit[2:4]
        if get_overlap(coords, p_coords) >= overlap:
            return True
    return False
677370
private static void updateCheckConflict(
            Map<TemporalField, Long> fieldValues,
            TemporalField targetField,
            TemporalField changeField,
            long changeValue) {
        
        Long old = fieldValues.put(changeField, changeValue);
        if (old != null && changeValue != old.longValue()) {
            throw new DateTimeException(
                    "Conflict found: " + changeField + " " + old +
                    " differs from " + changeField + " " + changeValue +
                    " while resolving  " + targetField);
        }
    }
582013
def _pred_sets_are_in_conflict(pred_set_a, pred_set_b):
    
    # pred_sets conflict if we cannot find one shared predicate that is "negated" in one
    # and "non-negated" in the other
    for pred_a, bool_a in pred_set_a:
        for pred_b, bool_b in pred_set_b:
            if pred_a is pred_b and bool_a != bool_b:
                return False
    return True
535997
def conflicts_with(self, other):
        """"""
        if isinstance(other, Requirement):
            if (self.name_ != other.name_) or (self.range is None) \
                    or (other.range is None):
                return False
            elif self.conflict:
                return False if other.conflict \
                    else self.range_.issuperset(other.range_)
            elif other.conflict:
                return other.range_.issuperset(self.range_)
            else:
                return not self.range_.intersects(other.range_)
        else:  # VersionedObject
            if (self.name_ != other.name_) or (self.range is None):
                return False
            if self.conflict:
                return (other.version_ in self.range_)
            else:
                return (other.version_ not in self.range_)