Determine if the dependency name is equal in the given dependencies.

@param dependency a dependency to compare
@param nextDependency a dependency to compare
@return true if the name is equal in both dependencies; otherwise false
502487
private boolean namesAreEqual(Dependency dependency, Dependency nextDependency) {
        return dependency.getName() != null && dependency.getName().equals(nextDependency.getName());
    }
740482
boolean checkUnionEquivalenceHelper(UnionType that, EquivalenceMethod eqMethod, EqCache eqCache) {
    List<JSType> thatAlternates = that.getAlternates();
    if (eqMethod == EquivalenceMethod.IDENTITY && alternates.size() != thatAlternates.size()) {
      return false;
    }
    for (int i = 0; i < thatAlternates.size(); i++) {
      JSType thatAlternate = thatAlternates.get(i);
      if (!hasAlternate(thatAlternate, eqMethod, eqCache)) {
        return false;
      }
    }
    return true;
  }
851962
function next_dependency(){
		foreach( $this->dependencies as $path => $done ){
			if( ! $done ){
				$this->dependencies[$path] = 1;
				return $path;
			}
		}
		// none
		return null;
	}
897495
public CmsModuleDependency checkDependency(CmsModule module) {

        CmsModuleDependency otherDepdendency = new CmsModuleDependency(module.getName(), module.getVersion());

        // loop through all the dependencies
        for (int i = 0; i < m_dependencies.size(); i++) {
            CmsModuleDependency dependency = m_dependencies.get(i);
            if (dependency.dependesOn(otherDepdendency)) {
                // short circuit here
                return dependency;
            }
        }

        // no dependency was found
        return null;
    }
1188385
@Override
    public int compare(DependencyReportDependencyGroupModel o1, DependencyReportDependencyGroupModel o2)
    {
        String path1 = o1.getCanonicalProject().getName();;
        String path2 = o2.getCanonicalProject().getName();;
        return path1.compareTo(path2);
    }
1097637
@SuppressWarnings("ReferenceEquality")
    public synchronized void addRelatedDependency(Dependency dependency) {
        if (this == dependency) {
            LOGGER.warn("Attempted to add a circular reference - please post the log file to issue #172 here "
                    + "https://github.com/jeremylong/DependencyCheck/issues/172");
            LOGGER.debug("this: {}", this);
            LOGGER.debug("dependency: {}", dependency);
        } else if (!relatedDependencies.add(dependency)) {
            LOGGER.debug("Failed to add dependency, likely due to referencing the same file as another dependency in the set.");
            LOGGER.debug("this: {}", this);
            LOGGER.debug("dependency: {}", dependency);
        }
    }
241924
protected function checkDependency($dependencies = null)
    {
        $errors = array();

        if (is_null($dependencies)) $dependencies = array();

        $i = 0;
        $clean = true;
        foreach ($dependencies as $module => $version)
        {
            if ($module == $this->systemName)
            {
                if (!$this->sysVersionDependency($version))
                    $clean = false;

                continue;
            }

            $depModule = ModuleModel::where('module_name', $module)->first();
            if (!$depModule)
            {
                $this->errors->add("module_dependency_$i", "Module $module with version $version not installed");
                $clean = false;
            }
            else
            {
                $depVersion = $depModule->module_version;
                $needVersion = $version;

                $depVersion = new Version($depVersion);
                $needVersion = new Version($needVersion);

                if (!$depVersion->isPartOf($needVersion))
                {
                    $this->errors->add("module_dependency_$i", 'Module '.$module.' v'.$needVersion->getVersion().' must install, but '.$depVersion->getVersion().' installed.');
                    $clean = false;
                }
            }
            $i++;
        }

        if(!$clean)
            return false;

        return true;
    }
163421
DependencyInfo getDependencyInfo() {
    if (dependencyInfo == null) {
      dependencyInfo = generateDependencyInfo();
    }
    if (!extraRequires.isEmpty() || !extraProvides.isEmpty()) {
      dependencyInfo =
          SimpleDependencyInfo.builder(getName(), getName())
              .setProvides(concat(dependencyInfo.getProvides(), extraProvides))
              .setRequires(concat(dependencyInfo.getRequires(), extraRequires))
              .setTypeRequires(dependencyInfo.getTypeRequires())
              .setLoadFlags(dependencyInfo.getLoadFlags())
              .setHasExternsAnnotation(dependencyInfo.getHasExternsAnnotation())
              .setHasNoCompileAnnotation(dependencyInfo.getHasNoCompileAnnotation())
              .build();
      extraRequires.clear();
      extraProvides.clear();
    }
    return dependencyInfo;
  }
