Translate the given dependency tree in to an instance of {@link DeclaredDependencies}.
978221
public static DeclaredDependencies toDeclaredDependencies(Map<DependencyDescriptor, Set<DependencyDescriptor>> depMap) {
        DeclaredDependencies dependencies = new DeclaredDependencies();
        depMap.forEach((directDep, resolvedDeps) -> {
            ArtifactSpec parent = toArtifactSpec(directDep);
            dependencies.addResolved(parent);
            if (resolvedDeps != null) {
                resolvedDeps.forEach(d -> dependencies.addResolved(parent, toArtifactSpec(d)));
            }
        });
        return dependencies;
    }
276048
@Override
    public final RESOLVESTAGETYPE addDependencies(final MavenDependency... dependencies)
        throws IllegalArgumentException {
        if (dependencies == null || dependencies.length == 0) {
            throw new IllegalArgumentException("At least one coordinate must be specified");
        }
        for (final MavenDependency dependency : dependencies) {
            if (dependency == null) {
                throw new IllegalArgumentException("null dependency not permitted");
            }
            final MavenDependency resolved = this.resolveDependency(dependency);
            this.session.getDependenciesForResolution().add(resolved);
        }
        return this.covarientReturn();
    }
592708
@PublicAPI(usage = ACCESS)
    public Set<Dependency> getDirectDependenciesToSelf() {
        ImmutableSet.Builder<Dependency> result = ImmutableSet.builder();
        result.addAll(dependenciesFromAccesses(getAccessesToSelf()));
        result.addAll(inheritanceDependenciesToSelf());
        result.addAll(fieldDependenciesToSelf());
        result.addAll(returnTypeDependenciesToSelf());
        result.addAll(methodParameterDependenciesToSelf());
        result.addAll(throwsDeclarationDependenciesToSelf());
        result.addAll(constructorParameterDependenciesToSelf());
        return result.build();
    }
19434
public void addDependency(org.sonatype.aether.graph.Dependency aetherDep) {
        Artifact artifact = aetherDep.getArtifact();

        Dependency dependency = new Dependency();
        dependency.setGroupId( artifact.getGroupId() );
        dependency.setArtifactId( artifact.getArtifactId() );
        dependency.setType( artifact.getExtension() );
        dependency.setVersion( artifact.getVersion() );
        dependency.setScope( aetherDep.getScope() );
        addDependency( dependency );
    }
1353467
private void initializeDependentKeys() {
        visit(new Visitor<NodeT>() {
            @Override
            public void visitNode(NodeT node) {
                if (node.dependencyKeys().isEmpty()) {
                    return;
                }

                String dependentKey = node.key();
                for (String dependencyKey : node.dependencyKeys()) {
                    nodeTable.get(dependencyKey)
                            .addDependent(dependentKey);
                }
            }

            @Override
            public  void visitEdge(String fromKey, String toKey, EdgeType edgeType) {
                if (edgeType == EdgeType.BACK) {
                    throw new IllegalStateException("Detected circular dependency: " + findPath(fromKey, toKey));
                }
            }
        });
    }
903515
private static Set<DependencyDescriptor> getDependenciesTransitively(String scope, ResolvedDependency parent) {
        Stack<ResolvedDependency> stack = new Stack<>();
        stack.push(parent);
        Set<DependencyDescriptor> dependencies = new HashSet<>();
        while (!stack.empty()) {
            ResolvedDependency rd = stack.pop();
            // Skip the parent's artifacts.
            if (rd != parent) {
                rd.getModuleArtifacts().forEach(a -> dependencies.add(asDescriptor(scope, a)));
            }
            rd.getChildren().forEach(d -> {
                if (!stack.contains(d)) {
                    stack.add(d);
                }
            });
        }
        return dependencies;
    }
132962
@SuppressWarnings("OptionalGetWithoutIsPresent") // Previous validation ensures this is fine.
  private ImmutableList<FieldSpec> adapterDependenciesInternal(
      Collection<AdapterDescriptor> adapters, Set<TypeName> scoped) {

    ImmutableList.Builder<FieldSpec> adapterFields = new ImmutableList.Builder<>();
    for (AdapterDescriptor adapter : adapters) {
      // Don't define the same adapter twice
      if (scoped.contains(adapter.typeName())) {
        continue;
      }
      scoped.add(adapter.typeName());

      if (!adapter.singletonInstance().isPresent()) {
        ConstructorInfo constructorInfo = adapter.constructorInfo().get();

        // Add dependencies, then create and add the current adapter
        List<AdapterDescriptor> adapterDependencies = new ArrayList<>();
        for (ConstructorInfo.Param param : constructorInfo.constructorParameters()) {
          if (param instanceof ConstructorInfo.AdapterParam) {
            adapterDependencies.add(((ConstructorInfo.AdapterParam) param).adapter);
          }
        }
        if (adapterDependencies.size() > 0) {
          adapterFields.addAll(adapterDependenciesInternal(adapterDependencies, scoped));
        }

        // Construct the single instance of this type adapter
        String adapterName = adapterNames.getName(adapter.typeName());
        CodeBlock parameters = getAdapterParameterList(constructorInfo);
        ParameterizedTypeName adapterInterfaceType =
            ParameterizedTypeName.get(TYPE_ADAPTER, adapter.adaptedTypeName());

        adapterFields.add(
            FieldSpec.builder(adapterInterfaceType, adapterName, STATIC, FINAL)
                .initializer(CodeBlock.of("new $T($L)", adapter.typeName(), parameters))
                .build());
      }
    }

    return adapterFields.build();
  }
