@Override public boolean equals(Object obj) { // we say that two commit objects are equal iff they have the same ID // this prevents us from having to do clever workarounds for // https://gitlab.com/gitlab-org/gitlab-ce/issues/759 try { GitlabCommitStatus commitObj = (GitlabCommitStatus) obj; return (this.getId().compareTo(commitObj.getId()) == 0); } catch (ClassCastException e) { return false; } }
/** * synchronized so that there can't be a race condition here. * * @param project GitlabProject * @param commitHash String * @param api GitlabAPI * @return * @throws IOException */ private synchronized boolean hasCommitStatus(GitlabProject project, String commitHash, GitlabAPI api) throws IOException { try { List<GitlabCommitStatus> statuses = api.getCommitStatuses(project, commitHash); for (GitlabCommitStatus status : statuses) { LOGGER.fine("Status of " + commitHash + " -> " + status.getStatus()); } // Return true if there are some statuses return !statuses.isEmpty(); } catch (FileNotFoundException ex) { // Can ignore this one because it just means that there is no status for a commit } return false; }
@Override public boolean equals(Object obj) { // we say that two commit objects are equal iff they have the same ID // this prevents us from having to do clever workarounds for // https://gitlab.com/gitlab-org/gitlab-ce/issues/759 try { GitlabCommitStatus commitObj = (GitlabCommitStatus) obj; return (this.getId().compareTo(commitObj.getId()) == 0); } catch (ClassCastException e) { return false; } }
@Override public boolean equals(Object obj) { // we say that two commit objects are equal iff they have the same ID // this prevents us from having to do clever workarounds for // https://gitlab.com/gitlab-org/gitlab-ce/issues/759 try { GitlabCommitStatus commitObj = (GitlabCommitStatus) obj; return (this.getId().compareTo(commitObj.getId()) == 0); } catch (ClassCastException e) { return false; } }
@Override public int hashCode() { return this.getId().hashCode(); } }
@Override public int hashCode() { return this.getId().hashCode(); } }
@Override public int hashCode() { return this.getId().hashCode(); } }