298412
@Override
    public boolean libraryExists(String libraryName)
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        String localePrefix = getLocalePrefixForLocateResource(facesContext);
        final List<String> contracts = facesContext.getResourceLibraryContracts(); 

        String pathToLib = null;
        Boolean libraryFound = null;
        if (libraryName != null && !ResourceValidationUtils.isValidLibraryName(
                libraryName, isAllowSlashesLibraryName()))
        {
            return false;
        }
        
        if (localePrefix != null)
        {
            //Check with locale
            pathToLib = localePrefix + '/' + libraryName;

            libraryFound = getResourceLoaderCache().libraryExists(pathToLib);
            if (libraryFound != null)
            {
                return libraryFound.booleanValue();
            }
        }
        libraryFound = getResourceLoaderCache().libraryExists(libraryName);
        if (libraryFound != null)
        {
            return libraryFound.booleanValue();
        }
        
        if (localePrefix != null)
        {
            if (!contracts.isEmpty())
            {
                for (String contract : contracts)
                {
                    for (ContractResourceLoader loader : getResourceHandlerSupport()
                            .getContractResourceLoaders())
                    {
                        if (loader.libraryExists(pathToLib, contract))
                        {
                            getResourceLoaderCache().confirmLibraryExists(pathToLib);
                            return true;
                        }
                    }
                }
            }
            
            for (ResourceLoader loader : getResourceHandlerSupport()
                    .getResourceLoaders())
            {
                if (loader.libraryExists(pathToLib))
                {
                    getResourceLoaderCache().confirmLibraryExists(pathToLib);
                    return true;
                }
            }            
        }

        //Check without locale
        if (!contracts.isEmpty())
        {
            for (String contract : contracts)
            {
                for (ContractResourceLoader loader : getResourceHandlerSupport()
                        .getContractResourceLoaders())
                {
                    if (loader.libraryExists(libraryName, contract))
                    {
                        getResourceLoaderCache().confirmLibraryExists(libraryName);
                        return true;
                    }
                }
            }
        }

        for (ResourceLoader loader : getResourceHandlerSupport()
                .getResourceLoaders())
        {
            if (loader.libraryExists(libraryName))
            {
                getResourceLoaderCache().confirmLibraryExists(libraryName);
                return true;
            }
        }

        if (localePrefix != null)
        {
            //Check with locale
            getResourceLoaderCache().confirmLibraryNotExists(pathToLib);
        }
        else
        {
            getResourceLoaderCache().confirmLibraryNotExists(libraryName);
        }
        return false;
    }
280307
public boolean equalTo(CFMLEngine other, final boolean checkReferenceEqualityOnly) {
	while (other instanceof CFMLEngineWrapper)
	    other = ((CFMLEngineWrapper) other).engine;
	if (checkReferenceEqualityOnly) return engine == other;
	return engine.equals(other);
    }
480923
public static boolean hasDependency(Model pom, String groupId, String artifactId) {
        if (pom != null) {
            List<org.apache.maven.model.Dependency> dependencies = pom.getDependencies();
            return hasDependency(dependencies, groupId, artifactId);
        }
        return false;
    }
161545
@Override
    public boolean accepts(final MavenDependency dependency, final List<MavenDependency> dependenciesForResolution,
            final List<MavenDependency> dependencyAncestors) {
        if (bannedDependencies.contains(dependency)) {
            return false;
        }

        if (rejectTransitives) {
            if (dependencyAncestors != null && dependencyAncestors.size() != 0) {
                return dependencyAncestors.get(0).equals(dependency);
            }
        }

        return true;
    }
565370
def check_dependency(self, operation, dependency):
        
        if isinstance(dependency[1], SQLBlob):
            # NOTE: we follow the sort order created by `assemble_changes` so we build a fixed chain
            # of operations. thus we should match exact operation here.
            return dependency[3] == operation
        return super(MigrationAutodetector, self).check_dependency(operation, dependency)
49221
public function andDependency(Dependency $dependency) {
        if ($dependency === $this)
            return $this;
        return ChainedDependency::create($this)->andDependency($dependency);
    }
155569
private boolean compareRelation(RCCConstraint first,
			RCCConstraint second) {
		
		boolean existed = false;
		for (int i = 0; i < first.types.length; i++) {
			existed = false;
			for (int j = 0; j < second.types.length; j++) {
				if(first.types[i] == second.types[j])
					existed = true;
			}
			if(!existed) return false;
		}
		
		return true;
	}
1267184
private void validateDepDefinitionUniqueness(final List<TriggerDependencyBean> dependencies) {
    for (int i = 0; i < dependencies.size(); i++) {
      for (int j = i + 1; j < dependencies.size(); j++) {
        final boolean duplicateDepDefFound =
            dependencies.get(i).getType().equals(dependencies.get(j)
                .getType()) && dependencies.get(i).getParams()
                .equals(dependencies.get(j).getParams());
        Preconditions.checkArgument(!duplicateDepDefFound, String.format("duplicate dependency"
                + "config %s found, dependency config should be unique",
            dependencies.get(i).getName()));
      }
    }
  }
67484
private void validateDepDefinitionUniqueness(final List<FlowTriggerDependency> dependencies) {
    final Set<String> seen = new HashSet<>();
    for (final FlowTriggerDependency dep : dependencies) {
      final Map<String, String> props = dep.getProps();
      // set.add() returns false when there exists duplicate
      Preconditions.checkArgument(seen.add(dep.getType() + ":" + props.toString()), String.format
          ("duplicate dependency config %s found, dependency config should be unique",
              dep.getName()));
    }
  }