/** * Removes the repo from this repogroup, if it exists. If it does exist, the mapping that was removed is * returned; if the given repo did not did not belong to this repo group, <code>null</code> is * returned. * * @param repo the repo to remove from this repo group * * @return the mapping that was removed or <code>null</code> if the repo did not belong to this repo group */ public RepoRepoGroup removeRepo(Repo repo) { if ((this.repoRepoGroups == null) || (repo == null)) { return null; } RepoRepoGroup doomed = null; for (RepoRepoGroup rrg : this.repoRepoGroups) { if (repo.equals(rrg.getRepoRepoGroupPK().getRepo())) { doomed = rrg; repo.removeRepoGroup(this); break; } } if (doomed != null) { this.repoRepoGroups.remove(doomed); } return doomed; }