Detects conflict but does not resolve it.

@param siblings the list of siblings returned from Riak
@return null or the single value in the collection
@throws UnresolvedConflictException if {@code siblings} has > 1 entry.
763125
@Override
    public T resolve(List<T> siblings) throws UnresolvedConflictException
    {
        if (siblings.size() > 1)
        {
            throw new UnresolvedConflictException("Siblings found", siblings);
        }
        else if (siblings.size() == 1)
        {
            return siblings.get(0);
        }
        else
        {
            return null;
        }
    }
946285
public static boolean isResolved(Type type) {
    if (type instanceof GenericArrayType) {
      return isResolved(((GenericArrayType) type).getGenericComponentType());
    }
    if (type instanceof ParameterizedType) {
      for (Type t : ((ParameterizedType) type).getActualTypeArguments()) {
        if (!isResolved(t)) {
          return false;
        }
      }
      return true;
    }
    return type instanceof Class;
  }
1320419
@NonNull
	public static ResolvedTypeWithMembers resolveMembers(@NonNull Type type, @NonNull Type... typeParameters)
	{
		ResolvedType rt = typeResolver.resolve(type, typeParameters);
		return memberResolver.resolve(rt, null, null);
	}
128418
private function hasNameConflict(NodeInterface $parentNode, $name, NodeInterface $forNode = null)
    {
        return $parentNode->hasNode($name) && (!$forNode || $parentNode->getNode($name) !== $forNode);
    }
1073002
private static boolean hasConflictingClassName(DescriptorProto messageDesc, String name) {
    if (name.equals(messageDesc.getName())) {
      return true;
    }
    for (EnumDescriptorProto enumDesc : messageDesc.getEnumTypeList()) {
      if (name.equals(enumDesc.getName())) {
        return true;
      }
    }
    for (DescriptorProto nestedMessageDesc : messageDesc.getNestedTypeList()) {
      if (hasConflictingClassName(nestedMessageDesc, name)) {
        return true;
      }
    }
    return false;
  }
501574
public Element lastElementSibling() {
        List<Element> siblings = parent().childElementsList();
        return siblings.size() > 1 ? siblings.get(siblings.size() - 1) : null;
    }
580132
private void resolveStrongestMappingConflicts(INode source, List<IMappingElement<INode>> strongest) {
        //copy the relations to a string to log it
        int strongestIndex = -1;
        String sourceString = source.getNodeData().getName().trim();

        if (log.isEnabledFor(Level.DEBUG)) {
            StringBuilder strongRelations = new StringBuilder();
            for (IMappingElement<INode> aStrongest : strongest) {
                strongRelations.append(aStrongest.getTarget().toString()).append("|");
            }

            log.debug("More than one strongest relation for " + sourceString + ": |" + strongRelations.toString());
        }

        //looks the first related node that is equal to the source node
        for (int i = 0; i < strongest.size(); i++) {
            String strongString = strongest.get(i).getTarget().getNodeData().getName().trim();
            if (sourceString.equalsIgnoreCase(strongString)) {
                strongestIndex = i;
                break;
            }
        }

        //if there was no equal string, then set it to the first one
        if (strongestIndex == -1) {
            strongestIndex = 0;
        }

        if (strongest.get(strongestIndex).getRelation() != IMappingElement.IDK) {
            spsmMapping.add(strongest.get(strongestIndex));

            // Remove the relations from the same column and row
            deleteRemainingRelationsFromMatrix(strongest.get(strongestIndex));
        }
    }
1191881
def collect_conflicts_within(
    context: ValidationContext,
    conflicts: List[Conflict],
    cached_fields_and_fragment_names: Dict,
    compared_fragment_pairs: "PairSet",
    field_map: NodeAndDefCollection,
) -> None:
    """"""
    # A field map is a keyed collection, where each key represents a response name and
    # the value at that key is a list of all fields which provide that response name.
    # For every response name, if there are multiple fields, they must be compared to
    # find a potential conflict.
    for response_name, fields in field_map.items():
        # This compares every field in the list to every other field in this list
        # (except to itself). If the list only has one item, nothing needs to be
        # compared.
        if len(fields) > 1:
            for i, field in enumerate(fields):
                for other_field in fields[i + 1 :]:
                    conflict = find_conflict(
                        context,
                        cached_fields_and_fragment_names,
                        compared_fragment_pairs,
                        # within one collection is never mutually exclusive
                        False,
                        response_name,
                        field,
                        other_field,
                    )
                    if conflict:
                        conflicts.append(conflict)
