@Test void testEmptyMirrors() { assertThat(metaRepo.mirrors()).isEmpty(); metaRepo.commit(Revision.HEAD, 0, Author.SYSTEM, "", Change.ofJsonUpsert("/credentials.json", "[]")); assertThat(metaRepo.mirrors()).isEmpty(); metaRepo.commit(Revision.HEAD, 0, Author.SYSTEM, "", Change.ofJsonUpsert("/mirrors.json", "[]")); assertThat(metaRepo.mirrors()).isEmpty(); }
@Override public Set<Mirror> mirrors() { mirrorLock.lock(); try { final int headRev = normalizeNow(Revision.HEAD).major(); final Set<String> repos = parent().repos().list().keySet(); if (headRev > mirrorRev || !mirrorRepos.equals(repos)) { mirrors = loadMirrors(headRev); mirrorRev = headRev; mirrorRepos = repos; } return mirrors; } finally { mirrorLock.unlock(); } }
DefaultMetaRepository extends RepositoryWrapper implements MetaRepository { @Override public Set<Mirror> mirrors() { mirrorLock.lock(); try { final int headRev = normalizeNow(Revision.HEAD).major(); final Set<String> repos = parent().repos().list().keySet(); if (headRev > mirrorRev || !mirrorRepos.equals(repos)) { mirrors = loadMirrors(headRev); mirrorRev = headRev; mirrorRepos = repos; } return mirrors; } finally { mirrorLock.unlock(); } } }
DefaultMetaRepository extends RepositoryWrapper implements MetaRepository { @Override public Set<Mirror> mirrors() { mirrorLock.lock(); try { final int headRev = normalizeNow(Revision.HEAD).major(); final Set<String> repos = parent().repos().list().keySet(); if (headRev > mirrorRev || !mirrorRepos.equals(repos)) { mirrors = loadMirrors(headRev); mirrorRev = headRev; mirrorRepos = repos; } return mirrors; } finally { mirrorLock.unlock(); } } DefaultMetaRepository(Repository repo); }
DefaultMetaRepository extends RepositoryWrapper implements MetaRepository { @Override public Set<Mirror> mirrors() { mirrorLock.lock(); try { final int headRev = normalizeNow(Revision.HEAD).major(); final Set<String> repos = parent().repos().list().keySet(); if (headRev > mirrorRev || !mirrorRepos.equals(repos)) { mirrors = loadMirrors(headRev); mirrorRev = headRev; mirrorRepos = repos; } return mirrors; } finally { mirrorLock.unlock(); } } DefaultMetaRepository(Repository repo); @Override Set<Mirror> mirrors(); }
DefaultMetaRepository extends RepositoryWrapper implements MetaRepository { @Override public Set<Mirror> mirrors() { mirrorLock.lock(); try { final int headRev = normalizeNow(Revision.HEAD).major(); final Set<String> repos = parent().repos().list().keySet(); if (headRev > mirrorRev || !mirrorRepos.equals(repos)) { mirrors = loadMirrors(headRev); mirrorRev = headRev; mirrorRepos = repos; } return mirrors; } finally { mirrorLock.unlock(); } } DefaultMetaRepository(Repository repo); @Override Set<Mirror> mirrors();  }