private static void resolve(Dependency[] deps, Map<PackageId, Dependency[]> list, Map<PackageId, Boolean> result) throws CyclicDependencyException { // find the dep in the list for (Dependency dep: deps) { for (Map.Entry<PackageId, Dependency[]> entry: list.entrySet()) { PackageId id = entry.getKey(); if (dep.matches(id)) { Boolean res = result.get(id); if (res != null && !res) { log.error("Package dependencies cause cycle."); throw new CyclicDependencyException(); } else if (res == null) { result.put(id, res = false); } resolve(entry.getValue(), list, result); // shove at the end of the list if not resolved if (!res) { result.remove(id); result.put(id, true); } } } } }
private void resolveUninstall(PackageId id, List<PackageTask> packageTasks, Map<PackageId, PackageTask> uninstallTasks, Set<PackageId> resolved) throws IOException, PackageException { if (resolved.contains(id)) { throw new CyclicDependencyException("Package has cyclic dependencies: " + id);
throw new CyclicDependencyException(msg);
private void resolveInstall(PackageId id, List<PackageTask> packageTasks, Map<PackageId, PackageTask> installTasks, Set<PackageId> resolved, PackageTask.Type type) throws IOException, PackageException { if (resolved.contains(id)) { throw new CyclicDependencyException("Package has cyclic dependencies: " + id);