@Test public void testFindConflicts() { List<DependencyPath> conflicts = graph.findConflicts(); Truth.assertThat(conflicts).containsExactly(path3, path4, path5); }
List<DependencyPath> findConflicts() { List<DependencyPath> result = new ArrayList<>(); for (String coordinates : versions.keySet()) { Set<String> artifactVersions = versions.get(coordinates); if (artifactVersions.size() > 1) { for (String conflictingVersion : artifactVersions) { result.addAll(paths.get(coordinates + ":" + conflictingVersion)); } } } return result; }
DependencyGraph { List<DependencyPath> findConflicts() { List<DependencyPath> result = new ArrayList<>(); for (String coordinates : versions.keySet()) { Set<String> artifactVersions = versions.get(coordinates); if (artifactVersions.size() > 1) { for (String conflictingVersion : artifactVersions) { result.addAll(paths.get(coordinates + ":" + conflictingVersion)); } } } return result; } }
DependencyGraph { List<DependencyPath> findConflicts() { List<DependencyPath> result = new ArrayList<>(); for (String coordinates : versions.keySet()) { Set<String> artifactVersions = versions.get(coordinates); if (artifactVersions.size() > 1) { for (String conflictingVersion : artifactVersions) { result.addAll(paths.get(coordinates + ":" + conflictingVersion)); } } } return result; } DependencyGraph(DependencyNode root); }
DependencyGraph { List<DependencyPath> findConflicts() { List<DependencyPath> result = new ArrayList<>(); for (String coordinates : versions.keySet()) { Set<String> artifactVersions = versions.get(coordinates); if (artifactVersions.size() > 1) { for (String conflictingVersion : artifactVersions) { result.addAll(paths.get(coordinates + ":" + conflictingVersion)); } } } return result; } DependencyGraph(DependencyNode root); void addPath(DependencyPath path); List<DependencyPath> list(); DependencyPath getRootPath(); List<DependencyPath> getChildren(DependencyPath parent); Set<DependencyPath> getPaths(String coordinates); List<Update> findUpdates(); Map<String, String> getHighestVersionMap(); Set<UnresolvableArtifactProblem> getUnresolvedArtifacts(); UnresolvableArtifactProblem createUnresolvableArtifactProblem(Artifact artifact); static DependencyGraph from(DependencyNode root); }
DependencyGraph { List<DependencyPath> findConflicts() { List<DependencyPath> result = new ArrayList<>(); for (String coordinates : versions.keySet()) { Set<String> artifactVersions = versions.get(coordinates); if (artifactVersions.size() > 1) { for (String conflictingVersion : artifactVersions) { result.addAll(paths.get(coordinates + ":" + conflictingVersion)); } } } return result; } DependencyGraph(DependencyNode root); void addPath(DependencyPath path); List<DependencyPath> list(); DependencyPath getRootPath(); List<DependencyPath> getChildren(DependencyPath parent); Set<DependencyPath> getPaths(String coordinates); List<Update> findUpdates(); Map<String, String> getHighestVersionMap(); Set<UnresolvableArtifactProblem> getUnresolvedArtifacts(); UnresolvableArtifactProblem createUnresolvableArtifactProblem(Artifact artifact); static DependencyGraph from(DependencyNode root);  }