40649
function siblings(node) {
  if (node && node.parentNode) {
    var n = node.parentNode.firstChild;
    var matched = [];

    for (; n; n = n.nextSibling) {
      if (n.nodeType === 1 && n !== node) {
        matched.push(n);
      }
    }

    return matched;
  }

  return [];
}
331524
public List<T> resolveConflicts(List<T> values) {
        if(values.size() > 1)
            return values;
        else
            return Collections.singletonList(values.get(0));
    }
96961
func (rule *overlappingFieldsCanBeMergedRule) findConflictsWithinSelectionSet(parentType Named, selectionSet *ast.SelectionSet) []conflict {
	conflicts := []conflict{}

	fieldsInfo := rule.getFieldsAndFragmentNames(parentType, selectionSet)

	// (A) Find find all conflicts "within" the fields of this selection set.
	// Note: this is the *only place* `collectConflictsWithin` is called.
	conflicts = rule.collectConflictsWithin(conflicts, fieldsInfo)

	// (B) Then collect conflicts between these fields and those represented by
	// each spread fragment name found.
	for i := 0; i < len(fieldsInfo.fragmentNames); i++ {

		conflicts = rule.collectConflictsBetweenFieldsAndFragment(conflicts, false, fieldsInfo, fieldsInfo.fragmentNames[i])

		// (C) Then compare this fragment with all other fragments found in this
		// selection set to collect conflicts between fragments spread together.
		// This compares each item in the list of fragment names to every other item
		// in that same list (except for itself).
		for k := i + 1; k < len(fieldsInfo.fragmentNames); k++ {
			conflicts = rule.collectConflictsBetweenFragments(conflicts, false, fieldsInfo.fragmentNames[i], fieldsInfo.fragmentNames[k])
		}
	}
	return conflicts
}
418407
private boolean isIntroducingFixedConflict(Sudoku sudoku,
                                               int row,
                                               int fromIndex,
                                               int toIndex)
    {
        return columnFixedValues[fromIndex][sudoku.getValue(row, toIndex) - 1]
               || columnFixedValues[toIndex][sudoku.getValue(row, fromIndex) - 1]
               || subGridFixedValues[convertToSubGrid(row, fromIndex)][sudoku.getValue(row, toIndex) - 1]
               || subGridFixedValues[convertToSubGrid(row, toIndex)][sudoku.getValue(row, fromIndex) - 1];
    }
870078
def on_conflict(self, pair):
        """"""
        # self._log_action("skip", "conflict", "!", pair.local, min_level=2)
        # print("on_conflict", pair)
        any_entry = pair.any_entry
        if not self._test_match_or_print(any_entry):
            return

        resolve = self._interactive_resolve(pair)

        if resolve == "skip":
            self._log_action("skip", "conflict", "*?*", any_entry)
            self._inc_stat("conflict_files_skipped")
            return

        if pair.local and pair.remote:
            assert pair.local.is_file()
            is_newer = pair.local > pair.remote
            if (
                resolve == "local"
                or (is_newer and resolve == "new")
                or (not is_newer and resolve == "old")
            ):
                self._log_action("copy", "conflict", "*>*", pair.local)
                self._copy_file(self.local, self.remote, pair.local)
            elif (
                resolve == "remote"
                or (is_newer and resolve == "old")
                or (not is_newer and resolve == "new")
            ):
                self._log_action("copy", "conflict", "*<*", pair.local)
                self._copy_file(self.remote, self.local, pair.remote)
            else:
                raise NotImplementedError
        elif pair.local:
            assert pair.local.is_file()
            if resolve == "local":
                self._log_action("restore", "conflict", "*>x", pair.local)
                self._copy_file(self.local, self.remote, pair.local)
            elif resolve == "remote":
                self._log_action("delete", "conflict", "*<x", pair.local)
                self._remove_file(pair.local)
            else:
                raise NotImplementedError
        else:
            assert pair.remote.is_file()
            if resolve == "local":
                self._log_action("delete", "conflict", "x>*", pair.remote)
                self._remove_file(pair.remote)
            elif resolve == "remote":
                self._log_action("restore", "conflict", "x<*", pair.remote)
                self._copy_file(self.remote, self.local, pair.remote)
            else:
                raise NotImplementedError
        return