490658
public static void addDependency(Dependency depend,
                                   ClassLoader loader)
  {
    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
        ((EnvironmentClassLoader) loader).addDependency(depend);
        return;
      }
    }
  }
1318139
@Override
	public void process(Node externs, Node root) {
		this.expandedDepsList.clear();
		List<DependencyList> enclosingDependencies = new LinkedList<DependencyList>();
		try {
			processChildren(root, enclosingDependencies);
		} catch (ProcessingDependenciesException e) {
			throw new RuntimeProcessingDependenciesException(e);
		} catch (DependencyVerificationException e) {
			throw new RuntimeDependencyVerificationException(e);
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		appendConsoleLogging(root);
	}
126260
@Override
    public UNEQUIPPEDRESOLVESTAGETYPE addDependencies(Collection<MavenDependency> dependencies)
        throws IllegalArgumentException {
        return delegate.addDependencies(dependencies);
    }
241467
public static List<DependencyInfo> readDependencies(InputStream in) throws IOException {
        try (InputStreamReader inputStreamReader = new InputStreamReader(in, UTF_8);
             BufferedReader br = new BufferedReader(inputStreamReader);
             JsonReader reader = new JsonReader(br)) {
            return getDependencies(reader);
        } catch (IOException ex) {
            logger.error("Failed to read dependencies: {}", ex.getMessage());
        }
        return null;
    }
567525
public static DependencyIdentifier getDependencyIdentifierForClass(Field field, SortedSet<String> qualifiers) {
        List<Type> typeList = new ArrayList<Type>();
        addTypeToList(field.getGenericType(), typeList);
        return new DependencyIdentifier(typeList, qualifiers);
    }
1108269
public static Collection<List<String>> untypedDependencyObjectify(Tree t, HeadFinder hf, TreeTransformer collinizer) {
    return dependencyObjectify(t, hf, collinizer, new UntypedDependencyTyper(hf));
  }
403237
async function buildDirectDependentTree() {
  const dependents = new Map();

  for (const packageName of await _list()) {
    dependents.set(packageName, new Set());
  }

  for (const packageName of await _list()) {
    for (const dep of tree.get(packageName)) {
      dependents.get(dep).add(packageName);
    }
  }

  return dependents;
}
1317283
public void buildDependencyGraph(AbstractProject owner,DependencyGraph graph) {
        for (Object o : this) {
            if (o instanceof DependencyDeclarer) {
                DependencyDeclarer dd = (DependencyDeclarer) o;
                try {
                    dd.buildDependencyGraph(owner,graph);
                } catch (RuntimeException e) {
                    LOGGER.log(Level.SEVERE, "Failed to build dependency graph for " + owner,e);
                }
            }
        }
    }
1249899
protected static function initDependencyInjection()
    {
        // Get required dependency container for annotations!
        include_once DOOZR_DOCUMENT_ROOT.'Doozr/Di/Map/Annotation.php';
        include_once DOOZR_DOCUMENT_ROOT.'Doozr/Di/Parser/Annotation.php';
        include_once DOOZR_DOCUMENT_ROOT.'Doozr/Di/Dependency.php';

        $collection = new Doozr_Di_Collection();
        $parser     = new Doozr_Di_Parser_Annotation();
        $dependency = new Doozr_Di_Dependency();

        self::$map = new Doozr_Di_Map_Annotation($collection, $parser, $dependency);

        #self::$container = Doozr_Di_Container::getInstance();
        #self::$container->setFactory(new Doozr_Di_Factory(self::$registry));
    }
176969
private List<MavenDependencyDescriptor> addManagedDependencies(MavenDependentDescriptor pomDescriptor, DependencyManagement dependencyManagement,
            ScannerContext scannerContext, Class<? extends AbstractDependencyDescriptor> relationClass) {
        if (dependencyManagement == null) {
            return Collections.emptyList();
        }
        List<Dependency> dependencies = dependencyManagement.getDependencies();
        return getDependencies(pomDescriptor, dependencies, relationClass, scannerContext);
    }