From aa9f736c33caeb2ead30baa534e40daf1ab67caf Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 20 Nov 2022 19:45:54 +0100 Subject: [PATCH 1/6] Silence API warnings introduced by - addition of configurable SHA1 implementation in 5.13.2 - 3-digit @since 5.9.1 annotations on GitServlet methods Change-Id: If19853fcc5e3677e5b18e8e3fbbcd2773378dffc --- .../.settings/.api_filters | 17 ++++ org.eclipse.jgit/.settings/.api_filters | 77 +++++++++++++++++++ .../src/org/eclipse/jgit/util/sha1/SHA1.java | 2 + 3 files changed, 96 insertions(+) create mode 100644 org.eclipse.jgit.http.server/.settings/.api_filters diff --git a/org.eclipse.jgit.http.server/.settings/.api_filters b/org.eclipse.jgit.http.server/.settings/.api_filters new file mode 100644 index 000000000..951a53bf3 --- /dev/null +++ b/org.eclipse.jgit.http.server/.settings/.api_filters @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters index acceac05d..87deace39 100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@ -1,5 +1,13 @@ + + + + + + + + @@ -32,4 +40,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java index 87993d2be..56e90d063 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/sha1/SHA1.java @@ -27,6 +27,8 @@ public abstract class SHA1 { /** * SHA1 implementations available in JGit + * + * @since 5.13.2 */ public enum Sha1Implementation { /** From 41b33a16b87dbc7246f81089ef58f4bb530e4b1d Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 20 Nov 2022 19:55:22 +0100 Subject: [PATCH 2/6] Silence API errors Change-Id: Ie112b2099ea2125bc85863524e56f09ba4907373 --- org.eclipse.jgit/.settings/.api_filters | 24 +++++++++++++++++++ .../errors/NoRemoteRepositoryException.java | 2 +- .../jgit/transport/AwsRequestSignerV4.java | 2 +- .../org/eclipse/jgit/util/HttpSupport.java | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters index 6af84d0b4..d9840c700 100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@ -1,5 +1,13 @@ + + + + + + + + @@ -17,6 +25,22 @@ + + + + + + + + + + + + + + + + diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoRemoteRepositoryException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoRemoteRepositoryException.java index 1dd976cec..1fa411b4d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoRemoteRepositoryException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoRemoteRepositoryException.java @@ -39,7 +39,7 @@ public NoRemoteRepositoryException(URIish uri, String s) { * message * @param cause * root cause exception - * @since 5.13 + * @since 5.13.1 */ public NoRemoteRepositoryException(URIish uri, String s, Throwable cause) { super(uri, s, cause); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AwsRequestSignerV4.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AwsRequestSignerV4.java index 6b3d39721..ab3013762 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AwsRequestSignerV4.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AwsRequestSignerV4.java @@ -40,7 +40,7 @@ * "https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">AWS * Signature Version 4 * - * @since 5.13 + * @since 5.13.1 */ public final class AwsRequestSignerV4 { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java index 663a3449e..e3ba60634 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java @@ -196,7 +196,7 @@ public static void encode(StringBuilder urlstr, String key) { * them to "%2F"). * * @return The translated URL. - * @since 5.13 + * @since 5.13.1 */ public static String urlEncode(String url, boolean keepPathSlash) { String encoded; From fec271c11bb38aa7c80d251d4651536570977195 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 20 Nov 2022 20:09:02 +0100 Subject: [PATCH 3/6] Silence API errors Change-Id: I07c42fe9417edb0570dd475a7e935112a878a93b --- .../.settings/.api_filters | 14 ------- org.eclipse.jgit.junit/.settings/.api_filters | 17 ++++++++ .../junit/LocalDiskRepositoryTestCase.java | 2 + org.eclipse.jgit/.settings/.api_filters | 41 ++++++------------- 4 files changed, 31 insertions(+), 43 deletions(-) create mode 100644 org.eclipse.jgit.junit/.settings/.api_filters diff --git a/org.eclipse.jgit.http.server/.settings/.api_filters b/org.eclipse.jgit.http.server/.settings/.api_filters index 116c7eab9..2c32c9864 100644 --- a/org.eclipse.jgit.http.server/.settings/.api_filters +++ b/org.eclipse.jgit.http.server/.settings/.api_filters @@ -8,18 +8,4 @@ - - - - - - - - - - - - - - diff --git a/org.eclipse.jgit.junit/.settings/.api_filters b/org.eclipse.jgit.junit/.settings/.api_filters new file mode 100644 index 000000000..a17a72f40 --- /dev/null +++ b/org.eclipse.jgit.junit/.settings/.api_filters @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index a3c5b1202..59662cec9 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -87,6 +87,8 @@ public abstract class LocalDiskRepositoryTestCase { /** * The current test name. + * + * @since 6.0.1 */ @Rule public TestName currentTest = new TestName(); diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters index f97f5d7d7..a6f18310d 100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@ -4,8 +4,6 @@ - - @@ -18,10 +16,11 @@ - - + + - + + @@ -39,22 +38,6 @@ - - - - - - - - - - - - - - - - @@ -75,6 +58,14 @@ + + + + + + + + @@ -91,14 +82,6 @@ - - - - - - - - From f67cca6cb31d24e34a630f6a2c95cc8dca6c60af Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 20 Nov 2022 20:14:20 +0100 Subject: [PATCH 4/6] Remove unused API problem filters Change-Id: I890716bc052dcce2ce136040035b442247c08332 --- org.eclipse.jgit.junit/.settings/.api_filters | 17 ----- org.eclipse.jgit/.settings/.api_filters | 66 ------------------- 2 files changed, 83 deletions(-) delete mode 100644 org.eclipse.jgit.junit/.settings/.api_filters diff --git a/org.eclipse.jgit.junit/.settings/.api_filters b/org.eclipse.jgit.junit/.settings/.api_filters deleted file mode 100644 index a17a72f40..000000000 --- a/org.eclipse.jgit.junit/.settings/.api_filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters index a6f18310d..690575da6 100644 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@ -1,13 +1,5 @@ - - - - - - - - @@ -16,48 +8,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -66,22 +16,6 @@ - - - - - - - - - - - - - - - - From 3301032c6a45a515c2fe4edec39a53921a7e6f07 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 20 Nov 2022 20:16:28 +0100 Subject: [PATCH 5/6] Suppress non-externalized String warnings Change-Id: I95c61bd906bd3f7cdea9581e0ffa92ec607c6140 --- .../src/org/eclipse/jgit/transport/RefSpec.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java index e36eeccfb..e9134a1a3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java @@ -154,7 +154,7 @@ public RefSpec(String spec, WildcardMode mode) { this.allowMismatchedWildcards = mode; String s = spec; - if (s.startsWith("^+") || s.startsWith("+^")) { + if (s.startsWith("^+") || s.startsWith("+^")) { //$NON-NLS-1$ //$NON-NLS-2$ throw new IllegalArgumentException( JGitText.get().invalidNegativeAndForce); } @@ -164,7 +164,7 @@ public RefSpec(String spec, WildcardMode mode) { s = s.substring(1); } - if(s.startsWith("^")) { + if (s.startsWith("^")) { //$NON-NLS-1$ negative = true; s = s.substring(1); } @@ -251,7 +251,7 @@ public RefSpec(String spec, WildcardMode mode) { * the specification is invalid. */ public RefSpec(String spec) { - this(spec, spec.startsWith("^") ? WildcardMode.ALLOW_MISMATCH + this(spec, spec.startsWith("^") ? WildcardMode.ALLOW_MISMATCH //$NON-NLS-1$ : WildcardMode.REQUIRE_MATCH); } From af87046e5609097ad9d9e722b202ccefffb404a5 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 20 Nov 2022 20:18:01 +0100 Subject: [PATCH 6/6] Remove unused imports Change-Id: I57a3ae0a8608a517d9cc5cc27cee136f9faeb810 --- .../jgit/benchmarks/GetRefsBenchmark.java | 17 ++++++++++------- .../benchmarks/LookupFileStoreBenchmark.java | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/GetRefsBenchmark.java b/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/GetRefsBenchmark.java index 62627e66f..52a881bd1 100644 --- a/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/GetRefsBenchmark.java +++ b/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/GetRefsBenchmark.java @@ -9,6 +9,8 @@ */ package org.eclipse.jgit.benchmarks; +import static org.eclipse.jgit.transport.ReceiveCommand.Type.CREATE; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -17,16 +19,20 @@ import java.util.List; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; -import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; -import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository; import org.eclipse.jgit.internal.storage.file.FileRepository; -import org.eclipse.jgit.lib.*; +import org.eclipse.jgit.lib.BatchRefUpdate; +import org.eclipse.jgit.lib.ConfigConstants; +import org.eclipse.jgit.lib.Constants; +import org.eclipse.jgit.lib.ObjectId; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.RepositoryCache; +import org.eclipse.jgit.lib.StoredConfig; +import org.eclipse.jgit.lib.TextProgressMonitor; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.jgit.transport.ReceiveCommand; @@ -49,9 +55,6 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; -import static org.eclipse.jgit.transport.ReceiveCommand.Type.CREATE; -import static org.eclipse.jgit.transport.ReceiveCommand.Type.UPDATE; - @State(Scope.Thread) public class GetRefsBenchmark { diff --git a/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/LookupFileStoreBenchmark.java b/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/LookupFileStoreBenchmark.java index 393edcbc9..e9c9ef36a 100644 --- a/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/LookupFileStoreBenchmark.java +++ b/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks/LookupFileStoreBenchmark.java @@ -24,7 +24,6 @@ import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; -import org.openjdk.jmh.profile.StackProfiler; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.RunnerException; import org.openjdk.jmh.runner.options.Options;