@Override public boolean equals(Object o) { if (this == o) return true; if (o instanceof DependencyId) { DependencyId that = (DependencyId) o; return this.hashCode() == that.hashCode() && equal(groupId, that.groupId) && equal(artifactId, that.artifactId) && equal(classifier, that.classifier) && equal(extension, that.extension); } return false; }
public DependencyId(String groupId, String artifactId, String classifier, String extension) { this.groupId = groupId; this.artifactId = artifactId; this.classifier = classifier; this.extension = extension; this.hashCode = Objects.hashCode(groupId, artifactId, classifier, extension); }
public void init() throws Exception { Objects.notNull(bundleContext, "bundleContext"); listenerService = bundleContext.registerService(ConfigurationListener.class.getName(), configurationListener, null); refreshConfigAdmin(); }
@Override public DependencyTree collectDependencyTree(boolean offline, Filter<Dependency> excludeDependencyFilter) throws RepositoryException, IOException { if (rootTree == null) { PomDetails details = resolvePomDetails(); Objects.notNull(details, "pomDetails"); try { rootTree = getResolver().collectDependencies(details, offline, excludeDependencyFilter).getTree(); } catch (IOException e) { logFailure(e); throw e; } catch (RepositoryException e) { logFailure(e); throw e; } } return rootTree; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o instanceof DependencyId) { DependencyId that = (DependencyId) o; return this.hashCode() == that.hashCode() && equal(groupId, that.groupId) && equal(artifactId, that.artifactId) && equal(classifier, that.classifier) && equal(extension, that.extension); } return false; }
public DependencyId(String groupId, String artifactId, String classifier, String extension) { this.groupId = groupId; this.artifactId = artifactId; this.classifier = classifier; this.extension = extension; this.hashCode = Objects.hashCode(groupId, artifactId, classifier, extension); }
@Override public DependencyTree collectDependencyTree(boolean offline, Filter<Dependency> excludeDependencyFilter) throws RepositoryException, IOException, XmlPullParserException { if (rootTree == null) { PomDetails details = resolvePomDetails(); Objects.notNull(details, "pomDetails"); try { rootTree = getResolver().collectDependencies(details, offline, excludeDependencyFilter).getTree(); } catch (IOException e) { logFailure(e); throw e; } catch (XmlPullParserException e) { logFailure(e); throw e; } catch (RepositoryException e) { logFailure(e); throw e; } } return rootTree; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o instanceof DependencyTree) { DependencyTree that = (DependencyTree) o; return hashCode() == that.hashCode() && equal(dependencyId, that.dependencyId) && equal(version, that.version) && equal(children, that.children); } else { return false; } }
@Override public int hashCode() { return Objects.hashCode(className, properties); }
public static Bundle findBundle(BundleContext bundleContext, String name, String version) { Version v = Versions.fromMavenVersion(version); Bundle[] bundles = bundleContext.getBundles(); for (Bundle bundle : bundles) { // TODO should be using ranges here!! if (Objects.equal(bundle.getSymbolicName(), name) && Objects.equal(bundle.getVersion(), v)) { return bundle; } } return null; }
@Override public int hashCode() { return Objects.hashCode(className, properties); }
public static Bundle findBundle(BundleContext bundleContext, String name, String version) { Version v = Versions.fromMavenVersion(version); Bundle[] bundles = bundleContext.getBundles(); for (Bundle bundle : bundles) { // TODO should be using ranges here!! if (Objects.equal(bundle.getSymbolicName(), name) && Objects.equal(bundle.getVersion(), v)) { return bundle; } } return null; }
public DependencyTree(DependencyId dependencyId, String version, List<DependencyTree> children) { this.dependencyId = dependencyId; this.version = version; ArrayList<DependencyTree> sortedChildren = new ArrayList<DependencyTree>(children); Collections.sort(sortedChildren); this.children = sortedChildren; this.hashCode = Objects.hashCode(dependencyId, version, this.children); init(children); }
public static <T extends Comparable<T>> int compare(List<T> a, List<T> b) { if (a == b) { return 0; } else if (a == null) { return -1; } else if (b == null) { return 1; } int size = a.size(); int answer = size - b.size(); if (answer == 0) { for (int i = 0; i < size; i++) { answer = compare(a.get(i), b.get(i)); if (answer != 0) { break; } } } return answer; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o instanceof DependencyTree) { DependencyTree that = (DependencyTree) o; return hashCode() == that.hashCode() && equal(dependencyId, that.dependencyId) && equal(version, that.version) && equal(children, that.children); } else { return false; } }
public DependencyTree(DependencyId dependencyId, String version, List<DependencyTree> children) { this.dependencyId = dependencyId; this.version = version; ArrayList<DependencyTree> sortedChildren = new ArrayList<DependencyTree>(children); Collections.sort(sortedChildren); this.children = sortedChildren; this.hashCode = Objects.hashCode(dependencyId, version, this.children); init(children); }