288077
private static final int siblingIndex(Element element) {

        // The document element has index 0
        if (element.getParentNode() == element.getOwnerDocument())
            return 0;

        // All other elements are compared with siblings with the same name
        // TODO: How to deal with namespaces here? Omit or keep?
        else
            return $(element).parent().children(JOOX.tag(element.getTagName(), false)).get().indexOf(element);
    }
654099
protected final boolean mergeLists(List<UnclosedBranchDescriptor> child1open,
										List<UnclosedBranchDescriptor> child2open,
										List<UnclosedBranchDescriptor> result,
										boolean markJoinedBranchesAsPipelineBreaking) {

		//remove branches which have already been closed
		removeClosedBranches(child1open);
		removeClosedBranches(child2open);
		
		result.clear();
		
		// check how many open branches we have. the cases:
		// 1) if both are null or empty, the result is null
		// 2) if one side is null (or empty), the result is the other side.
		// 3) both are set, then we need to merge.
		if (child1open == null || child1open.isEmpty()) {
			if(child2open != null && !child2open.isEmpty()) {
				result.addAll(child2open);
			}
			return false;
		}
		
		if (child2open == null || child2open.isEmpty()) {
			result.addAll(child1open);
			return false;
		}

		int index1 = child1open.size() - 1;
		int index2 = child2open.size() - 1;
		
		boolean didCloseABranch = false;

		// as both lists (child1open and child2open) are sorted in ascending ID order
		// we can do a merge-join-like loop which preserved the order in the result list
		// and eliminates duplicates
		while (index1 >= 0 || index2 >= 0) {
			int id1 = -1;
			int id2 = index2 >= 0 ? child2open.get(index2).getBranchingNode().getId() : -1;

			while (index1 >= 0 && (id1 = child1open.get(index1).getBranchingNode().getId()) > id2) {
				result.add(child1open.get(index1));
				index1--;
			}
			while (index2 >= 0 && (id2 = child2open.get(index2).getBranchingNode().getId()) > id1) {
				result.add(child2open.get(index2));
				index2--;
			}

			// match: they share a common branching child
			if (id1 == id2) {
				didCloseABranch = true;
				
				// if this is the latest common child, remember it
				OptimizerNode currBanchingNode = child1open.get(index1).getBranchingNode();
				
				long vector1 = child1open.get(index1).getJoinedPathsVector();
				long vector2 = child2open.get(index2).getJoinedPathsVector();
				
				// check if this is the same descriptor, (meaning that it contains the same paths)
				// if it is the same, add it only once, otherwise process the join of the paths
				if (vector1 == vector2) {
					result.add(child1open.get(index1));
				}
				else {
					// we merge (re-join) a branch

					// mark the branch as a point where we break the pipeline
					if (markJoinedBranchesAsPipelineBreaking) {
						currBanchingNode.markAllOutgoingConnectionsAsPipelineBreaking();
					}

					if (this.hereJoinedBranches == null) {
						this.hereJoinedBranches = new ArrayList<OptimizerNode>(2);
					}
					this.hereJoinedBranches.add(currBanchingNode);

					// see, if this node closes the branch
					long joinedInputs = vector1 | vector2;

					// this is 2^size - 1, which is all bits set at positions 0..size-1
					long allInputs = (0x1L << currBanchingNode.getOutgoingConnections().size()) - 1;

					if (joinedInputs == allInputs) {
						// closed - we can remove it from the stack
						addClosedBranch(currBanchingNode);
					} else {
						// not quite closed
						result.add(new UnclosedBranchDescriptor(currBanchingNode, joinedInputs));
					}
				}

				index1--;
				index2--;
			}
		}

		// merged. now we need to reverse the list, because we added the elements in reverse order
		Collections.reverse(result);
		return didCloseABranch;
	}
160213
protected final void resolveChildrenForTable(Table table) {
        if (m_left != null) {
            m_left.resolveForTable(table);
        }
        if (m_right != null) {
            m_right.resolveForTable(table);
        }
        if (m_args != null) {
            for (AbstractExpression argument : m_args) {
                argument.resolveForTable(table);
            }
        }
    }
455743
@Override
    public STRATEGYSTAGETYPE resolve(final Collection<String> canonicalForms) throws IllegalArgumentException,
        ResolutionException, CoordinateParseException {
        if (canonicalForms == null) {
            throw new IllegalArgumentException("canonical forms must be provided");
        }
        for (final String canonicalForm : canonicalForms) {
            final MavenDependency dep = this.resolveDependency(canonicalForm);
            this.addDependency(dep);
        }
        return this.resolve();
    }