Merge branch 'stable-3.5' into stable-3.6
* stable-3.5:
Remove redundant format calls in log calls
Add put method to create/update global-refdb entry
Add happy path test for BatchRefUpdateValidator
Remove Maven legacy pom.xml
Return immediately if local ref update fails
Remove references to Zookeeper in logs
Squash filter/findFirst/isPresent into anyMatch
Fix typo in private method
Bump Gerrit and module to v3.5.6
Change-Id: I7c6ea5727ca1d899e7b64eaf0d2e2578fbe9657c
diff --git a/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/LibModuleLogFile.java b/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/LibModuleLogFile.java
index c2858b4..7f10ef4 100644
--- a/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/LibModuleLogFile.java
+++ b/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/LibModuleLogFile.java
@@ -33,10 +33,11 @@
* @see org.apache.log4j.PatternLayout
*/
public LibModuleLogFile(SystemLog systemLog, String logName, Layout layout) {
- AsyncAppender asyncAppender = systemLog.createAsyncAppender(logName, layout, true, true);
Logger logger = LogManager.getLogger(logName);
- logger.removeAppender(logName);
- logger.addAppender(asyncAppender);
- logger.setAdditivity(false);
+ if (logger.getAppender(logName) == null) {
+ AsyncAppender asyncAppender = systemLog.createAsyncAppender(logName, layout, true, true);
+ logger.addAppender(asyncAppender);
+ logger.setAdditivity(false);
+ }
}
}
diff --git a/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/SharedRefDbGitRepositoryManager.java b/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/SharedRefDbGitRepositoryManager.java
index 763aeb4..24bed90 100644
--- a/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/SharedRefDbGitRepositoryManager.java
+++ b/src/main/java/com/gerritforge/gerrit/globalrefdb/validation/SharedRefDbGitRepositoryManager.java
@@ -25,7 +25,7 @@
import com.google.inject.Singleton;
import com.google.inject.name.Named;
import java.io.IOException;
-import java.util.SortedSet;
+import java.util.NavigableSet;
import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.lib.Repository;
@@ -110,7 +110,7 @@
}
@Override
- public SortedSet<Project.NameKey> list() {
+ public NavigableSet<Project.NameKey> list() {
return repositoryManager().list();
}
diff --git a/src/test/java/com/gerritforge/gerrit/globalrefdb/validation/dfsrefdb/RefUpdateStub.java b/src/test/java/com/gerritforge/gerrit/globalrefdb/validation/dfsrefdb/RefUpdateStub.java
index e78ba6d..2da186b 100644
--- a/src/test/java/com/gerritforge/gerrit/globalrefdb/validation/dfsrefdb/RefUpdateStub.java
+++ b/src/test/java/com/gerritforge/gerrit/globalrefdb/validation/dfsrefdb/RefUpdateStub.java
@@ -15,7 +15,7 @@
package com.gerritforge.gerrit.globalrefdb.validation.dfsrefdb;
import java.io.IOException;
-import org.apache.commons.lang.NotImplementedException;
+import org.apache.commons.lang3.NotImplementedException;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefDatabase;