Merge branch 'stable-3.5' into stable-3.6
* stable-3.5:
Fix flogger format string
Fix Flogger formatting errors raised by errorprone
Change-Id: If0cff17369d64bed7504a0ba528e55b22c94796f
diff --git a/pom.xml b/pom.xml
index af54b41..546d78f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
<groupId>com.gerritforge</groupId>
<artifactId>global-refdb</artifactId>
- <version>3.5.4.4</version>
+ <version>3.6.3.4</version>
<packaging>jar</packaging>
<name>global-refdb</name>
@@ -38,7 +38,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <gerrit.version>3.5.4</gerrit.version>
+ <gerrit.version>3.6.3</gerrit.version>
</properties>
<dependencies>
@@ -81,7 +81,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
- <source>1.8</source>
+ <source>11</source>
<target>11</target>
</configuration>
</plugin>
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;