diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java index 04266ec33..431202b2b 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java @@ -105,7 +105,7 @@ class RegexPipeline extends UrlPipeline { // build a request for them so RegexGroupFilter can pick // a different capture group later. Continue using the // first capture group as the path info. - WrappedRequest groups[] = new WrappedRequest[cur.groupCount()]; + WrappedRequest[] groups = new WrappedRequest[cur.groupCount()]; for (int groupId = 1; groupId <= cur.groupCount(); groupId++) { final int s = cur.start(groupId); final String path, info; diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java index 02734741c..3db3ba90c 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java @@ -45,7 +45,7 @@ import org.junit.runners.model.Statement; */ public class RepeatRule implements TestRule { - private static Logger LOG = Logger + private static final Logger LOG = Logger .getLogger(RepeatRule.class.getName()); /** diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java index eeacbc2f0..3ec08ecc8 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java @@ -60,7 +60,7 @@ import org.slf4j.LoggerFactory; * @since 4.3 */ public abstract class LfsProtocolServlet extends HttpServlet { - private static Logger LOG = LoggerFactory + private static final Logger LOG = LoggerFactory .getLogger(LfsProtocolServlet.class); private static final long serialVersionUID = 1L; diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java index 28f3d94c9..cc57947a7 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java @@ -34,7 +34,7 @@ import org.eclipse.jgit.util.HttpSupport; */ public class ObjectDownloadListener implements WriteListener { - private static Logger LOG = Logger + private static final Logger LOG = Logger .getLogger(ObjectDownloadListener.class.getName()); private final AsyncContext context; diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java index 95f941946..f5212fe25 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java @@ -38,7 +38,7 @@ import org.eclipse.jgit.lfs.lib.Constants; */ public class ObjectUploadListener implements ReadListener { - private static Logger LOG = Logger + private static final Logger LOG = Logger .getLogger(ObjectUploadListener.class.getName()); private final AsyncContext context; diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/CachingKeyPairProvider.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/CachingKeyPairProvider.java index 457186ae5..2ce69901c 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/CachingKeyPairProvider.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/CachingKeyPairProvider.java @@ -88,7 +88,7 @@ public class CachingKeyPairProvider extends FileKeyPairProvider if (cache == null) { return loadKey(session, resource, path, getPasswordFinder()); } - Throwable t[] = { null }; + Throwable[] t = { null }; KeyPair key = cache.get(path, p -> { try { return loadKey(session, resource, p, getPasswordFinder()); diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/proxy/HttpParser.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/proxy/HttpParser.java index 357b7e4f7..d5b80374c 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/proxy/HttpParser.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/proxy/HttpParser.java @@ -216,7 +216,7 @@ public final class HttpParser { start = nextStart + 1; } else { if (header.charAt(nextStart) == '"') { - int nextEnd[] = { nextStart + 1 }; + int[] nextEnd = { nextStart + 1 }; String value = scanQuotedString(header, nextStart + 1, nextEnd); challenge.addArgument(header.substring(start, end), value); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java index 6abefc02d..9f4b1fa49 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java @@ -415,7 +415,7 @@ public class RawText extends Sequence { } } - byte data[]; + byte[] data; try { data = new byte[(int)sz]; } catch (OutOfMemoryError e) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java index fdc89cd54..e8e198430 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java @@ -79,7 +79,8 @@ import org.slf4j.LoggerFactory; * This class handles checking out one or two trees merging with the index. */ public class DirCacheCheckout { - private static Logger LOG = LoggerFactory.getLogger(DirCacheCheckout.class); + private static final Logger LOG = LoggerFactory + .getLogger(DirCacheCheckout.class); private static final int MAX_EXCEPTION_TEXT_SIZE = 10 * 1024; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java index cded6700a..bc2039c56 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java @@ -649,7 +649,7 @@ public class FileReftableStack implements AutoCloseable { } } - static List segmentSizes(long sizes[]) { + static List segmentSizes(long[] sizes) { List segments = new ArrayList<>(); Segment cur = new Segment(); for (int i = 0; i < sizes.length; i++) { @@ -669,7 +669,7 @@ public class FileReftableStack implements AutoCloseable { return segments; } - private static Optional autoCompactCandidate(long sizes[]) { + private static Optional autoCompactCandidate(long[] sizes) { if (sizes.length == 0) { return Optional.empty(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java index 057970eca..75dd345f4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java @@ -191,7 +191,7 @@ public class PackWriter implements AutoCloseable { } @SuppressWarnings("unchecked") - BlockList objectsLists[] = new BlockList[OBJ_TAG + 1]; + BlockList[] objectsLists = new BlockList[OBJ_TAG + 1]; { objectsLists[OBJ_COMMIT] = new BlockList<>(); objectsLists[OBJ_TREE] = new BlockList<>(); @@ -236,7 +236,7 @@ public class PackWriter implements AutoCloseable { private List sortedByName; - private byte packcsum[]; + private byte[] packcsum; private boolean deltaBaseAsOffset; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java index 4b301c41f..575e7bd28 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java @@ -110,7 +110,7 @@ public class ResolveMerger extends ThreeWayMerger { * * @since 3.0 */ - protected String commitNames[]; + protected String[] commitNames; /** * Index of the base tree within the {@link #tw tree walk}. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 09ca7ca60..35196c6e3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -2378,12 +2378,12 @@ public class UploadPack { } @Override - public void write(byte b[]) throws IOException { + public void write(byte[] b) throws IOException { out.write(b); } @Override - public void write(byte b[], int off, int len) throws IOException { + public void write(byte[] b, int off, int len) throws IOException { out.write(b, off, len); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java index f747d1a15..cae3c394c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -2270,7 +2270,7 @@ public abstract class FS { void copy() throws IOException { boolean writeFailure = false; - byte buffer[] = new byte[4096]; + byte[] buffer = new byte[4096]; int readBytes; while ((readBytes = in.read(buffer)) != -1) { // Do not try to write again after a failure, but keep diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java index dd39416bb..82b2818a4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java @@ -117,7 +117,7 @@ public class FS_Win32_Cygwin extends FS_Win32 { argv.add("sh.exe"); //$NON-NLS-1$ argv.add("-c"); //$NON-NLS-1$ argv.add("$0 \"$@\""); //$NON-NLS-1$ - argv.add(cmd); + argv.add(cmd.replace(File.separatorChar, '/')); argv.addAll(Arrays.asList(args)); ProcessBuilder proc = new ProcessBuilder(); proc.command(argv); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/LfsFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/LfsFactory.java index 230d89008..7456c71f5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/LfsFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/LfsFactory.java @@ -280,7 +280,7 @@ public class LfsFactory { } @Override - public int read(byte b[], int off, int len) throws IOException { + public int read(byte[] b, int off, int len) throws IOException { return stream.read(b, off, len); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/Monitoring.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/Monitoring.java index cd2a8e672..500c23673 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/Monitoring.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/Monitoring.java @@ -49,7 +49,7 @@ public class Monitoring { String metricName) { boolean register = false; try { - Class interfaces[] = mbean.getClass().getInterfaces(); + Class[] interfaces = mbean.getClass().getInterfaces(); for (Class i : interfaces) { register = SystemReader.getInstance().getUserConfig() .getBoolean( 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 c896daf7e..1420add66 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 @@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory; * @since 4.7 */ public class SHA1 { - private static Logger LOG = LoggerFactory.getLogger(SHA1.class); + private static final Logger LOG = LoggerFactory.getLogger(SHA1.class); private static final boolean DETECT_COLLISIONS; static {