]> source.dussan.org Git - jgit.git/commitdiff
[errorprone] Fix InfiniteRecursion error in RecordingLogger 75/189575/2
authorMatthias Sohn <matthias.sohn@sap.com>
Wed, 12 Jan 2022 01:00:41 +0000 (02:00 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 18 Jan 2022 15:11:57 +0000 (16:11 +0100)
Change-Id: I092389e428232a4fe7613d846c288d285ae9102c

org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java

index 9c3c980ad82034ae4491d4b3940d68750c537f9b..af63084e936801cbe2387c43d2d2be858c69e05d 100644 (file)
@@ -180,11 +180,15 @@ public class RecordingLogger extends MarkerIgnoringBase {
 
        @Override
        public void warn(String format, Object arg) {
-               warn(format, Collections.singleton(arg));
+               addWarnings(format, Collections.singleton(arg));
        }
 
        @Override
        public void warn(String format, Object... arguments) {
+               addWarnings(format, arguments);
+       }
+
+       private void addWarnings(String format, Object... arguments) {
                synchronized (warnings) {
                        int i = 0;
                        int index = format.indexOf("{}");