Reduce code smells (#2089)

Reduce code smells found by deepsource.io. We focused on the low-hanging fruits and not breaking any api.
This commit is contained in:
Eduard Heimbuch
2022-07-15 15:33:37 +02:00
committed by GitHub
parent f61d0c113f
commit 67c083ee54
15 changed files with 149 additions and 443 deletions

View File

@@ -80,7 +80,7 @@ public class ScmFileTransferServlet extends HttpServlet {
* Gson is used because the implementation was based on the jgit implementation. However the {@link LfsProtocolServlet} (which we do use in
* {@link ScmLfsProtocolServlet}) also uses Gson, which currently ties us to Gson anyway.
*/
private static Gson gson = createGson();
private static final Gson gson = createGson();
private final BlobStore blobStore;

View File

@@ -99,7 +99,7 @@ public class GitHookTagProviderTest {
public void testGetCreatedTags() {
try (MockedStatic<GitUtil> dummy = Mockito.mockStatic(GitUtil.class)) {
String revision = REVISION_1;
Long timestamp = 1339416344000L;
long timestamp = 1339416344000L;
String tagName = "1.0.0";
String ref = "refs/tags/" + tagName;
@@ -121,7 +121,7 @@ public class GitHookTagProviderTest {
public void testGetDeletedTags() {
try (MockedStatic<GitUtil> dummy = Mockito.mockStatic(GitUtil.class)) {
String revision = REVISION_1;
Long timestamp = 1339416344000L;
long timestamp = 1339416344000L;
String tagName = "1.0.0";
String ref = "refs/tags/" + tagName;
@@ -157,7 +157,7 @@ public class GitHookTagProviderTest {
String oldRevision = REVISION_2;
String newRevision = REVISION_1;
Long timestamp = 1339416344000L;
long timestamp = 1339416344000L;
String tagName = "1.0.0";
String ref = "refs/tags/" + tagName;
@@ -183,7 +183,7 @@ public class GitHookTagProviderTest {
String oldRevision = REVISION_2;
String newRevision = REVISION_1;
Long timestamp = 1339416344000L;
long timestamp = 1339416344000L;
String tagName = "1.0.0";
String ref = "refs/tags/" + tagName;
@@ -205,8 +205,8 @@ public class GitHookTagProviderTest {
try (MockedStatic<GitUtil> dummy = Mockito.mockStatic(GitUtil.class)) {
String revisionOfTag = REVISION_1;
String revisionOfCommit = REVISION_2;
Long timestampOfTag = 6666666000L;
Long timestampOfCommit = 1339416344000L;
long timestampOfTag = 6666666000L;
long timestampOfCommit = 1339416344000L;
String tagName = "1.0.0";
String ref = "refs/tags/" + tagName;