From ebd149e6b3e58c2fb769f4fc70161addd12c958c Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Sat, 25 May 2019 10:25:39 +0200 Subject: [PATCH] Fixing error for setting repository list --- .../apache/archiva/repository/AbstractRepositoryGroup.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepositoryGroup.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepositoryGroup.java index f212b7636..11be643bb 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepositoryGroup.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepositoryGroup.java @@ -80,11 +80,13 @@ public class AbstractRepositoryGroup extends AbstractRepository implements Edita } @Override - public void setRepositories(List repositories) { + public void setRepositories(List newRepositories) { rwl.writeLock().lock(); try { repositories.clear(); - repositories.addAll(repositories); + for(ManagedRepository repo : newRepositories) { + repositories.put(repo.getId(), repo); + } } finally { rwl.writeLock().unlock(); } -- 2.39.5