diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2018-05-16 16:34:16 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-05-18 17:59:45 +0200 |
commit | f3ec7cf3f0436a79e252251a31dbc62694555897 (patch) | |
tree | 49a647fa520bb5a1016425df26357947f8dab95c /org.eclipse.jgit | |
parent | 667e30678a6bad26f4d4d412e996b293e52e5b87 (diff) | |
download | jgit-f3ec7cf3f0436a79e252251a31dbc62694555897.tar.gz jgit-f3ec7cf3f0436a79e252251a31dbc62694555897.zip |
Remove further unnecessary 'final' keywords
Remove it from
* package private functions.
* try blocks
* for loops
this was done with the following python script:
$ cat f.py
import sys
import re
import os
def replaceFinal(m):
return m.group(1) + "(" + m.group(2).replace('final ', '') + ")"
methodDecl = re.compile(r"^([\t ]*[a-zA-Z_ ]+)\(([^)]*)\)")
def subst(fn):
input = open(fn)
os.rename(fn, fn + "~")
dest = open(fn, 'w')
for l in input:
l = methodDecl.sub(replaceFinal, l)
dest.write(l)
dest.close()
for root, dirs, files in os.walk(".", topdown=False):
for f in files:
if not f.endswith('.java'):
continue
full = os.path.join(root, f)
print full
subst(full)
Change-Id: If533a75a417594fc893e7c669d2c1f0f6caeb7ca
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Diffstat (limited to 'org.eclipse.jgit')
139 files changed, 435 insertions, 435 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java index a05d962553..5c06bac1f2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java @@ -315,7 +315,7 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> { specs.add(wcrs); else if (branchesToClone != null && branchesToClone.size() > 0) { - for (final String selectedRef : branchesToClone) + for (String selectedRef : branchesToClone) if (wcrs.matchSource(selectedRef)) specs.add(wcrs.expandFromSource(selectedRef)); } @@ -410,7 +410,7 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> { } Ref foundBranch = null; - for (final Ref r : result.getAdvertisedRefs()) { + for (Ref r : result.getAdvertisedRefs()) { final String n = r.getName(); if (!n.startsWith(Constants.R_HEADS)) continue; @@ -444,7 +444,7 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> { throws MissingObjectException, IncorrectObjectTypeException, IOException { final RevCommit commit; - try (final RevWalk rw = new RevWalk(clonedRepo)) { + try (RevWalk rw = new RevWalk(clonedRepo)) { commit = rw.parseCommit(ref.getObjectId()); } return commit; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java index 31987036a5..13ce4e7690 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java @@ -360,7 +360,7 @@ public class ResetCommand extends GitCommand<Ref> { private void resetIndexForPaths(ObjectId commitTree) { DirCache dc = null; - try (final TreeWalk tw = new TreeWalk(repo)) { + try (TreeWalk tw = new TreeWalk(repo)) { dc = repo.lockDirCache(); DirCacheBuilder builder = dc.builder(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java index 088aa15e57..d2f4be84bd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java @@ -154,7 +154,7 @@ public class RmCommand extends GitCommand<DirCache> { DirCache dc = null; List<String> actuallyDeletedFiles = new ArrayList<>(); - try (final TreeWalk tw = new TreeWalk(repo)) { + try (TreeWalk tw = new TreeWalk(repo)) { dc = repo.lockDirCache(); DirCacheBuilder builder = dc.builder(); tw.reset(); // drop the first empty tree, which we do not need here diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java index 82c7a4b6c7..c32890d8a4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java @@ -195,7 +195,7 @@ public class StashCreateCommand extends GitCommand<RevCommit> { private RevCommit parseCommit(final ObjectReader reader, final ObjectId headId) throws IOException { - try (final RevWalk walk = new RevWalk(reader)) { + try (RevWalk walk = new RevWalk(reader)) { return walk.parseCommit(headId); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/blame/ReverseWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/blame/ReverseWalk.java index 2eb313f603..106737805c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/blame/ReverseWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/blame/ReverseWalk.java @@ -108,7 +108,7 @@ final class ReverseWalk extends RevWalk { return children.length; } - ReverseCommit getChild(final int nth) { + ReverseCommit getChild(int nth) { return children[nth]; } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java index 646f264e09..caaffe349b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java @@ -359,7 +359,7 @@ if (k < beginK || k > endK) abstract int getLeft(int x); abstract int getRight(int x); abstract boolean isBetter(int left, int right); - abstract void adjustMinMaxK(final int k, final int x); + abstract void adjustMinMaxK(int k, int x); abstract boolean meets(int d, int k, int x, long snake); final long newSnake(int k, int x) { @@ -469,22 +469,22 @@ if (k < beginK || k > endK) } @Override - final int getLeft(final int x) { + final int getLeft(int x) { return x; } @Override - final int getRight(final int x) { + final int getRight(int x) { return x + 1; } @Override - final boolean isBetter(final int left, final int right) { + final boolean isBetter(int left, int right) { return left > right; } @Override - final void adjustMinMaxK(final int k, final int x) { + final void adjustMinMaxK(int k, int x) { if (x >= endA || k + x >= endB) { if (k > backward.middleK) maxK = k; @@ -517,22 +517,22 @@ if (k < beginK || k > endK) } @Override - final int getLeft(final int x) { + final int getLeft(int x) { return x - 1; } @Override - final int getRight(final int x) { + final int getRight(int x) { return x; } @Override - final boolean isBetter(final int left, final int right) { + final boolean isBetter(int left, int right) { return left < right; } @Override - final void adjustMinMaxK(final int k, final int x) { + final void adjustMinMaxK(int k, int x) { if (x <= beginA || k + x <= beginB) { if (k > forward.middleK) maxK = k; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java index 09c0351b80..5897ffb758 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java @@ -157,7 +157,7 @@ public class SimilarityIndex { } } - void hash(byte[] raw, int ptr, final int end) throws TableFullException { + void hash(byte[] raw, int ptr, int end) throws TableFullException { final boolean text = !RawText.isBinary(raw); hashedCnt = 0; while (ptr < end) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java index 752c017586..14653fe17f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java @@ -121,11 +121,11 @@ public class DirCache { } }; - static int cmp(final DirCacheEntry a, final DirCacheEntry b) { + static int cmp(DirCacheEntry a, DirCacheEntry b) { return cmp(a.path, a.path.length, b); } - static int cmp(final byte[] aPath, final int aLen, final DirCacheEntry b) { + static int cmp(byte[] aPath, int aLen, DirCacheEntry b) { return cmp(aPath, aLen, b.path, b.path.length); } @@ -404,7 +404,7 @@ public class DirCache { return new DirCacheEditor(this, entryCnt + 16); } - void replace(final DirCacheEntry[] e, final int cnt) { + void replace(DirCacheEntry[] e, int cnt) { sortedEntries = e; entryCnt = cnt; tree = null; @@ -648,7 +648,7 @@ public class DirCache { } } - void writeTo(File dir, final OutputStream os) throws IOException { + void writeTo(File dir, OutputStream os) throws IOException { final MessageDigest foot = Constants.newMessageDigest(); final DigestOutputStream dos = new DigestOutputStream(os, foot); @@ -848,7 +848,7 @@ public class DirCache { return nextIdx; } - int nextEntry(final byte[] p, final int pLen, int nextIdx) { + int nextEntry(byte[] p, int pLen, int nextIdx) { while (nextIdx < entryCnt) { final DirCacheEntry next = sortedEntries[nextIdx]; if (!DirCacheTree.peq(p, next.path, pLen)) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java index 19408b0592..fee9f51000 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java @@ -312,7 +312,7 @@ public class DirCacheEntry { System.arraycopy(src.info, src.infoOffset, info, 0, INFO_LEN); } - void write(final OutputStream os) throws IOException { + void write(OutputStream os) throws IOException { final int len = isExtended() ? INFO_LEN_EXTENDED : INFO_LEN; final int pathLen = path.length; os.write(info, infoOffset, len); @@ -719,7 +719,7 @@ public class DirCacheEntry { * @param keepStage * if true, the stage attribute will not be copied */ - void copyMetaData(final DirCacheEntry src, boolean keepStage) { + void copyMetaData(DirCacheEntry src, boolean keepStage) { int origflags = NB.decodeUInt16(info, infoOffset + P_FLAGS); int newflags = NB.decodeUInt16(src.info, src.infoOffset + P_FLAGS); System.arraycopy(src.info, src.infoOffset, info, infoOffset, INFO_LEN); @@ -771,7 +771,7 @@ public class DirCacheEntry { } } - static String toString(final byte[] path) { + static String toString(byte[] path) { return Constants.CHARSET.decode(ByteBuffer.wrap(path)).toString(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java index 575b9a25f4..19c916f810 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java @@ -124,7 +124,7 @@ public class DirCacheIterator extends AbstractTreeIterator { parseEntry(); } - DirCacheIterator(final DirCacheIterator p, final DirCacheTree dct) { + DirCacheIterator(DirCacheIterator p, DirCacheTree dct) { super(p, p.path, p.pathLen + 1); cache = p.cache; tree = dct; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java index e9f1fcd923..b605f3ca8e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java @@ -185,7 +185,7 @@ public class DirCacheTree { childCnt = subcnt; } - void write(final byte[] tmp, final OutputStream os) throws IOException { + void write(byte[] tmp, OutputStream os) throws IOException { int ptr = tmp.length; tmp[--ptr] = '\n'; ptr = RawParseUtils.formatBase10(tmp, ptr, childCnt); @@ -404,7 +404,7 @@ public class DirCacheTree { return encodedName.length; } - final boolean contains(final byte[] a, int aOff, final int aLen) { + final boolean contains(byte[] a, int aOff, int aLen) { final byte[] e = encodedName; final int eLen = e.length; for (int eOff = 0; eOff < eLen && aOff < aLen; eOff++, aOff++) @@ -531,7 +531,7 @@ public class DirCacheTree { children[n] = null; } - static boolean peq(final byte[] a, final byte[] b, int aLen) { + static boolean peq(byte[] a, byte[] b, int aLen) { if (b.length < aLen) return false; for (aLen--; aLen >= 0; aLen--) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java index 7192138b15..1df70e3501 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java @@ -59,7 +59,7 @@ public class CompoundException extends Exception { private static String format(Collection<Throwable> causes) { final StringBuilder msg = new StringBuilder(); msg.append(JGitText.get().failureDueToOneOfTheFollowing); - for (final Throwable c : causes) { + for (Throwable c : causes) { msg.append(" "); //$NON-NLS-1$ msg.append(c.getMessage()); msg.append("\n"); //$NON-NLS-1$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java index 9efc21e7c7..b37d20d58f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java @@ -59,7 +59,7 @@ public class MissingBundlePrerequisiteException extends TransportException { private static String format(Map<ObjectId, String> missingCommits) { final StringBuilder r = new StringBuilder(); r.append(JGitText.get().missingPrerequisiteCommits); - for (final Map.Entry<ObjectId, String> e : missingCommits.entrySet()) { + for (Map.Entry<ObjectId, String> e : missingCommits.entrySet()) { r.append("\n "); //$NON-NLS-1$ r.append(e.getKey().name()); if (e.getValue() != null) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java index eb98a3acd8..1dc5931ca2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java @@ -61,7 +61,7 @@ final class GroupHead extends AbstractHead { private final boolean inverse; - GroupHead(String pattern, final String wholePattern) + GroupHead(String pattern, String wholePattern) throws InvalidPatternException { super(false); this.characterClasses = new ArrayList<>(); @@ -214,7 +214,7 @@ final class GroupHead extends AbstractHead { private static final class OneCharacterPattern implements CharacterPattern { private char expectedCharacter; - OneCharacterPattern(final char c) { + OneCharacterPattern(char c) { this.expectedCharacter = c; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java index 2068b0d896..45e6ed2947 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java @@ -47,7 +47,7 @@ package org.eclipse.jgit.fnmatch; final class RestrictedWildCardHead extends AbstractHead { private final char excludedCharacter; - RestrictedWildCardHead(final char excludedCharacter, final boolean star) { + RestrictedWildCardHead(char excludedCharacter, boolean star) { super(star); this.excludedCharacter = excludedCharacter; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java index 8e9ed5d0d8..ca54ee22ea 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java @@ -497,7 +497,7 @@ public abstract class DfsObjDatabase extends ObjectDatabase { } while (!packList.compareAndSet(o, n)); } - PackList scanPacks(final PackList original) throws IOException { + PackList scanPacks(PackList original) throws IOException { PackList o, n; synchronized (packList) { do { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjectToPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjectToPack.java index 3a04d70dbb..5f4dee2264 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjectToPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjectToPack.java @@ -60,7 +60,7 @@ class DfsObjectToPack extends ObjectToPack { /** Length of the data section of the object. */ long length; - DfsObjectToPack(AnyObjectId src, final int type) { + DfsObjectToPack(AnyObjectId src, int type) { super(src, type); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteArrayWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteArrayWindow.java index 07b607c189..c6fdeb0d1f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteArrayWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteArrayWindow.java @@ -58,7 +58,7 @@ import org.eclipse.jgit.internal.storage.pack.PackOutputStream; final class ByteArrayWindow extends ByteWindow { private final byte[] array; - ByteArrayWindow(final PackFile pack, final long o, final byte[] b) { + ByteArrayWindow(PackFile pack, long o, byte[] b) { super(pack, o, b.length); array = b; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteBufferWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteBufferWindow.java index 343d36922f..8e7904f882 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteBufferWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteBufferWindow.java @@ -60,7 +60,7 @@ import org.eclipse.jgit.internal.storage.pack.PackOutputStream; final class ByteBufferWindow extends ByteWindow { private final ByteBuffer buffer; - ByteBufferWindow(final PackFile pack, final long o, final ByteBuffer b) { + ByteBufferWindow(PackFile pack, long o, ByteBuffer b) { super(pack, o, b.capacity()); buffer = b; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteWindow.java index a3146dbb52..60073f39d3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteWindow.java @@ -86,7 +86,7 @@ abstract class ByteWindow { return (int) (end - start); } - final boolean contains(final PackFile neededFile, final long neededPos) { + final boolean contains(PackFile neededFile, long neededPos) { return pack == neededFile && start <= neededPos && neededPos < end; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java index 945e97950d..7f7ecc268d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java @@ -205,7 +205,7 @@ class CachedObjectDirectory extends FileObjectDatabase { } @Override - ObjectLoader openObject(final WindowCursor curs, final AnyObjectId objectId) + ObjectLoader openObject(WindowCursor curs, AnyObjectId objectId) throws IOException { return openObject(curs, objectId, null); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java index b464a1b79f..ed73e72232 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java @@ -82,7 +82,7 @@ class DeltaBaseCache { cache = new Slot[CACHE_SZ]; } - Entry get(final PackFile pack, final long position) { + Entry get(PackFile pack, long position) { Slot e = cache[hash(position)]; if (e == null) return null; @@ -168,7 +168,7 @@ class DeltaBaseCache { final int type; - Entry(final byte[] aData, final int aType) { + Entry(byte[] aData, int aType) { data = aData; type = aType; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java index 137a757311..342e2c842c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java @@ -852,7 +852,7 @@ public class GC { } List<ObjectIdSet> excluded = new LinkedList<>(); - for (final PackFile f : repo.getObjectDatabase().getPacks()) { + for (PackFile f : repo.getObjectDatabase().getPacks()) { checkCancelled(); if (f.shouldBeKept()) excluded.add(f.getIndex()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LocalObjectToPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LocalObjectToPack.java index 55eeb95ce5..ed5cbfcf5d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LocalObjectToPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LocalObjectToPack.java @@ -58,7 +58,7 @@ class LocalObjectToPack extends ObjectToPack { /** Length of the data section of the object. */ long length; - LocalObjectToPack(AnyObjectId src, final int type) { + LocalObjectToPack(AnyObjectId src, int type) { super(src, type); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java index 4cab5f8bb8..51c5702fc2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java @@ -257,7 +257,7 @@ public class ObjectDirectory extends FileObjectDatabase { // Fully close all loaded alternates and clear the alternate list. AlternateHandle[] alt = alternates.get(); if (alt != null && alternates.compareAndSet(alt, null)) { - for(final AlternateHandle od : alt) + for(AlternateHandle od : alt) od.close(); } } @@ -619,7 +619,7 @@ public class ObjectDirectory extends FileObjectDatabase { WindowCursor curs, Set<AlternateHandle.Id> skips) throws IOException { PackList pList = packList.get(); SEARCH: for (;;) { - for (final PackFile p : pList.packs) { + for (PackFile p : pList.packs) { try { LocalObjectRepresentation rep = p.representation(curs, otp); p.resetTransientErrorCount(); @@ -888,7 +888,7 @@ public class ObjectDirectory extends FileObjectDatabase { final Set<String> names = listPackDirectory(); final List<PackFile> list = new ArrayList<>(names.size() >> 2); boolean foundNew = false; - for (final String indexName : names) { + for (String indexName : names) { // Must match "pack-[0-9a-f]{40}.idx" to be an index. // if (indexName.length() != 49 || !indexName.endsWith(".idx")) //$NON-NLS-1$ @@ -931,7 +931,7 @@ public class ObjectDirectory extends FileObjectDatabase { return old; } - for (final PackFile p : forReuse.values()) { + for (PackFile p : forReuse.values()) { p.close(); } @@ -945,7 +945,7 @@ public class ObjectDirectory extends FileObjectDatabase { private static Map<String, PackFile> reuseMap(PackList old) { final Map<String, PackFile> forReuse = new HashMap<>(); - for (final PackFile p : old.packs) { + for (PackFile p : old.packs) { if (p.invalid()) { // The pack instance is corrupted, and cannot be safely used // again. Do not include it in our reuse map. @@ -974,7 +974,7 @@ public class ObjectDirectory extends FileObjectDatabase { if (nameList == null) return Collections.emptySet(); final Set<String> nameSet = new HashSet<>(nameList.length << 1); - for (final String name : nameList) { + for (String name : nameList) { if (name.startsWith("pack-")) //$NON-NLS-1$ nameSet.add(name); } @@ -1076,7 +1076,7 @@ public class ObjectDirectory extends FileObjectDatabase { /** All known packs, sorted by {@link PackFile#SORT}. */ final PackFile[] packs; - PackList(final FileSnapshot monitor, final PackFile[] packs) { + PackList(FileSnapshot monitor, PackFile[] packs) { this.snapshot = monitor; this.packs = packs; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java index e6ae9686a4..e5a54e372c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java @@ -78,7 +78,7 @@ class ObjectDirectoryInserter extends ObjectInserter { private Deflater deflate; - ObjectDirectoryInserter(final FileObjectDatabase dest, final Config cfg) { + ObjectDirectoryInserter(FileObjectDatabase dest, Config cfg) { db = dest; config = cfg.get(WriteConfig.KEY); } @@ -267,7 +267,7 @@ class ObjectDirectoryInserter extends ObjectInserter { } } - void writeHeader(OutputStream out, final int type, long len) + void writeHeader(OutputStream out, int type, long len) throws IOException { out.write(Constants.encodedTypeString(type)); out.write((byte) ' '); @@ -279,7 +279,7 @@ class ObjectDirectoryInserter extends ObjectInserter { return File.createTempFile("noz", null, db.getDirectory()); //$NON-NLS-1$ } - DeflaterOutputStream compress(final OutputStream out) { + DeflaterOutputStream compress(OutputStream out) { if (deflate == null) deflate = new Deflater(config.getCompression()); else diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java index c32ba36010..71f64ae11f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java @@ -279,7 +279,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { * @throws IOException * the pack file or the index could not be read. */ - ObjectLoader get(final WindowCursor curs, final AnyObjectId id) + ObjectLoader get(WindowCursor curs, AnyObjectId id) throws IOException { final long offset = idx().findOffset(id); return 0 < offset && !isCorrupt(offset) ? load(curs, offset) : null; @@ -344,7 +344,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { * @throws IOException * the index file cannot be loaded into memory. */ - ObjectId findObjectForOffset(final long offset) throws IOException { + ObjectId findObjectForOffset(long offset) throws IOException { return getReverseIdx().findObject(offset); } @@ -692,7 +692,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { } } - ByteArrayWindow read(final long pos, int size) throws IOException { + ByteArrayWindow read(long pos, int size) throws IOException { synchronized (readLock) { if (length < pos + size) size = (int) (length - pos); @@ -703,7 +703,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { } } - ByteWindow mmap(final long pos, int size) throws IOException { + ByteWindow mmap(long pos, int size) throws IOException { synchronized (readLock) { if (length < pos + size) size = (int) (length - pos); @@ -760,7 +760,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { } } - ObjectLoader load(final WindowCursor curs, long pos) + ObjectLoader load(WindowCursor curs, long pos) throws IOException, LargeObjectException { try { final byte[] ib = curs.tempId; @@ -949,7 +949,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { return hdr; } - int getObjectType(final WindowCursor curs, long pos) throws IOException { + int getObjectType(WindowCursor curs, long pos) throws IOException { final byte[] ib = curs.tempId; for (;;) { readFully(pos, ib, 0, 20, curs); @@ -996,13 +996,13 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { } } - long getObjectSize(final WindowCursor curs, final AnyObjectId id) + long getObjectSize(WindowCursor curs, AnyObjectId id) throws IOException { final long offset = idx().findOffset(id); return 0 < offset ? getObjectSize(curs, offset) : -1; } - long getObjectSize(final WindowCursor curs, final long pos) + long getObjectSize(WindowCursor curs, long pos) throws IOException { final byte[] ib = curs.tempId; readFully(pos, ib, 0, 20, curs); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java index 66d35bd900..4444dd691f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java @@ -113,7 +113,7 @@ class PackIndexV1 extends PackIndex { @Override public long getOffset64Count() { long n64 = 0; - for (final MutableEntry e : this) { + for (MutableEntry e : this) { if (e.getOffset() >= Integer.MAX_VALUE) n64++; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriter.java index 61bb902a97..553f7c9a19 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriter.java @@ -123,7 +123,7 @@ public abstract class PackIndexWriter { */ public static int oldestPossibleFormat( final List<? extends PackedObjectInfo> objs) { - for (final PackedObjectInfo oe : objs) { + for (PackedObjectInfo oe : objs) { if (!PackIndexWriterV1.canStore(oe)) return 2; } @@ -269,11 +269,11 @@ public abstract class PackIndexWriter { */ protected void writeFanOutTable() throws IOException { final int[] fanout = new int[256]; - for (final PackedObjectInfo po : entries) + for (PackedObjectInfo po : entries) fanout[po.getFirstByte() & 0xff]++; for (int i = 1; i < 256; i++) fanout[i] += fanout[i - 1]; - for (final int n : fanout) { + for (int n : fanout) { NB.encodeInt32(tmp, 0, n); out.write(tmp, 0, 4); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV1.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV1.java index f220e7a6c6..877f7c8cd7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV1.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV1.java @@ -58,7 +58,7 @@ import org.eclipse.jgit.util.NB; * @see PackIndexV1 */ class PackIndexWriterV1 extends PackIndexWriter { - static boolean canStore(final PackedObjectInfo oe) { + static boolean canStore(PackedObjectInfo oe) { // We are limited to 4 GB per pack as offset is 32 bit unsigned int. // return oe.getOffset() >>> 1 < Integer.MAX_VALUE; @@ -73,7 +73,7 @@ class PackIndexWriterV1 extends PackIndexWriter { protected void writeImpl() throws IOException { writeFanOutTable(); - for (final PackedObjectInfo oe : entries) { + for (PackedObjectInfo oe : entries) { if (!canStore(oe)) throw new IOException(JGitText.get().packTooLargeForIndexVersion1); NB.encodeInt32(tmp, 0, (int) oe.getOffset()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV2.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV2.java index a18ccaf9ea..9505d35b71 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV2.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV2.java @@ -76,12 +76,12 @@ class PackIndexWriterV2 extends PackIndexWriter { } private void writeObjectNames() throws IOException { - for (final PackedObjectInfo oe : entries) + for (PackedObjectInfo oe : entries) oe.copyRawTo(out); } private void writeCRCs() throws IOException { - for (final PackedObjectInfo oe : entries) { + for (PackedObjectInfo oe : entries) { NB.encodeInt32(tmp, 0, oe.getCRC()); out.write(tmp, 0, 4); } @@ -89,7 +89,7 @@ class PackIndexWriterV2 extends PackIndexWriter { private void writeOffset32() throws IOException { int o64 = 0; - for (final PackedObjectInfo oe : entries) { + for (PackedObjectInfo oe : entries) { final long o = oe.getOffset(); if (o <= MAX_OFFSET_32) NB.encodeInt32(tmp, 0, (int) o); @@ -100,7 +100,7 @@ class PackIndexWriterV2 extends PackIndexWriter { } private void writeOffset64() throws IOException { - for (final PackedObjectInfo oe : entries) { + for (PackedObjectInfo oe : entries) { final long o = oe.getOffset(); if (MAX_OFFSET_32 < o) { NB.encodeInt64(tmp, 0, o); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackReverseIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackReverseIndex.java index fb7eddf6b6..dfe23ba79c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackReverseIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackReverseIndex.java @@ -107,7 +107,7 @@ public class PackReverseIndex { long maxOffset = 0; int ith = 0; - for (final MutableEntry me : index) { + for (MutableEntry me : index) { final long o = me.getOffset(); offsetsBySha1[ith++] = o; if (o > maxOffset) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java index 8e3357fdcb..a27b99157c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java @@ -208,7 +208,7 @@ public class RefDirectory extends RefDatabase { private List<Integer> retrySleepMs = RETRY_SLEEP_MS; - RefDirectory(final FileRepository db) { + RefDirectory(FileRepository db) { final FS fs = db.getFS(); parent = db; gitDir = db.getDirectory(); @@ -434,7 +434,7 @@ public class RefDirectory extends RefDatabase { RefList.Builder<LooseRef> newLoose; - LooseScanner(final RefList<LooseRef> curLoose) { + LooseScanner(RefList<LooseRef> curLoose) { this.curLoose = curLoose; } @@ -1262,14 +1262,14 @@ public class RefDirectory extends RefDatabase { return new File(gitDir, name); } - static int levelsIn(final String name) { + static int levelsIn(String name) { int count = 0; for (int p = name.indexOf('/'); p >= 0; p = name.indexOf('/', p + 1)) count++; return count; } - static void delete(final File file, final int depth) throws IOException { + static void delete(File file, int depth) throws IOException { delete(file, depth, null); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryRename.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryRename.java index 202e51f6c8..ec7ec73be8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryRename.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryRename.java @@ -104,7 +104,7 @@ class RefDirectoryRename extends RefRename { objId = source.getOldObjectId(); updateHEAD = needToUpdateHEAD(); tmp = refdb.newTemporaryUpdate(); - try (final RevWalk rw = new RevWalk(refdb.getRepository())) { + try (RevWalk rw = new RevWalk(refdb.getRepository())) { // First backup the source so its never unreachable. tmp.setNewObjectId(objId); tmp.setForceUpdate(true); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java index fb839dff61..45ce6349a5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java @@ -60,7 +60,7 @@ class RefDirectoryUpdate extends RefUpdate { private boolean shouldDeref; private LockFile lock; - RefDirectoryUpdate(final RefDirectory r, final Ref ref) { + RefDirectoryUpdate(RefDirectory r, Ref ref) { super(ref); database = r; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java index adb05e4d99..cf474afbbe 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java @@ -266,7 +266,7 @@ public class UnpackedObject { } } - static boolean isStandardFormat(final byte[] hdr) { + static boolean isStandardFormat(byte[] hdr) { /* * We must determine if the buffer contains the standard * zlib-deflated stream or the experimental format based diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java index c03fb2f835..8cf1d4e219 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java @@ -178,7 +178,7 @@ public class WindowCache { return cache; } - static final ByteWindow get(final PackFile pack, final long offset) + static final ByteWindow get(PackFile pack, long offset) throws IOException { final WindowCache c = cache; final ByteWindow r = c.getOrLoad(pack, c.toStart(offset)); @@ -193,7 +193,7 @@ public class WindowCache { return r; } - static final void purge(final PackFile pack) { + static final void purge(PackFile pack) { cache.removeAll(pack); } @@ -556,7 +556,7 @@ public class WindowCache { */ volatile boolean dead; - Entry(final Entry n, final Ref r) { + Entry(Entry n, Ref r) { next = n; ref = r; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java index 569bfe895f..010c142887 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java @@ -347,7 +347,7 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { inf.reset(); } - void pin(final PackFile pack, final long position) + void pin(PackFile pack, long position) throws IOException { final ByteWindow w = window; if (w == null || !w.contains(pack, position)) { 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 f5e600d558..36d6f0aebc 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 @@ -1526,7 +1526,7 @@ public class PackWriter implements AutoCloseable { // The caller gave us an executor, but it might not do // asynchronous execution. Wrap everything and hope it // can schedule these for us. - for (final DeltaTask task : taskBlock.tasks) { + for (DeltaTask task : taskBlock.tasks) { executor.execute(new Runnable() { @Override public void run() { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java index 6acc684bc7..d105d0d200 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java @@ -165,7 +165,7 @@ public final class AbbreviatedObjectId implements Serializable { return r << (8 - n) * 4; } - static int mask(final int nibbles, final int word, final int v) { + static int mask(int nibbles, int word, int v) { final int b = (word - 1) * 8; if (b + 8 <= nibbles) { // We have all of the bits required for this word. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java index e7d465b125..978dd3a729 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java @@ -481,7 +481,7 @@ public abstract class AnyObjectId implements Comparable<AnyObjectId> { private static final char[] hexchar = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; - static void formatHexChar(final char[] dst, final int p, int w) { + static void formatHexChar(char[] dst, int p, int w) { int o = p + 7; while (o >= p && w != 0) { dst[o--] = hexchar[w & 0xf]; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java index f59cc6961d..0e01cca99b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java @@ -1010,7 +1010,7 @@ public class Config { */ public String toText() { final StringBuilder out = new StringBuilder(); - for (final ConfigLine e : state.get().entryList) { + for (ConfigLine e : state.get().entryList) { if (e.prefix != null) out.append(e.prefix); if (e.section != null && e.name == null) { @@ -1452,7 +1452,7 @@ public class Config { private int pos; - StringReader(final String in) { + StringReader(String in) { buf = in.toCharArray(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java index 011cecccac..937ba925c5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java @@ -73,7 +73,7 @@ class ConfigLine { /** The text content after entry. */ String suffix; - ConfigLine forValue(final String newValue) { + ConfigLine forValue(String newValue) { final ConfigLine e = new ConfigLine(); e.prefix = prefix; e.section = section; @@ -91,7 +91,7 @@ class ConfigLine { && eqIgnoreCase(name, aKey); } - boolean match(final String aSection, final String aSubsection) { + boolean match(String aSection, String aSubsection) { return eqIgnoreCase(section, aSection) && eqSameCase(subsection, aSubsection); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java index 89aef7fcf4..891c7f23b4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java @@ -271,7 +271,7 @@ public class DefaultTypedConfigGetter implements TypedConfigGetter { } private static boolean match(String a, String... cases) { - for (final String b : cases) { + for (String b : cases) { if (b != null && b.equalsIgnoreCase(a)) { return true; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java index 3abdc0c41a..93add5c661 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java @@ -122,7 +122,7 @@ public abstract class ObjectDatabase { * the object store cannot be accessed. */ public boolean has(AnyObjectId objectId) throws IOException { - try (final ObjectReader or = newReader()) { + try (ObjectReader or = newReader()) { return or.has(objectId); } } @@ -172,7 +172,7 @@ public abstract class ObjectDatabase { public ObjectLoader open(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException { - try (final ObjectReader or = newReader()) { + try (ObjectReader or = newReader()) { return or.open(objectId, typeHint); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java index 90a0350dd7..71ee96363c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java @@ -116,7 +116,7 @@ public abstract class RefWriter { public void writeInfoRefs() throws IOException { final StringWriter w = new StringWriter(); final char[] tmp = new char[Constants.OBJECT_ID_STRING_LENGTH]; - for (final Ref r : refs) { + for (Ref r : refs) { if (Constants.HEAD.equals(r.getName())) { // Historically HEAD has never been published through // the INFO_REFS file. This is a mistake, but its the @@ -161,7 +161,7 @@ public abstract class RefWriter { */ public void writePackedRefs() throws IOException { boolean peeled = false; - for (final Ref r : refs) { + for (Ref r : refs) { if (r.getStorage().isPacked() && r.isPeeled()) { peeled = true; break; @@ -177,7 +177,7 @@ public abstract class RefWriter { } final char[] tmp = new char[Constants.OBJECT_ID_STRING_LENGTH]; - for (final Ref r : refs) { + for (Ref r : refs) { if (r.getStorage() != Ref.Storage.PACKED) continue; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java index 08f0a8a629..4aeacf5082 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java @@ -116,13 +116,13 @@ public class StrategySimpleTwoWayInCore extends ThreeWayMergeStrategy { private ObjectId resultTree; - InCoreMerger(final Repository local) { + InCoreMerger(Repository local) { super(local); tw = new NameConflictTreeWalk(local, reader); cache = DirCache.newInCore(); } - InCoreMerger(final ObjectInserter inserter) { + InCoreMerger(ObjectInserter inserter) { super(inserter); tw = new NameConflictTreeWalk(null, reader); cache = DirCache.newInCore(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/BinaryHunk.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/BinaryHunk.java index 079d6f6d67..95391ec565 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/BinaryHunk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/BinaryHunk.java @@ -80,7 +80,7 @@ public class BinaryHunk { /** Inflated length of the data. */ private int length; - BinaryHunk(final FileHeader fh, final int offset) { + BinaryHunk(FileHeader fh, int offset) { file = fh; startOffset = offset; } @@ -139,7 +139,7 @@ public class BinaryHunk { return length; } - int parseHunk(int ptr, final int end) { + int parseHunk(int ptr, int end) { final byte[] buf = file.buf; if (match(buf, ptr, LITERAL) >= 0) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java index 0f8f7aad02..34075787fb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java @@ -69,7 +69,7 @@ public class CombinedFileHeader extends FileHeader { private FileMode[] oldModes; - CombinedFileHeader(final byte[] b, final int offset) { + CombinedFileHeader(byte[] b, int offset) { super(b, offset); } @@ -154,7 +154,7 @@ public class CombinedFileHeader extends FileHeader { } @Override - int parseGitHeaders(int ptr, final int end) { + int parseGitHeaders(int ptr, int end) { while (ptr < end) { final int eol = nextLF(buf, ptr); if (isHunkHdr(buf, ptr, end) >= 1) { @@ -220,7 +220,7 @@ public class CombinedFileHeader extends FileHeader { } @Override - HunkHeader newHunkHeader(final int offset) { + HunkHeader newHunkHeader(int offset) { return new CombinedHunkHeader(this, offset); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java index 3f27bb3b2c..d278132c61 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java @@ -64,7 +64,7 @@ public class CombinedHunkHeader extends HunkHeader { private CombinedOldImage[] old; - CombinedHunkHeader(final CombinedFileHeader fh, final int offset) { + CombinedHunkHeader(CombinedFileHeader fh, int offset) { super(fh, offset, null); old = new CombinedOldImage[fh.getParentCount()]; for (int i = 0; i < old.length; i++) { @@ -125,11 +125,11 @@ public class CombinedHunkHeader extends HunkHeader { } @Override - int parseBody(final Patch script, final int end) { + int parseBody(Patch script, int end) { final byte[] buf = file.buf; int c = nextLF(buf, startOffset); - for (final CombinedOldImage o : old) { + for (CombinedOldImage o : old) { o.nDeleted = 0; o.nAdded = 0; o.nContext = 0; @@ -207,7 +207,7 @@ public class CombinedHunkHeader extends HunkHeader { } @Override - void extractFileLines(final OutputStream[] out) throws IOException { + void extractFileLines(OutputStream[] out) throws IOException { final byte[] buf = file.buf; int ptr = startOffset; int eol = nextLF(buf, ptr); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java index 32cf642305..d0a5216e1e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java @@ -155,7 +155,7 @@ public class FileHeader extends DiffEntry { addHunk(new HunkHeader(this, edits)); } - FileHeader(final byte[] b, final int offset) { + FileHeader(byte[] b, int offset) { buf = b; startOffset = offset; changeType = ChangeType.MODIFY; // unless otherwise designated @@ -264,7 +264,7 @@ public class FileHeader extends DiffEntry { final String[] files = extractFileLines(charsetGuess); final int[] offsets = new int[files.length]; - for (final HunkHeader h : getHunks()) + for (HunkHeader h : getHunks()) h.extractFileLines(r, files, offsets); return r.toString(); } @@ -284,7 +284,7 @@ public class FileHeader extends DiffEntry { try { for (int i = 0; i < tmp.length; i++) tmp[i] = new TemporaryBuffer.Heap(Integer.MAX_VALUE); - for (final HunkHeader h : getHunks()) + for (HunkHeader h : getHunks()) h.extractFileLines(tmp); final String[] r = new String[tmp.length]; @@ -329,7 +329,7 @@ public class FileHeader extends DiffEntry { return hunks; } - void addHunk(final HunkHeader h) { + void addHunk(HunkHeader h) { if (h.getFileHeader() != this) throw new IllegalArgumentException(JGitText.get().hunkBelongsToAnotherFile); if (hunks == null) @@ -337,7 +337,7 @@ public class FileHeader extends DiffEntry { hunks.add(h); } - HunkHeader newHunkHeader(final int offset) { + HunkHeader newHunkHeader(int offset) { return new HunkHeader(this, offset); } @@ -370,7 +370,7 @@ public class FileHeader extends DiffEntry { */ public EditList toEditList() { final EditList r = new EditList(); - for (final HunkHeader hunk : hunks) + for (HunkHeader hunk : hunks) r.addAll(hunk.toEditList()); return r; } @@ -384,7 +384,7 @@ public class FileHeader extends DiffEntry { * one past the last position to parse. * @return first character after the LF at the end of the line; -1 on error. */ - int parseGitFileName(int ptr, final int end) { + int parseGitFileName(int ptr, int end) { final int eol = nextLF(buf, ptr); final int bol = ptr; if (eol >= end) { @@ -444,7 +444,7 @@ public class FileHeader extends DiffEntry { return eol; } - int parseGitHeaders(int ptr, final int end) { + int parseGitHeaders(int ptr, int end) { while (ptr < end) { final int eol = nextLF(buf, ptr); if (isHunkHdr(buf, ptr, eol) >= 1) { @@ -514,25 +514,25 @@ public class FileHeader extends DiffEntry { return ptr; } - void parseOldName(int ptr, final int eol) { + void parseOldName(int ptr, int eol) { oldPath = p1(parseName(oldPath, ptr + OLD_NAME.length, eol)); if (oldPath == DEV_NULL) changeType = ChangeType.ADD; } - void parseNewName(int ptr, final int eol) { + void parseNewName(int ptr, int eol) { newPath = p1(parseName(newPath, ptr + NEW_NAME.length, eol)); if (newPath == DEV_NULL) changeType = ChangeType.DELETE; } - void parseNewFileMode(int ptr, final int eol) { + void parseNewFileMode(int ptr, int eol) { oldMode = FileMode.MISSING; newMode = parseFileMode(ptr + NEW_FILE_MODE.length, eol); changeType = ChangeType.ADD; } - int parseTraditionalHeaders(int ptr, final int end) { + int parseTraditionalHeaders(int ptr, int end) { while (ptr < end) { final int eol = nextLF(buf, ptr); if (isHunkHdr(buf, ptr, eol) >= 1) { @@ -585,7 +585,7 @@ public class FileHeader extends DiffEntry { return s > 0 ? r.substring(s + 1) : r; } - FileMode parseFileMode(int ptr, final int end) { + FileMode parseFileMode(int ptr, int end) { int tmp = 0; while (ptr < end - 1) { tmp <<= 3; @@ -594,7 +594,7 @@ public class FileHeader extends DiffEntry { return FileMode.fromBits(tmp); } - void parseIndexLine(int ptr, final int end) { + void parseIndexLine(int ptr, int end) { // "index $asha1..$bsha1[ $mode]" where $asha1 and $bsha1 // can be unique abbreviations // @@ -636,7 +636,7 @@ public class FileHeader extends DiffEntry { * for a 3 way-merge returns 3. If this is not a hunk header, 0 is * returned instead. */ - static int isHunkHdr(final byte[] buf, final int start, final int end) { + static int isHunkHdr(byte[] buf, int start, int end) { int ptr = start; while (ptr < end && buf[ptr] == '@') ptr++; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java index d022d47833..1458945c31 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java @@ -120,7 +120,7 @@ public class HunkHeader { private EditList editList; - HunkHeader(final FileHeader fh, final int offset) { + HunkHeader(FileHeader fh, int offset) { this(fh, offset, new OldImage() { @Override public AbbreviatedObjectId getId() { @@ -129,13 +129,13 @@ public class HunkHeader { }); } - HunkHeader(final FileHeader fh, final int offset, final OldImage oi) { + HunkHeader(FileHeader fh, int offset, OldImage oi) { file = fh; startOffset = offset; old = oi; } - HunkHeader(final FileHeader fh, final EditList editList) { + HunkHeader(FileHeader fh, EditList editList) { this(fh, fh.buf.length); this.editList = editList; endOffset = startOffset; @@ -293,7 +293,7 @@ public class HunkHeader { newLineCount = 1; } - int parseBody(final Patch script, final int end) { + int parseBody(Patch script, int end) { final byte[] buf = file.buf; int c = nextLF(buf, startOffset), last = c; @@ -359,7 +359,7 @@ public class HunkHeader { return c; } - void extractFileLines(final OutputStream[] out) throws IOException { + void extractFileLines(OutputStream[] out) throws IOException { final byte[] buf = file.buf; int ptr = startOffset; int eol = nextLF(buf, ptr); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java index 3a77387f23..052f2a7906 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java @@ -373,17 +373,17 @@ public class Patch { return c; } - void warn(final byte[] buf, final int ptr, final String msg) { + void warn(byte[] buf, int ptr, String msg) { addError(new FormatError(buf, ptr, FormatError.Severity.WARNING, msg)); } - void error(final byte[] buf, final int ptr, final String msg) { + void error(byte[] buf, int ptr, String msg) { addError(new FormatError(buf, ptr, FormatError.Severity.ERROR, msg)); } private static boolean matchAny(final byte[] buf, final int c, final byte[][] srcs) { - for (final byte[] s : srcs) { + for (byte[] s : srcs) { if (match(buf, c, s) >= 0) return true; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java index c12acb40c2..58e2106fe2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java @@ -99,7 +99,7 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> { final TColor myColor = laneColor(myLane); int maxCenter = myLaneX; - for (final TLane passingLane : (TLane[]) commit.passingLanes) { + for (TLane passingLane : (TLane[]) commit.passingLanes) { final int cx = laneC(passingLane); final TColor c = laneColor(passingLane); drawLine(c, cx, 0, cx, h, LINE_WIDTH); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java index fecc48d551..9914b0c991 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java @@ -88,15 +88,15 @@ public class PlotCommit<L extends PlotLane> extends RevCommit { refs = NO_REFS; } - void addForkingOffLane(final PlotLane f) { + void addForkingOffLane(PlotLane f) { forkingOffLanes = addLane(f, forkingOffLanes); } - void addPassingLane(final PlotLane c) { + void addPassingLane(PlotLane c) { passingLanes = addLane(c, passingLanes); } - void addMergingLane(final PlotLane m) { + void addMergingLane(PlotLane m) { mergingLanes = addLane(m, mergingLanes); } @@ -115,7 +115,7 @@ public class PlotCommit<L extends PlotLane> extends RevCommit { return lanes; } - void addChild(final PlotCommit c) { + void addChild(PlotCommit c) { final int cnt = children.length; if (cnt == 0) children = new PlotCommit[] { c }; @@ -164,7 +164,7 @@ public class PlotCommit<L extends PlotLane> extends RevCommit { * @return true if the given commit built on top of this commit. */ public final boolean isChild(PlotCommit c) { - for (final PlotCommit a : children) + for (PlotCommit a : children) if (a == c) return true; return false; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java index d952fa67ea..5e153164ad 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java @@ -120,7 +120,7 @@ public class PlotCommitList<L extends PlotLane> extends @SuppressWarnings("unchecked") public void findPassingThrough(final PlotCommit<L> currCommit, final Collection<L> result) { - for (final PlotLane p : currCommit.passingLanes) + for (PlotLane p : currCommit.passingLanes) result.add((L) p); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockObjQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockObjQueue.java index 371cd06dda..fcdf79520a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockObjQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockObjQueue.java @@ -55,7 +55,7 @@ class BlockObjQueue { free = new BlockFreeList(); } - void add(final RevObject c) { + void add(RevObject c) { Block b = tail; if (b == null) { b = free.newBlock(); @@ -98,7 +98,7 @@ class BlockObjQueue { return b; } - void freeBlock(final Block b) { + void freeBlock(Block b) { b.next = next; next = b; } @@ -127,7 +127,7 @@ class BlockObjQueue { return headIndex == tailIndex; } - void add(final RevObject c) { + void add(RevObject c) { objects[tailIndex++] = c; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java index 31612ff66a..79307b5b7c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java @@ -58,7 +58,7 @@ abstract class BlockRevQueue extends AbstractRevQueue { free = new BlockFreeList(); } - BlockRevQueue(final Generator s) throws MissingObjectException, + BlockRevQueue(Generator s) throws MissingObjectException, IncorrectObjectTypeException, IOException { free = new BlockFreeList(); outputType = s.outputType(); @@ -101,7 +101,7 @@ abstract class BlockRevQueue extends AbstractRevQueue { return b; } - void freeBlock(final Block b) { + void freeBlock(Block b) { b.next = next; next = b; } @@ -138,11 +138,11 @@ abstract class BlockRevQueue extends AbstractRevQueue { return headIndex > 0; } - void add(final RevCommit c) { + void add(RevCommit c) { commits[tailIndex++] = c; } - void unpop(final RevCommit c) { + void unpop(RevCommit c) { commits[--headIndex] = c; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BoundaryGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BoundaryGenerator.java index 6be0c8584e..0fd6621e62 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BoundaryGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BoundaryGenerator.java @@ -54,7 +54,7 @@ class BoundaryGenerator extends Generator { Generator g; - BoundaryGenerator(final RevWalk w, final Generator s) { + BoundaryGenerator(RevWalk w, Generator s) { g = new InitialGenerator(w, s); } @@ -64,7 +64,7 @@ class BoundaryGenerator extends Generator { } @Override - void shareFreeList(final BlockRevQueue q) { + void shareFreeList(BlockRevQueue q) { g.shareFreeList(q); } @@ -85,7 +85,7 @@ class BoundaryGenerator extends Generator { private final Generator source; - InitialGenerator(final RevWalk w, final Generator s) { + InitialGenerator(RevWalk w, Generator s) { walk = w; held = new FIFORevQueue(); source = s; @@ -98,7 +98,7 @@ class BoundaryGenerator extends Generator { } @Override - void shareFreeList(final BlockRevQueue q) { + void shareFreeList(BlockRevQueue q) { q.shareFreeList(held); } @@ -107,7 +107,7 @@ class BoundaryGenerator extends Generator { IncorrectObjectTypeException, IOException { RevCommit c = source.next(); if (c != null) { - for (final RevCommit p : c.parents) + for (RevCommit p : c.parents) if ((p.flags & UNINTERESTING) != 0) held.add(p); return c; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java index 795bdf1951..b86e876201 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java @@ -76,7 +76,7 @@ public class DateRevQueue extends AbstractRevQueue { super(); } - DateRevQueue(final Generator s) throws MissingObjectException, + DateRevQueue(Generator s) throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final RevCommit c = s.next(); @@ -181,7 +181,7 @@ public class DateRevQueue extends AbstractRevQueue { } @Override - boolean everbodyHasFlag(final int f) { + boolean everbodyHasFlag(int f) { for (Entry q = head; q != null; q = q.next) { if ((q.commit.flags & f) == 0) return false; @@ -190,7 +190,7 @@ public class DateRevQueue extends AbstractRevQueue { } @Override - boolean anybodyHasFlag(final int f) { + boolean anybodyHasFlag(int f) { for (Entry q = head; q != null; q = q.next) { if ((q.commit.flags & f) != 0) return true; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DelayRevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DelayRevQueue.java index 4a0d19d60d..c397a01317 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DelayRevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DelayRevQueue.java @@ -69,7 +69,7 @@ final class DelayRevQueue extends Generator { private int size; - DelayRevQueue(final Generator g) { + DelayRevQueue(Generator g) { pending = g; delay = new FIFORevQueue(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthGenerator.java index ad05186354..eaec305b47 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthGenerator.java @@ -113,7 +113,7 @@ class DepthGenerator extends Generator { } @Override - void shareFreeList(final BlockRevQueue q) { + void shareFreeList(BlockRevQueue q) { pending.shareFreeList(q); } @@ -134,7 +134,7 @@ class DepthGenerator extends Generator { int newDepth = c.depth + 1; - for (final RevCommit p : c.parents) { + for (RevCommit p : c.parents) { DepthWalk.Commit dp = (DepthWalk.Commit) p; // If no depth has been assigned to this commit, assign diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java index 1bb8715a33..cdb084c15e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java @@ -63,7 +63,7 @@ public class FIFORevQueue extends BlockRevQueue { super(); } - FIFORevQueue(final Generator s) throws MissingObjectException, + FIFORevQueue(Generator s) throws MissingObjectException, IncorrectObjectTypeException, IOException { super(s); } @@ -139,7 +139,7 @@ public class FIFORevQueue extends BlockRevQueue { } @Override - boolean everbodyHasFlag(final int f) { + boolean everbodyHasFlag(int f) { for (Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) if ((b.commits[i].flags & f) == 0) @@ -149,7 +149,7 @@ public class FIFORevQueue extends BlockRevQueue { } @Override - boolean anybodyHasFlag(final int f) { + boolean anybodyHasFlag(int f) { for (Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) if ((b.commits[i].flags & f) != 0) @@ -158,7 +158,7 @@ public class FIFORevQueue extends BlockRevQueue { return false; } - void removeFlag(final int f) { + void removeFlag(int f) { final int not_f = ~f; for (Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FixUninterestingGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FixUninterestingGenerator.java index 9d734a7296..4e6d7e681d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FixUninterestingGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FixUninterestingGenerator.java @@ -61,7 +61,7 @@ import org.eclipse.jgit.errors.MissingObjectException; final class FixUninterestingGenerator extends Generator { private final Generator pending; - FixUninterestingGenerator(final Generator g) { + FixUninterestingGenerator(Generator g) { pending = g; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java index 567c8465c6..dae3aacb83 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java @@ -95,7 +95,7 @@ public class FollowFilter extends TreeFilter { private RenameCallback renameCallback; - FollowFilter(final PathFilter path, final DiffConfig cfg) { + FollowFilter(PathFilter path, DiffConfig cfg) { this.path = path; this.cfg = cfg; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/Generator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/Generator.java index a95303b641..b2c92ea249 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/Generator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/Generator.java @@ -81,7 +81,7 @@ abstract class Generator { * @param q * another FIFO queue that wants to share our queue's free list. */ - void shareFreeList(final BlockRevQueue q) { + void shareFreeList(BlockRevQueue q) { // Do nothing by default. } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java index cbffd91d70..846b8d92fa 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java @@ -62,7 +62,7 @@ public class LIFORevQueue extends BlockRevQueue { super(); } - LIFORevQueue(final Generator s) throws MissingObjectException, + LIFORevQueue(Generator s) throws MissingObjectException, IncorrectObjectTypeException, IOException { super(s); } @@ -103,7 +103,7 @@ public class LIFORevQueue extends BlockRevQueue { } @Override - boolean everbodyHasFlag(final int f) { + boolean everbodyHasFlag(int f) { for (Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) if ((b.commits[i].flags & f) == 0) @@ -113,7 +113,7 @@ public class LIFORevQueue extends BlockRevQueue { } @Override - boolean anybodyHasFlag(final int f) { + boolean anybodyHasFlag(int f) { for (Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) if ((b.commits[i].flags & f) != 0) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java index 755df58cf8..2fe95318b2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java @@ -84,12 +84,12 @@ class MergeBaseGenerator extends Generator { private CarryStack stack; - MergeBaseGenerator(final RevWalk w) { + MergeBaseGenerator(RevWalk w) { walker = w; pending = new DateRevQueue(); } - void init(final AbstractRevQueue p) throws IOException { + void init(AbstractRevQueue p) throws IOException { try { for (;;) { final RevCommit c = p.next(); @@ -146,7 +146,7 @@ class MergeBaseGenerator extends Generator { return null; } - for (final RevCommit p : c.parents) { + for (RevCommit p : c.parents) { if ((p.flags & IN_PENDING) != 0) continue; if ((p.flags & PARSED) == 0) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/PendingGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/PendingGenerator.java index 94ae2c993c..e607b7daa0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/PendingGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/PendingGenerator.java @@ -140,7 +140,7 @@ class PendingGenerator extends Generator { produce = filter.include(walker, c); } - for (final RevCommit p : c.parents) { + for (RevCommit p : c.parents) { if ((p.flags & SEEN) != 0) continue; if ((p.flags & PARSED) == 0) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java index 14222e9d50..b67f934f6e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java @@ -153,13 +153,13 @@ public class RevCommit extends RevObject { } @Override - void parseHeaders(final RevWalk walk) throws MissingObjectException, + void parseHeaders(RevWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException { parseCanonical(walk, walk.getCachedBytes(this)); } @Override - void parseBody(final RevWalk walk) throws MissingObjectException, + void parseBody(RevWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (buffer == null) { buffer = walk.getCachedBytes(this); @@ -168,7 +168,7 @@ public class RevCommit extends RevObject { } } - void parseCanonical(final RevWalk walk, final byte[] raw) + void parseCanonical(RevWalk walk, byte[] raw) throws IOException { if (!walk.shallowCommitsInitialized) walk.initializeShallowCommits(); @@ -490,7 +490,7 @@ public class RevCommit extends RevObject { return str; } - static boolean hasLF(final byte[] r, int b, final int e) { + static boolean hasLF(byte[] r, int b, int e) { while (b < e) if (r[b++] == '\n') return true; @@ -635,7 +635,7 @@ public class RevCommit extends RevObject { if (src.isEmpty()) return Collections.emptyList(); final ArrayList<String> r = new ArrayList<>(src.size()); - for (final FooterLine f : src) { + for (FooterLine f : src) { if (f.matches(keyName)) r.add(f.getValue()); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java index 1e79867425..413a552962 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java @@ -85,7 +85,7 @@ public class RevFlag { final int mask; - RevFlag(final RevWalk w, final String n, final int m) { + RevFlag(RevWalk w, String n, int m) { walker = w; name = n; mask = m; @@ -107,7 +107,7 @@ public class RevFlag { } static class StaticRevFlag extends RevFlag { - StaticRevFlag(final String n, final int m) { + StaticRevFlag(String n, int m) { super(null, n, m); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java index 1c76fe9c17..eef9bf33e0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java @@ -60,7 +60,7 @@ public abstract class RevObject extends ObjectIdOwnerMap.Entry { int flags; - RevObject(final AnyObjectId name) { + RevObject(AnyObjectId name) { super(name); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java index 42f26d267a..2f21e17455 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java @@ -147,7 +147,7 @@ public class RevObjectList<E extends RevObject> extends AbstractList<E> { final int shift; - Block(final int s) { + Block(int s) { shift = s; } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java index e7fe0f73bc..0050bac0ae 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java @@ -142,13 +142,13 @@ public class RevTag extends RevObject { } @Override - void parseHeaders(final RevWalk walk) throws MissingObjectException, + void parseHeaders(RevWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException { parseCanonical(walk, walk.getCachedBytes(this)); } @Override - void parseBody(final RevWalk walk) throws MissingObjectException, + void parseBody(RevWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (buffer == null) { buffer = walk.getCachedBytes(this); @@ -157,7 +157,7 @@ public class RevTag extends RevObject { } } - void parseCanonical(final RevWalk walk, final byte[] rawTag) + void parseCanonical(RevWalk walk, byte[] rawTag) throws CorruptObjectException { final MutableInteger pos = new MutableInteger(); final int oType; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java index cf278bbbe7..a986cfd8ff 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java @@ -327,7 +327,7 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { public void markStart(Collection<RevCommit> list) throws MissingObjectException, IncorrectObjectTypeException, IOException { - for (final RevCommit c : list) + for (RevCommit c : list) markStart(c); } @@ -1142,7 +1142,7 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { * the flags to carry onto parents, if set on a descendant. */ public void carry(Collection<RevFlag> set) { - for (final RevFlag flag : set) + for (RevFlag flag : set) carry(flag); } @@ -1204,7 +1204,7 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { freeFlag(flag.mask); } - void freeFlag(final int mask) { + void freeFlag(int mask) { retainOnReset &= ~mask; if (isNotStarted()) { freeFlags |= mask; @@ -1264,7 +1264,7 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { */ public final void resetRetain(RevFlag... retainFlags) { int mask = 0; - for (final RevFlag flag : retainFlags) + for (RevFlag flag : retainFlags) mask |= flag.mask; reset(mask); } @@ -1286,7 +1286,7 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { final int clearFlags = ~retainFlags; final FIFORevQueue q = new FIFORevQueue(); - for (final RevCommit c : roots) { + for (RevCommit c : roots) { if ((c.flags & clearFlags) == 0) continue; c.flags &= retainFlags; @@ -1300,7 +1300,7 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { break; if (c.parents == null) continue; - for (final RevCommit p : c.parents) { + for (RevCommit p : c.parents) { if ((p.flags & clearFlags) == 0) continue; p.flags &= retainFlags; @@ -1439,7 +1439,7 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable { return new RevCommit(id); } - void carryFlagsImpl(final RevCommit c) { + void carryFlagsImpl(RevCommit c) { final int carry = c.flags & carryFlags; if (carry != 0) RevCommit.carryFlags(c, carry); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java index bb0955ccfd..1c868ffe08 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java @@ -76,12 +76,12 @@ class RewriteGenerator extends Generator { private final Generator source; - RewriteGenerator(final Generator s) { + RewriteGenerator(Generator s) { source = s; } @Override - void shareFreeList(final BlockRevQueue q) { + void shareFreeList(BlockRevQueue q) { source.shareFreeList(q); } @@ -167,14 +167,14 @@ class RewriteGenerator extends Generator { } if (newCnt == oldList.length) { - for (final RevCommit p : oldList) + for (RevCommit p : oldList) p.flags &= ~DUPLICATE; return oldList; } final RevCommit[] newList = new RevCommit[newCnt]; newCnt = 0; - for (final RevCommit p : oldList) { + for (RevCommit p : oldList) { if (p != null) { newList[newCnt++] = p; p.flags &= ~DUPLICATE; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java index 1ec6290317..eb129a2631 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java @@ -66,7 +66,7 @@ import org.eclipse.jgit.treewalk.filter.TreeFilter; class StartGenerator extends Generator { private final RevWalk walker; - StartGenerator(final RevWalk w) { + StartGenerator(RevWalk w) { walker = w; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TopoSortGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TopoSortGenerator.java index 7b11d04901..645034351f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TopoSortGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TopoSortGenerator.java @@ -69,7 +69,7 @@ class TopoSortGenerator extends Generator { * @throws IncorrectObjectTypeException * @throws IOException */ - TopoSortGenerator(final Generator s) throws MissingObjectException, + TopoSortGenerator(Generator s) throws MissingObjectException, IncorrectObjectTypeException, IOException { pending = new FIFORevQueue(); outputType = s.outputType() | SORT_TOPO; @@ -78,7 +78,7 @@ class TopoSortGenerator extends Generator { final RevCommit c = s.next(); if (c == null) break; - for (final RevCommit p : c.parents) + for (RevCommit p : c.parents) p.inDegree++; pending.add(c); } @@ -90,7 +90,7 @@ class TopoSortGenerator extends Generator { } @Override - void shareFreeList(final BlockRevQueue q) { + void shareFreeList(BlockRevQueue q) { q.shareFreeList(pending); } @@ -113,7 +113,7 @@ class TopoSortGenerator extends Generator { // All of our children have already produced, // so it is OK for us to produce now as well. // - for (final RevCommit p : c.parents) { + for (RevCommit p : c.parents) { if (--p.inDegree == 0 && (p.flags & TOPO_DELAY) != 0) { // This parent tried to come before us, but we are // his last child. unpop the parent so it goes right diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java index 4215f21212..dfb83b491a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java @@ -123,7 +123,7 @@ public abstract class AndRevFilter extends RevFilter { private final boolean requiresCommitBody; - Binary(final RevFilter one, final RevFilter two) { + Binary(RevFilter one, RevFilter two) { a = one; b = two; requiresCommitBody = a.requiresCommitBody() @@ -159,7 +159,7 @@ public abstract class AndRevFilter extends RevFilter { private final boolean requiresCommitBody; - List(final RevFilter[] list) { + List(RevFilter[] list) { subfilters = list; boolean rcb = false; @@ -172,7 +172,7 @@ public abstract class AndRevFilter extends RevFilter { public boolean include(RevWalk walker, RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { - for (final RevFilter f : subfilters) { + for (RevFilter f : subfilters) { if (!f.include(walker, c)) return false; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AuthorRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AuthorRevFilter.java index 8474e6c43f..334d4f0144 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AuthorRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AuthorRevFilter.java @@ -81,7 +81,7 @@ public class AuthorRevFilter { // Don't permit us to be created. } - static RawCharSequence textFor(final RevCommit cmit) { + static RawCharSequence textFor(RevCommit cmit) { final byte[] raw = cmit.getRawBuffer(); final int b = RawParseUtils.author(raw, 0); if (b < 0) @@ -91,7 +91,7 @@ public class AuthorRevFilter { } private static class PatternSearch extends PatternMatchRevFilter { - PatternSearch(final String patternText) { + PatternSearch(String patternText) { super(patternText, true, true, Pattern.CASE_INSENSITIVE); } @@ -107,7 +107,7 @@ public class AuthorRevFilter { } private static class SubStringSearch extends SubStringRevFilter { - SubStringSearch(final String patternText) { + SubStringSearch(String patternText) { super(patternText); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java index 002985b118..38805153ef 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java @@ -127,7 +127,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { final int when; - CommitTimeRevFilter(final long ts) { + CommitTimeRevFilter(long ts) { when = (int) (ts / 1000); } @@ -144,7 +144,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { } private static class Before extends CommitTimeRevFilter { - Before(final long ts) { + Before(long ts) { super(ts); } @@ -163,7 +163,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { } private static class After extends CommitTimeRevFilter { - After(final long ts) { + After(long ts) { super(ts); } @@ -190,7 +190,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { private static class Between extends CommitTimeRevFilter { private final int until; - Between(final long since, final long until) { + Between(long since, long until) { super(since); this.until = (int) (until / 1000); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitterRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitterRevFilter.java index 8d73ce43b8..37c840e379 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitterRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitterRevFilter.java @@ -81,7 +81,7 @@ public class CommitterRevFilter { // Don't permit us to be created. } - static RawCharSequence textFor(final RevCommit cmit) { + static RawCharSequence textFor(RevCommit cmit) { final byte[] raw = cmit.getRawBuffer(); final int b = RawParseUtils.committer(raw, 0); if (b < 0) @@ -91,7 +91,7 @@ public class CommitterRevFilter { } private static class PatternSearch extends PatternMatchRevFilter { - PatternSearch(final String patternText) { + PatternSearch(String patternText) { super(patternText, true, true, Pattern.CASE_INSENSITIVE); } @@ -107,7 +107,7 @@ public class CommitterRevFilter { } private static class SubStringSearch extends SubStringRevFilter { - SubStringSearch(final String patternText) { + SubStringSearch(String patternText) { super(patternText); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/MessageRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/MessageRevFilter.java index 5621e64633..480aaa38eb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/MessageRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/MessageRevFilter.java @@ -81,7 +81,7 @@ public class MessageRevFilter { // Don't permit us to be created. } - static RawCharSequence textFor(final RevCommit cmit) { + static RawCharSequence textFor(RevCommit cmit) { final byte[] raw = cmit.getRawBuffer(); final int b = RawParseUtils.commitMessage(raw, 0); if (b < 0) @@ -90,7 +90,7 @@ public class MessageRevFilter { } private static class PatternSearch extends PatternMatchRevFilter { - PatternSearch(final String patternText) { + PatternSearch(String patternText) { super(patternText, true, true, Pattern.CASE_INSENSITIVE | Pattern.DOTALL); } @@ -107,7 +107,7 @@ public class MessageRevFilter { } private static class SubStringSearch extends SubStringRevFilter { - SubStringSearch(final String patternText) { + SubStringSearch(String patternText) { super(patternText); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java index 97697349f5..1cef12f79c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java @@ -121,7 +121,7 @@ public abstract class OrRevFilter extends RevFilter { private final boolean requiresCommitBody; - Binary(final RevFilter one, final RevFilter two) { + Binary(RevFilter one, RevFilter two) { a = one; b = two; requiresCommitBody = a.requiresCommitBody() @@ -157,7 +157,7 @@ public abstract class OrRevFilter extends RevFilter { private final boolean requiresCommitBody; - List(final RevFilter[] list) { + List(RevFilter[] list) { subfilters = list; boolean rcb = false; @@ -170,7 +170,7 @@ public abstract class OrRevFilter extends RevFilter { public boolean include(RevWalk walker, RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { - for (final RevFilter f : subfilters) { + for (RevFilter f : subfilters) { if (f.include(walker, c)) return true; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFlagFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFlagFilter.java index 4d5690bb14..c67c44b216 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFlagFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFlagFilter.java @@ -78,7 +78,7 @@ public abstract class RevFlagFilter extends RevFilter { */ public static RevFilter hasAll(RevFlag... a) { final RevFlagSet set = new RevFlagSet(); - for (final RevFlag flag : a) + for (RevFlag flag : a) set.add(flag); return new HasAll(set); } @@ -103,7 +103,7 @@ public abstract class RevFlagFilter extends RevFilter { */ public static RevFilter hasAny(RevFlag... a) { final RevFlagSet set = new RevFlagSet(); - for (final RevFlag flag : a) + for (RevFlag flag : a) set.add(flag); return new HasAny(set); } @@ -121,7 +121,7 @@ public abstract class RevFlagFilter extends RevFilter { final RevFlagSet flags; - RevFlagFilter(final RevFlagSet m) { + RevFlagFilter(RevFlagSet m) { flags = m; } @@ -138,7 +138,7 @@ public abstract class RevFlagFilter extends RevFilter { } private static class HasAll extends RevFlagFilter { - HasAll(final RevFlagSet m) { + HasAll(RevFlagSet m) { super(m); } @@ -156,7 +156,7 @@ public abstract class RevFlagFilter extends RevFilter { } private static class HasAny extends RevFlagFilter { - HasAny(final RevFlagSet m) { + HasAny(RevFlagSet m) { super(m); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java index 3df5bdb2c9..a0fc57ca1f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java @@ -135,7 +135,7 @@ public class AmazonS3 { private static String toCleanString(List<String> list) { final StringBuilder s = new StringBuilder(); - for (final String v : list) { + for (String v : list) { if (s.length() > 0) s.append(','); s.append(v.replaceAll("\n", "").trim()); //$NON-NLS-1$ //$NON-NLS-2$ @@ -548,7 +548,7 @@ public class AmazonS3 { return err; } - IOException maxAttempts(final String action, final String key) { + IOException maxAttempts(String action, String key) { return new IOException(MessageFormat.format( JGitText.get().amazonS3ActionFailedGivingUp, action, key, Integer.valueOf(maxAttempts))); @@ -597,10 +597,10 @@ public class AmazonS3 { return c; } - void authorize(final HttpURLConnection c) throws IOException { + void authorize(HttpURLConnection c) throws IOException { final Map<String, List<String>> reqHdr = c.getRequestProperties(); final SortedMap<String, String> sigHdr = new TreeMap<>(); - for (final Map.Entry<String, List<String>> entry : reqHdr.entrySet()) { + for (Map.Entry<String, List<String>> entry : reqHdr.entrySet()) { final String hdr = entry.getKey(); if (isSignedHeader(hdr)) sigHdr.put(StringUtils.toLowerCase(hdr), toCleanString(entry.getValue())); @@ -619,7 +619,7 @@ public class AmazonS3 { s.append(remove(sigHdr, "date")); //$NON-NLS-1$ s.append('\n'); - for (final Map.Entry<String, String> e : sigHdr.entrySet()) { + for (Map.Entry<String, String> e : sigHdr.entrySet()) { s.append(e.getKey()); s.append(':'); s.append(e.getValue()); @@ -644,7 +644,7 @@ public class AmazonS3 { c.setRequestProperty("Authorization", "AWS " + publicKey + ":" + sec); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } - static Properties properties(final File authFile) + static Properties properties(File authFile) throws FileNotFoundException, IOException { final Properties p = new Properties(); try (FileInputStream in = new FileInputStream(authFile)) { @@ -664,7 +664,7 @@ public class AmazonS3 { private StringBuilder data; - ListParser(final String bn, final String p) { + ListParser(String bn, String p) { bucket = bn; prefix = p; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java index 1bda914941..38eae1cd48 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java @@ -122,7 +122,7 @@ abstract class BasePackConnection extends BaseConnection { /** Extra objects the remote has, but which aren't offered as refs. */ protected final Set<ObjectId> additionalHaves = new HashSet<>(); - BasePackConnection(final PackTransport packTransport) { + BasePackConnection(PackTransport packTransport) { transport = (Transport) packTransport; local = transport.local; uri = transport.uri; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java index 6e4b05fe21..0dfcd8716e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java @@ -296,7 +296,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection final boolean minimalNegotiation; - FetchConfig(final Config c) { + FetchConfig(Config c) { allowOfsDelta = c.getBoolean("repack", "usedeltabaseoffset", true); //$NON-NLS-1$ //$NON-NLS-2$ minimalNegotiation = c.getBoolean("fetch", "useminimalnegotiation", //$NON-NLS-1$ //$NON-NLS-2$ false); @@ -420,7 +420,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection private int maxTimeWanted(Collection<Ref> wants) { int maxTime = 0; - for (final Ref r : wants) { + for (Ref r : wants) { try { final RevObject obj = walk.parseAny(r.getObjectId()); if (obj instanceof RevCommit) { @@ -492,7 +492,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection private boolean sendWants(Collection<Ref> want) throws IOException { final PacketLineOut p = statelessRPC ? pckState : pckOut; boolean first = true; - for (final Ref r : want) { + for (Ref r : want) { ObjectId objectId = r.getObjectId(); if (objectId == null) { continue; @@ -806,7 +806,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection } private void markRefsAdvertised() { - for (final Ref r : getRefs()) { + for (Ref r : getRefs()) { markAdvertised(r.getObjectId()); if (r.getPeeledObjectId() != null) markAdvertised(r.getPeeledObjectId()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java index 5624377b7a..69624ff7a3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java @@ -256,7 +256,7 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen pushOptions.toString())); } - for (final RemoteRefUpdate rru : refUpdates) { + for (RemoteRefUpdate rru : refUpdates) { if (!capableDeleteRefs && rru.isDelete()) { rru.setStatus(Status.REJECTED_NODELETE); continue; @@ -294,7 +294,7 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen } private void transmitOptions() throws IOException { - for (final String pushOption : pushOptions) { + for (String pushOption : pushOptions) { pckOut.writeString(pushOption); } @@ -332,17 +332,17 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen Set<ObjectId> remoteObjects = new HashSet<>(); Set<ObjectId> newObjects = new HashSet<>(); - try (final PackWriter writer = new PackWriter(transport.getPackConfig(), + try (PackWriter writer = new PackWriter(transport.getPackConfig(), local.newObjectReader())) { - for (final Ref r : getRefs()) { + for (Ref r : getRefs()) { // only add objects that we actually have ObjectId oid = r.getObjectId(); if (local.hasObject(oid)) remoteObjects.add(oid); } remoteObjects.addAll(additionalHaves); - for (final RemoteRefUpdate r : refUpdates.values()) { + for (RemoteRefUpdate r : refUpdates.values()) { if (!ObjectId.zeroId().equals(r.getNewObjectId())) newObjects.add(r.getNewObjectId()); } @@ -411,7 +411,7 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen rru.setMessage(message); } } - for (final RemoteRefUpdate rru : refUpdates.values()) { + for (RemoteRefUpdate rru : refUpdates.values()) { if (rru.getStatus() == Status.AWAITING_REPORT) throw new PackProtocolException(MessageFormat.format( JGitText.get().expectedReportForRefNotReceived , uri, rru.getRemoteName())); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java index d78751f894..c426e3c05d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java @@ -340,7 +340,7 @@ public abstract class BaseReceivePack { final long maxDiscardBytes; final SignedPushConfig signedPush; - ReceiveConfig(final Config config) { + ReceiveConfig(Config config) { allowCreates = true; allowDeletes = !config.getBoolean("receive", "denydeletes", false); //$NON-NLS-1$ //$NON-NLS-2$ allowNonFastForwards = !config.getBoolean("receive", //$NON-NLS-1$ @@ -1440,7 +1440,7 @@ public abstract class BaseReceivePack { * @return {@code true} if a pack is expected based on the list of commands. */ protected boolean needPack() { - for (final ReceiveCommand cmd : commands) { + for (ReceiveCommand cmd : commands) { if (cmd.getType() != ReceiveCommand.Type.DELETE) return true; } @@ -1526,21 +1526,21 @@ public abstract class BaseReceivePack { } parser = null; - try (final ObjectWalk ow = new ObjectWalk(db)) { + try (ObjectWalk ow = new ObjectWalk(db)) { if (baseObjects != null) { ow.sort(RevSort.TOPO); if (!baseObjects.isEmpty()) ow.sort(RevSort.BOUNDARY, true); } - for (final ReceiveCommand cmd : commands) { + for (ReceiveCommand cmd : commands) { if (cmd.getResult() != Result.NOT_ATTEMPTED) continue; if (cmd.getType() == ReceiveCommand.Type.DELETE) continue; ow.markStart(ow.parseAny(cmd.getNewId())); } - for (final ObjectId have : advertisedHaves) { + for (ObjectId have : advertisedHaves) { RevObject o = ow.parseAny(have); ow.markUninteresting(o); @@ -1596,7 +1596,7 @@ public abstract class BaseReceivePack { * Validate the command list. */ protected void validateCommands() { - for (final ReceiveCommand cmd : commands) { + for (ReceiveCommand cmd : commands) { final Ref ref = cmd.getRef(); if (cmd.getResult() != Result.NOT_ATTEMPTED) continue; @@ -1815,7 +1815,7 @@ public abstract class BaseReceivePack { if (unpackError != null) { out.sendString("unpack error " + unpackError.getMessage()); //$NON-NLS-1$ if (forClient) { - for (final ReceiveCommand cmd : commands) { + for (ReceiveCommand cmd : commands) { out.sendString("ng " + cmd.getRefName() //$NON-NLS-1$ + " n/a (unpacker error)"); //$NON-NLS-1$ } @@ -1825,7 +1825,7 @@ public abstract class BaseReceivePack { if (forClient) out.sendString("unpack ok"); //$NON-NLS-1$ - for (final ReceiveCommand cmd : commands) { + for (ReceiveCommand cmd : commands) { if (cmd.getResult() == Result.OK) { if (forClient) out.sendString("ok " + cmd.getRefName()); //$NON-NLS-1$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java index 2002c9199e..449f529447 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java @@ -96,7 +96,7 @@ class BundleFetchConnection extends BaseFetchConnection { private PackLock packLock; - BundleFetchConnection(Transport transportBundle, final InputStream src) throws TransportException { + BundleFetchConnection(Transport transportBundle, InputStream src) throws TransportException { transport = transportBundle; bin = new BufferedInputStream(src); try { @@ -226,13 +226,13 @@ class BundleFetchConnection extends BaseFetchConnection { if (prereqs.isEmpty()) return; - try (final RevWalk rw = new RevWalk(transport.local)) { + try (RevWalk rw = new RevWalk(transport.local)) { final RevFlag PREREQ = rw.newFlag("PREREQ"); //$NON-NLS-1$ final RevFlag SEEN = rw.newFlag("SEEN"); //$NON-NLS-1$ final Map<ObjectId, String> missing = new HashMap<>(); final List<RevObject> commits = new ArrayList<>(); - for (final Map.Entry<ObjectId, String> e : prereqs.entrySet()) { + for (Map.Entry<ObjectId, String> e : prereqs.entrySet()) { ObjectId p = e.getKey(); try { final RevCommit c = rw.parseCommit(p); @@ -258,7 +258,7 @@ class BundleFetchConnection extends BaseFetchConnection { } catch (IOException e) { throw new TransportException(transport.uri, e.getMessage(), e); } - for (final Ref r : localRefs) { + for (Ref r : localRefs) { try { rw.markStart(rw.parseCommit(r.getObjectId())); } catch (IOException readError) { @@ -282,7 +282,7 @@ class BundleFetchConnection extends BaseFetchConnection { } if (remaining > 0) { - for (final RevObject o : commits) { + for (RevObject o : commits) { if (!o.has(SEEN)) missing.put(o, prereqs.get(o)); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java index 5779b0d75e..f2a261bbe6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java @@ -221,7 +221,7 @@ public class BundleWriter { final HashSet<ObjectId> inc = new HashSet<>(); final HashSet<ObjectId> exc = new HashSet<>(); inc.addAll(include.values()); - for (final RevCommit r : assume) + for (RevCommit r : assume) exc.add(r.getId()); packWriter.setIndexDisabled(true); packWriter.setDeltaBaseAsOffset(true); @@ -236,7 +236,7 @@ public class BundleWriter { w.write('\n'); final char[] tmp = new char[Constants.OBJECT_ID_STRING_LENGTH]; - for (final RevCommit a : assume) { + for (RevCommit a : assume) { w.write('-'); a.copyTo(tmp, w); if (a.getRawBuffer() != null) { @@ -245,7 +245,7 @@ public class BundleWriter { } w.write('\n'); } - for (final Map.Entry<String, ObjectId> e : include.entrySet()) { + for (Map.Entry<String, ObjectId> e : include.entrySet()) { e.getValue().copyTo(tmp, w); w.write(' '); w.write(e.getKey()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java index 6563905282..7289ce7b6c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java @@ -209,7 +209,7 @@ public class Daemon { public synchronized DaemonService getService(String name) { if (!name.startsWith("git-")) //$NON-NLS-1$ name = "git-" + name; //$NON-NLS-1$ - for (final DaemonService s : services) { + for (DaemonService s : services) { if (s.getCommandName().equals(name)) return s; } @@ -420,7 +420,7 @@ public class Daemon { } } - void startClient(final Socket s) { + void startClient(Socket s) { final DaemonClient dc = new DaemonClient(this); final SocketAddress peer = s.getRemoteSocketAddress(); @@ -454,8 +454,8 @@ public class Daemon { }.start(); } - synchronized DaemonService matchService(final String cmd) { - for (final DaemonService d : services) { + synchronized DaemonService matchService(String cmd) { + for (DaemonService d : services) { if (d.handles(cmd)) return d; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonClient.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonClient.java index 65b2dc61e7..51c4918f56 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonClient.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonClient.java @@ -68,11 +68,11 @@ public class DaemonClient { private OutputStream rawOut; - DaemonClient(final Daemon d) { + DaemonClient(Daemon d) { daemon = d; } - void setRemoteAddress(final InetAddress ia) { + void setRemoteAddress(InetAddress ia) { peer = ia; } @@ -112,7 +112,7 @@ public class DaemonClient { return rawOut; } - void execute(final Socket sock) throws IOException, + void execute(Socket sock) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { rawIn = new BufferedInputStream(sock.getInputStream()); rawOut = new BufferedOutputStream(sock.getOutputStream()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java index 1b24f404d2..6d2bee8dc3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java @@ -67,7 +67,7 @@ public abstract class DaemonService { private boolean overridable; - DaemonService(final String cmdName, final String cfgName) { + DaemonService(String cmdName, String cfgName) { command = cmdName.startsWith("git-") ? cmdName : "git-" + cmdName; //$NON-NLS-1$ //$NON-NLS-2$ configKey = cfg -> new ServiceConfig(DaemonService.this, cfg, cfgName); overridable = true; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchHeadRecord.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchHeadRecord.java index 421ef21073..34ab361c74 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchHeadRecord.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchHeadRecord.java @@ -63,7 +63,7 @@ class FetchHeadRecord { URIish sourceURI; - void write(final Writer pw) throws IOException { + void write(Writer pw) throws IOException { final String type; final String name; if (sourceName.startsWith(R_HEADS)) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java index 1ef1900571..51f900b246 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java @@ -106,12 +106,12 @@ class FetchProcess { private Map<String, Ref> localRefs; - FetchProcess(final Transport t, final Collection<RefSpec> f) { + FetchProcess(Transport t, Collection<RefSpec> f) { transport = t; toFetch = f; } - void execute(final ProgressMonitor monitor, final FetchResult result) + void execute(ProgressMonitor monitor, FetchResult result) throws NotSupportedException, TransportException { askFor.clear(); localUpdates.clear(); @@ -123,7 +123,7 @@ class FetchProcess { executeImp(monitor, result); } finally { try { - for (final PackLock lock : packLocks) + for (PackLock lock : packLocks) lock.unlock(); } catch (IOException e) { throw new TransportException(e.getMessage(), e); @@ -139,7 +139,7 @@ class FetchProcess { result.setAdvertisedRefs(transport.getURI(), conn.getRefsMap()); result.peerUserAgent = conn.getPeerUserAgent(); final Set<Ref> matched = new HashSet<>(); - for (final RefSpec spec : toFetch) { + for (RefSpec spec : toFetch) { if (spec.getSource() == null) throw new TransportException(MessageFormat.format( JGitText.get().sourceRefNotSpecifiedForRefspec, spec)); @@ -176,7 +176,7 @@ class FetchProcess { // have.addAll(askFor.keySet()); askFor.clear(); - for (final Ref r : additionalTags) { + for (Ref r : additionalTags) { ObjectId id = r.getPeeledObjectId(); if (id == null) id = r.getObjectId(); @@ -198,7 +198,7 @@ class FetchProcess { .newBatchUpdate() .setAllowNonFastForwards(true) .setRefLogMessage("fetch", true); //$NON-NLS-1$ - try (final RevWalk walk = new RevWalk(transport.local)) { + try (RevWalk walk = new RevWalk(transport.local)) { if (monitor instanceof BatchingProgressMonitor) { ((BatchingProgressMonitor) monitor).setDelayStart( 250, TimeUnit.MILLISECONDS); @@ -277,12 +277,12 @@ class FetchProcess { // new connection has offered to us. // final HashMap<ObjectId, Ref> avail = new HashMap<>(); - for (final Ref r : conn.getRefs()) + for (Ref r : conn.getRefs()) avail.put(r.getObjectId(), r); final Collection<Ref> wants = new ArrayList<>(askFor.values()); askFor.clear(); - for (final Ref want : wants) { + for (Ref want : wants) { final Ref newRef = avail.get(want.getObjectId()); if (newRef != null) { askFor.put(newRef.getObjectId(), newRef); @@ -320,7 +320,7 @@ class FetchProcess { if (lock.lock()) { try (Writer w = new OutputStreamWriter( lock.getOutputStream())) { - for (final FetchHeadRecord h : fetchHeadUpdates) { + for (FetchHeadRecord h : fetchHeadUpdates) { h.write(w); result.add(h); } @@ -334,10 +334,10 @@ class FetchProcess { private boolean askForIsComplete() throws TransportException { try { - try (final ObjectWalk ow = new ObjectWalk(transport.local)) { - for (final ObjectId want : askFor.keySet()) + try (ObjectWalk ow = new ObjectWalk(transport.local)) { + for (ObjectId want : askFor.keySet()) ow.markStart(ow.parseAny(want)); - for (final Ref ref : localRefs().values()) + for (Ref ref : localRefs().values()) ow.markUninteresting(ow.parseAny(ref.getObjectId())); ow.checkConnectivity(); } @@ -351,7 +351,7 @@ class FetchProcess { private void expandWildcard(RefSpec spec, Set<Ref> matched) throws TransportException { - for (final Ref src : conn.getRefs()) { + for (Ref src : conn.getRefs()) { if (spec.matchSource(src) && matched.add(src)) want(src, spec.expandFromSource(src)); } @@ -377,7 +377,7 @@ class FetchProcess { private Collection<Ref> expandAutoFollowTags() throws TransportException { final Collection<Ref> additionalTags = new ArrayList<>(); final Map<String, Ref> haveRefs = localRefs(); - for (final Ref r : conn.getRefs()) { + for (Ref r : conn.getRefs()) { if (!isTag(r)) continue; @@ -401,7 +401,7 @@ class FetchProcess { private void expandFetchTags() throws TransportException { final Map<String, Ref> haveRefs = localRefs(); - for (final Ref r : conn.getRefs()) { + for (Ref r : conn.getRefs()) { if (!isTag(r)) { continue; } @@ -479,9 +479,9 @@ class FetchProcess { private void deleteStaleTrackingRefs(FetchResult result, BatchRefUpdate batch) throws IOException { - for (final Ref ref : localRefs().values()) { + for (Ref ref : localRefs().values()) { final String refname = ref.getName(); - for (final RefSpec spec : toFetch) { + for (RefSpec spec : toFetch) { if (spec.matchDestination(refname)) { final RefSpec s = spec.expandFromDestination(refname); if (result.getAdvertisedRef(s.getSource()) == null) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java index 2667ec37ca..ad4c5e9354 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java @@ -68,7 +68,7 @@ public class FetchResult extends OperationResult { submodules = new HashMap<>(); } - void add(final FetchHeadRecord r) { + void add(FetchHeadRecord r) { if (!r.notForMerge) forMerge.add(r); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java index 56b202eab5..fb03190b02 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java @@ -160,10 +160,10 @@ abstract class HttpAuthMethod { final Map<String, List<String>> headers = conn.getHeaderFields(); HttpAuthMethod authentication = Type.NONE.method(EMPTY_STRING); - for (final Entry<String, List<String>> entry : headers.entrySet()) { + for (Entry<String, List<String>> entry : headers.entrySet()) { if (HDR_WWW_AUTHENTICATE.equalsIgnoreCase(entry.getKey())) { if (entry.getValue() != null) { - for (final String value : entry.getValue()) { + for (String value : entry.getValue()) { if (value != null && value.length() != 0) { final String[] valuePart = value.split( SCHEMA_NAME_SEPARATOR, 2); @@ -307,13 +307,13 @@ abstract class HttpAuthMethod { } @Override - void authorize(final String username, final String password) { + void authorize(String username, String password) { this.user = username; this.pass = password; } @Override - void configureRequest(final HttpConnection conn) throws IOException { + void configureRequest(HttpConnection conn) throws IOException { String ident = user + ":" + pass; //$NON-NLS-1$ String enc = Base64.encodeBytes(ident.getBytes(CHARSET)); conn.setRequestProperty(HDR_AUTHORIZATION, type.getSchemeName() @@ -346,14 +346,14 @@ abstract class HttpAuthMethod { } @Override - void authorize(final String username, final String password) { + void authorize(String username, String password) { this.user = username; this.pass = password; } @SuppressWarnings("boxing") @Override - void configureRequest(final HttpConnection conn) throws IOException { + void configureRequest(HttpConnection conn) throws IOException { final Map<String, String> r = new LinkedHashMap<>(); final String realm = params.get("realm"); //$NON-NLS-1$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java index 68757803c0..e3ef832343 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java @@ -145,7 +145,7 @@ public class JschSession implements RemoteSession { * @throws IOException * on problems opening streams */ - JschProcess(final String commandName, int tms) + JschProcess(String commandName, int tms) throws TransportException, IOException { timeout = tms; try { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java index 4cb8393690..f5ccdc8f13 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java @@ -186,7 +186,7 @@ public class OpenSshConfig implements ConfigRepository { /** State read from the config file, plus {@link Host}s created from it. */ private State state; - OpenSshConfig(final File h, final File cfg) { + OpenSshConfig(File h, File cfg) { home = h; configFile = cfg; state = new State(); @@ -211,7 +211,7 @@ public class OpenSshConfig implements ConfigRepository { // Initialize with default entries at the top of the file, before the // first Host block. fullConfig.merge(cache.entries.get(HostEntry.DEFAULT_NAME)); - for (final Map.Entry<String, HostEntry> e : cache.entries.entrySet()) { + for (Map.Entry<String, HostEntry> e : cache.entries.entrySet()) { String key = e.getKey(); if (isHostMatch(key, hostName)) { fullConfig.merge(e.getValue()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java index 0fc24ed9b0..08f7f0d1af 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java @@ -133,12 +133,12 @@ public abstract class OperationResult { return updates.get(localName); } - void setAdvertisedRefs(final URIish u, final Map<String, Ref> ar) { + void setAdvertisedRefs(URIish u, Map<String, Ref> ar) { uri = u; advertisedRefs = ar; } - void add(final TrackingRefUpdate u) { + void add(TrackingRefUpdate u) { updates.put(u.getLocalName(), u); } @@ -158,7 +158,7 @@ public abstract class OperationResult { return messageBuffer != null ? messageBuffer.toString() : ""; //$NON-NLS-1$ } - void addMessages(final String msg) { + void addMessages(String msg) { if (msg != null && msg.length() > 0) { if (messageBuffer == null) messageBuffer = new StringBuilder(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java index 8ac7926dc7..49acb4d9d8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java @@ -873,7 +873,7 @@ public abstract class PackParser { baseObjectIds = new ObjectIdSubclassMap<>(); final List<DeltaChain> missing = new ArrayList<>(64); - for (final DeltaChain baseId : baseById) { + for (DeltaChain baseId : baseById) { if (baseId.head == null) continue; @@ -905,7 +905,7 @@ public abstract class PackParser { JGitText.get().downloadCancelledDuringIndexing); } - for (final DeltaChain base : missing) { + for (DeltaChain base : missing) { if (base.head != null) throw new MissingObjectException(base, "delta base"); //$NON-NLS-1$ } @@ -1232,13 +1232,13 @@ public abstract class PackParser { } // Consume cnt bytes from the buffer. - void use(final int cnt) { + void use(int cnt) { bOffset += cnt; bAvail -= cnt; } // Ensure at least need bytes are available in in {@link #buf}. - int fill(final Source src, final int need) throws IOException { + int fill(Source src, int need) throws IOException { while (bAvail < need) { int next = bOffset + bAvail; int free = buf.length - next; @@ -1661,7 +1661,7 @@ public abstract class PackParser { private static class DeltaChain extends ObjectIdOwnerMap.Entry { UnresolvedDelta head; - DeltaChain(final AnyObjectId id) { + DeltaChain(AnyObjectId id) { super(id); } @@ -1672,7 +1672,7 @@ public abstract class PackParser { return r; } - void add(final UnresolvedDelta d) { + void add(UnresolvedDelta d) { d.next = head; head = d; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java index f64c8efe84..cc556f8af6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java @@ -122,7 +122,7 @@ public class PacketLineIn { this.limit = limit; } - AckNackResult readACK(final MutableObjectId returnedId) throws IOException { + AckNackResult readACK(MutableObjectId returnedId) throws IOException { final String line = readString(); if (line.length() == 0) throw new PackProtocolException(JGitText.get().expectedACKNAKFoundEOF); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java index b7debe2c3e..470a3c046f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java @@ -127,7 +127,7 @@ class PushProcess { this.toPush = new LinkedHashMap<>(); this.out = out; this.pushOptions = transport.getPushOptions(); - for (final RemoteRefUpdate rru : toPush) { + for (RemoteRefUpdate rru : toPush) { if (this.toPush.put(rru.getRemoteName(), rru) != null) throw new TransportException(MessageFormat.format( JGitText.get().duplicateRemoteRefUpdateIsIllegal, rru.getRemoteName())); @@ -150,7 +150,7 @@ class PushProcess { * when some error occurred during operation, like I/O, protocol * error, or local database consistency error. */ - PushResult execute(final ProgressMonitor monitor) + PushResult execute(ProgressMonitor monitor) throws NotSupportedException, TransportException { try { monitor.beginTask(PROGRESS_OPENING_CONNECTION, @@ -176,7 +176,7 @@ class PushProcess { } if (!transport.isDryRun()) updateTrackingRefs(); - for (final RemoteRefUpdate rru : toPush.values()) { + for (RemoteRefUpdate rru : toPush.values()) { final TrackingRefUpdate tru = rru.getTrackingRefUpdate(); if (tru != null) res.add(tru); @@ -191,7 +191,7 @@ class PushProcess { throws TransportException { boolean atomic = transport.isPushAtomic(); final Map<String, RemoteRefUpdate> result = new LinkedHashMap<>(); - for (final RemoteRefUpdate rru : toPush.values()) { + for (RemoteRefUpdate rru : toPush.values()) { final Ref advertisedRef = connection.getRef(rru.getRemoteName()); ObjectId advertisedOld = null; if (advertisedRef != null) { @@ -277,13 +277,13 @@ class PushProcess { } private void modifyUpdatesForDryRun() { - for (final RemoteRefUpdate rru : toPush.values()) + for (RemoteRefUpdate rru : toPush.values()) if (rru.getStatus() == Status.NOT_ATTEMPTED) rru.setStatus(Status.OK); } private void updateTrackingRefs() { - for (final RemoteRefUpdate rru : toPush.values()) { + for (RemoteRefUpdate rru : toPush.values()) { final Status status = rru.getStatus(); if (rru.hasTrackingRefUpdate() && (status == Status.UP_TO_DATE || status == Status.OK)) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java index 5c52f2c3ed..d61aeb04d2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java @@ -818,11 +818,11 @@ public class ReceiveCommand { } } - void setRef(final Ref r) { + void setRef(Ref r) { ref = r; } - void setType(final Type t) { + void setType(Type t) { type = t; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java index 31b75b07f5..35fb0b17a7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java @@ -288,7 +288,7 @@ public class ReceivePack extends BaseReceivePack { if (echoCommandFailures && msgOut != null) { sendStatusReport(false, unpackError, new Reporter() { @Override - void sendString(final String s) throws IOException { + void sendString(String s) throws IOException { msgOut.write(Constants.encode(s + "\n")); //$NON-NLS-1$ } }); @@ -301,7 +301,7 @@ public class ReceivePack extends BaseReceivePack { } sendStatusReport(true, unpackError, new Reporter() { @Override - void sendString(final String s) throws IOException { + void sendString(String s) throws IOException { pckOut.writeString(s + "\n"); //$NON-NLS-1$ } }); @@ -309,7 +309,7 @@ public class ReceivePack extends BaseReceivePack { } else if (msgOut != null) { sendStatusReport(false, unpackError, new Reporter() { @Override - void sendString(final String s) throws IOException { + void sendString(String s) throws IOException { msgOut.write(Constants.encode(s + "\n")); //$NON-NLS-1$ } }); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java index 859ef2c976..b4d7803467 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java @@ -402,7 +402,7 @@ public abstract class RefAdvertiser { first = false; if (!capablities.isEmpty()) { tmpLine.append('\0'); - for (final String capName : capablities) { + for (String capName : capablities) { tmpLine.append(' '); tmpLine.append(capName); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java index 3569761175..0a621f19e1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java @@ -120,7 +120,7 @@ public class RemoteConfig implements Serializable { final List<RemoteConfig> result = new ArrayList<>(names .size()); - for (final String name : names) + for (String name : names) result.add(new RemoteConfig(rc, name)); return result; } @@ -170,12 +170,12 @@ public class RemoteConfig implements Serializable { vlst = rc.getStringList(SECTION, name, KEY_URL); Map<String, String> insteadOf = getReplacements(rc, KEY_INSTEADOF); uris = new ArrayList<>(vlst.length); - for (final String s : vlst) { + for (String s : vlst) { uris.add(new URIish(replaceUri(s, insteadOf))); } String[] plst = rc.getStringList(SECTION, name, KEY_PUSHURL); pushURIs = new ArrayList<>(plst.length); - for (final String s : plst) { + for (String s : plst) { pushURIs.add(new URIish(s)); } if (pushURIs.isEmpty()) { @@ -227,22 +227,22 @@ public class RemoteConfig implements Serializable { final List<String> vlst = new ArrayList<>(); vlst.clear(); - for (final URIish u : getURIs()) + for (URIish u : getURIs()) vlst.add(u.toPrivateString()); rc.setStringList(SECTION, getName(), KEY_URL, vlst); vlst.clear(); - for (final URIish u : getPushURIs()) + for (URIish u : getPushURIs()) vlst.add(u.toPrivateString()); rc.setStringList(SECTION, getName(), KEY_PUSHURL, vlst); vlst.clear(); - for (final RefSpec u : getFetchRefSpecs()) + for (RefSpec u : getFetchRefSpecs()) vlst.add(u.toString()); rc.setStringList(SECTION, getName(), KEY_FETCH, vlst); vlst.clear(); - for (final RefSpec u : getPushRefSpecs()) + for (RefSpec u : getPushRefSpecs()) vlst.add(u.toString()); rc.setStringList(SECTION, getName(), KEY_PUSH, vlst); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java index 2849afe20d..931653fa90 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java @@ -481,7 +481,7 @@ public class RemoteRefUpdate { expectedOldObjectId = id; } - void setStatus(final Status status) { + void setStatus(Status status) { this.status = status; } @@ -489,7 +489,7 @@ public class RemoteRefUpdate { this.fastForward = fastForward; } - void setMessage(final String message) { + void setMessage(String message) { this.message = message; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandProgressMonitor.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandProgressMonitor.java index 365545a092..8a3e4efc93 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandProgressMonitor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandProgressMonitor.java @@ -55,7 +55,7 @@ class SideBandProgressMonitor extends BatchingProgressMonitor { private boolean write; - SideBandProgressMonitor(final OutputStream os) { + SideBandProgressMonitor(OutputStream os) { out = os; write = true; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java index eae8aa06d7..cd17913514 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java @@ -107,7 +107,7 @@ public enum TagOpt { public static TagOpt fromOption(String o) { if (o == null || o.length() == 0) return AUTO_FOLLOW; - for (final TagOpt tagopt : values()) { + for (TagOpt tagopt : values()) { if (tagopt.option().equals(o)) return tagopt; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java index 21c0a92964..4ae1ccb420 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java @@ -132,12 +132,12 @@ public class TransferConfig { final @Nullable ProtocolVersion protocolVersion; final String[] hideRefs; - TransferConfig(final Repository db) { + TransferConfig(Repository db) { this(db.getConfig()); } @SuppressWarnings("nls") - TransferConfig(final Config rc) { + TransferConfig(Config rc) { boolean fsck = rc.getBoolean("transfer", "fsckobjects", false); fetchFsck = rc.getBoolean("fetch", "fsckobjects", fsck); receiveFsck = rc.getBoolean("receive", "fsckobjects", fsck); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java index 0336f47731..d342ef46df 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java @@ -478,7 +478,7 @@ public abstract class Transport implements AutoCloseable { throws NotSupportedException, TransportException { final List<URIish> uris = getURIs(cfg, op); final List<Transport> transports = new ArrayList<>(uris.size()); - for (final URIish uri : uris) { + for (URIish uri : uris) { final Transport tn = open(local, uri, cfg.getName()); tn.applyConfig(cfg); transports.add(tn); @@ -621,7 +621,7 @@ public abstract class Transport implements AutoCloseable { final List<RemoteRefUpdate> result = new LinkedList<>(); final Collection<RefSpec> procRefs = expandPushWildcardsFor(db, specs); - for (final RefSpec spec : procRefs) { + for (RefSpec spec : procRefs) { String srcSpec = spec.getSource(); final Ref srcRef = db.findRef(srcSpec); if (srcRef != null) @@ -691,9 +691,9 @@ public abstract class Transport implements AutoCloseable { final List<Ref> localRefs = db.getRefDatabase().getRefs(); final Collection<RefSpec> procRefs = new LinkedHashSet<>(); - for (final RefSpec spec : specs) { + for (RefSpec spec : specs) { if (spec.isWildcard()) { - for (final Ref localRef : localRefs) { + for (Ref localRef : localRefs) { if (spec.matchSource(localRef)) procRefs.add(spec.expandFromSource(localRef)); } @@ -707,7 +707,7 @@ public abstract class Transport implements AutoCloseable { private static String findTrackingRefName(final String remoteName, final Collection<RefSpec> fetchSpecs) { // try to find matching tracking refs - for (final RefSpec fetchSpec : fetchSpecs) { + for (RefSpec fetchSpec : fetchSpecs) { if (fetchSpec.matchSource(remoteName)) { if (fetchSpec.isWildcard()) return fetchSpec.expandFromSource(remoteName) @@ -1253,9 +1253,9 @@ public abstract class Transport implements AutoCloseable { // object transfer overheads. // final Collection<RefSpec> tmp = new ArrayList<>(toFetch); - for (final RefSpec requested : toFetch) { + for (RefSpec requested : toFetch) { final String reqSrc = requested.getSource(); - for (final RefSpec configured : fetch) { + for (RefSpec configured : fetch) { final String cfgSrc = configured.getSource(); final String cfgDst = configured.getDestination(); if (cfgSrc.equals(reqSrc) && cfgDst != null) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java index 9ddfc46667..6118cb8770 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java @@ -267,7 +267,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { } @Override - WalkRemoteObjectDatabase openAlternate(final String location) + WalkRemoteObjectDatabase openAlternate(String location) throws IOException { return new DatabaseS3(bucketName, resolveKey(location)); } @@ -278,7 +278,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { have.addAll(s3.list(bucket, resolveKey("pack"))); //$NON-NLS-1$ final Collection<String> packs = new ArrayList<>(); - for (final String n : have) { + for (String n : have) { if (!n.startsWith("pack-") || !n.endsWith(".pack")) //$NON-NLS-1$ //$NON-NLS-2$ continue; @@ -290,7 +290,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { } @Override - FileStream open(final String path) throws IOException { + FileStream open(String path) throws IOException { final URLConnection c = s3.get(bucket, resolveKey(path)); final InputStream raw = c.getInputStream(); final InputStream in = s3.decrypt(c); @@ -299,7 +299,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { } @Override - void deleteFile(final String path) throws IOException { + void deleteFile(String path) throws IOException { s3.delete(bucket, resolveKey(path)); } @@ -311,7 +311,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { } @Override - void writeFile(final String path, final byte[] data) throws IOException { + void writeFile(String path, byte[] data) throws IOException { s3.put(bucket, resolveKey(path), data); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java index cbf77bb0b2..1132503643 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java @@ -113,11 +113,11 @@ class TransportGitAnon extends TcpTransport implements PackTransport { } }; - TransportGitAnon(final Repository local, final URIish uri) { + TransportGitAnon(Repository local, URIish uri) { super(local, uri); } - TransportGitAnon(final URIish uri) { + TransportGitAnon(URIish uri) { super(uri); } @@ -163,7 +163,7 @@ class TransportGitAnon extends TcpTransport implements PackTransport { return s; } - void service(final String name, final PacketLineOut pckOut) + void service(String name, PacketLineOut pckOut) throws IOException { final StringBuilder cmd = new StringBuilder(); cmd.append(name); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java index 291b536184..d59fe33df6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java @@ -141,12 +141,12 @@ public class TransportGitSsh extends SshTransport implements PackTransport { } }; - TransportGitSsh(final Repository local, final URIish uri) { + TransportGitSsh(Repository local, URIish uri) { super(local, uri); initSshSessionFactory(); } - TransportGitSsh(final URIish uri) { + TransportGitSsh(URIish uri) { super(uri); initSshSessionFactory(); } @@ -176,7 +176,7 @@ public class TransportGitSsh extends SshTransport implements PackTransport { return new SshPushConnection(); } - String commandFor(final String exe) { + String commandFor(String exe) { String path = uri.getPath(); if (uri.getScheme() != null && uri.getPath().startsWith("/~")) //$NON-NLS-1$ path = (uri.getPath().substring(1)); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java index 7fb206003c..c08f400307 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java @@ -273,7 +273,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, private boolean sslFailure = false; - TransportHttp(final Repository local, final URIish uri) + TransportHttp(Repository local, URIish uri) throws NotSupportedException { super(local, uri); setURI(uri); @@ -314,7 +314,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, * @param uri * @throws NotSupportedException */ - TransportHttp(final URIish uri) throws NotSupportedException { + TransportHttp(URIish uri) throws NotSupportedException { super(uri); setURI(uri); http = new HttpConfig(uri); @@ -903,7 +903,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, class HttpObjectDB extends WalkRemoteObjectDatabase { private final URL httpObjectsUrl; - HttpObjectDB(final URL b) { + HttpObjectDB(URL b) { httpObjectsUrl = b; } @@ -930,7 +930,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, } @Override - WalkRemoteObjectDatabase openAlternate(final String location) + WalkRemoteObjectDatabase openAlternate(String location) throws IOException { return new HttpObjectDB(new URL(httpObjectsUrl, location)); } @@ -962,7 +962,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, } @Override - FileStream open(final String path) throws IOException { + FileStream open(String path) throws IOException { return open(path, AcceptEncoding.UNSPECIFIED); } @@ -1051,7 +1051,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, class SmartHttpFetchConnection extends BasePackFetchConnection { private MultiRequestService svc; - SmartHttpFetchConnection(final InputStream advertisement) + SmartHttpFetchConnection(InputStream advertisement) throws TransportException { super(TransportHttp.this); statelessRPC = true; @@ -1081,7 +1081,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, } class SmartHttpPushConnection extends BasePackPushConnection { - SmartHttpPushConnection(final InputStream advertisement) + SmartHttpPushConnection(InputStream advertisement) throws TransportException { super(TransportHttp.this); statelessRPC = true; @@ -1384,7 +1384,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, class MultiRequestService extends Service { boolean finalRequest; - MultiRequestService(final String serviceName) { + MultiRequestService(String serviceName) { super(serviceName); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java index 648eaa3cfa..fbb2c44100 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java @@ -162,11 +162,11 @@ class TransportLocal extends Transport implements PackTransport { remoteGitDir = gitDir; } - UploadPack createUploadPack(final Repository dst) { + UploadPack createUploadPack(Repository dst) { return new UploadPack(dst); } - ReceivePack createReceivePack(final Repository dst) { + ReceivePack createReceivePack(Repository dst) { return new ReceivePack(dst); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java index aa5ee7a3d5..d8f3a12bfe 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java @@ -134,7 +134,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { } }; - TransportSftp(final Repository local, final URIish uri) { + TransportSftp(Repository local, URIish uri) { super(local, uri); } @@ -195,7 +195,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { } } - SftpObjectDB(final SftpObjectDB parent, final String p) + SftpObjectDB(SftpObjectDB parent, String p) throws TransportException { try { ftp = newSftp(); @@ -227,7 +227,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { } @Override - WalkRemoteObjectDatabase openAlternate(final String location) + WalkRemoteObjectDatabase openAlternate(String location) throws IOException { return new SftpObjectDB(this, location); } @@ -244,9 +244,9 @@ public class TransportSftp extends SshTransport implements WalkTransport { files = new HashMap<>(); mtimes = new HashMap<>(); - for (final ChannelSftp.LsEntry ent : list) + for (ChannelSftp.LsEntry ent : list) files.put(ent.getFilename(), ent); - for (final ChannelSftp.LsEntry ent : list) { + for (ChannelSftp.LsEntry ent : list) { final String n = ent.getFilename(); if (!n.startsWith("pack-") || !n.endsWith(".pack")) //$NON-NLS-1$ //$NON-NLS-2$ continue; @@ -276,7 +276,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { } @Override - FileStream open(final String path) throws IOException { + FileStream open(String path) throws IOException { try { final SftpATTRS a = ftp.lstat(path); return new FileStream(ftp.get(path), a.getSize()); @@ -290,7 +290,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { } @Override - void deleteFile(final String path) throws IOException { + void deleteFile(String path) throws IOException { try { ftp.rm(path); } catch (SftpException je) { @@ -343,7 +343,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { } @Override - void writeFile(final String path, final byte[] data) throws IOException { + void writeFile(String path, byte[] data) throws IOException { final String lock = path + ".lock"; //$NON-NLS-1$ try { super.writeFile(lock, data); @@ -411,7 +411,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { je.getMessage()), je); } - for (final ChannelSftp.LsEntry ent : list) { + for (ChannelSftp.LsEntry ent : list) { final String n = ent.getFilename(); if (".".equals(n) || "..".equals(n)) //$NON-NLS-1$ //$NON-NLS-2$ continue; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkEncryption.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkEncryption.java index 615e46b982..b4248ee3fc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkEncryption.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkEncryption.java @@ -128,7 +128,7 @@ abstract class WalkEncryption { throw new IOException(MessageFormat.format(JGitText.get().unsupportedEncryptionAlgorithm, v)); } - IOException error(final Throwable why) { + IOException error(Throwable why) { return new IOException(MessageFormat .format(JGitText.get().encryptionError, why.getMessage()), why); @@ -141,7 +141,7 @@ abstract class WalkEncryption { } @Override - void validate(final HttpURLConnection u, final String prefix) + void validate(HttpURLConnection u, String prefix) throws IOException { validateImpl(u, prefix, "", ""); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -240,19 +240,19 @@ abstract class WalkEncryption { } @Override - void request(final HttpURLConnection u, final String prefix) { + void request(HttpURLConnection u, String prefix) { u.setRequestProperty(prefix + JETS3T_CRYPTO_VER, CRYPTO_VER); u.setRequestProperty(prefix + JETS3T_CRYPTO_ALG, cryptoAlg); } @Override - void validate(final HttpURLConnection u, final String prefix) + void validate(HttpURLConnection u, String prefix) throws IOException { validateImpl(u, prefix, CRYPTO_VER, cryptoAlg); } @Override - OutputStream encrypt(final OutputStream os) throws IOException { + OutputStream encrypt(OutputStream os) throws IOException { try { final Cipher cipher = InsecureCipherFactory.create(cryptoAlg); cipher.init(Cipher.ENCRYPT_MODE, secretKey, paramSpec); @@ -263,7 +263,7 @@ abstract class WalkEncryption { } @Override - InputStream decrypt(final InputStream in) throws IOException { + InputStream decrypt(InputStream in) throws IOException { try { final Cipher cipher = InsecureCipherFactory.create(cryptoAlg); cipher.init(Cipher.DECRYPT_MODE, secretKey, paramSpec); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java index 9b6f458994..9307914444 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java @@ -187,7 +187,7 @@ class WalkFetchConnection extends BaseFetchConnection { /** Inserter to read objects from {@link #local}. */ private final ObjectReader reader; - WalkFetchConnection(final WalkTransport t, final WalkRemoteObjectDatabase w) { + WalkFetchConnection(WalkTransport t, WalkRemoteObjectDatabase w) { Transport wt = (Transport)t; local = wt.local; objCheck = wt.getObjectChecker(); @@ -265,18 +265,18 @@ class WalkFetchConnection extends BaseFetchConnection { public void close() { inserter.close(); reader.close(); - for (final RemotePack p : unfetchedPacks) { + for (RemotePack p : unfetchedPacks) { if (p.tmpIdx != null) p.tmpIdx.delete(); } - for (final WalkRemoteObjectDatabase r : remotes) + for (WalkRemoteObjectDatabase r : remotes) r.close(); } private void queueWants(Collection<Ref> want) throws TransportException { final HashSet<ObjectId> inWorkQueue = new HashSet<>(); - for (final Ref r : want) { + for (Ref r : want) { final ObjectId id = r.getObjectId(); if (id == null) { throw new NullPointerException(MessageFormat.format( @@ -385,7 +385,7 @@ class WalkFetchConnection extends BaseFetchConnection { final RevCommit commit = (RevCommit) obj; markLocalCommitsComplete(commit.getCommitTime()); needs(commit.getTree()); - for (final RevCommit p : commit.getParents()) + for (RevCommit p : commit.getParents()) needs(p); obj.add(COMPLETE); } @@ -459,7 +459,7 @@ class WalkFetchConnection extends BaseFetchConnection { if (packNameList == null || packNameList.isEmpty()) continue; - for (final String packName : packNameList) { + for (String packName : packNameList) { if (packsConsidered.add(packName)) unfetchedPacks.add(new RemotePack(wrr, packName)); } @@ -471,7 +471,7 @@ class WalkFetchConnection extends BaseFetchConnection { // Collection<WalkRemoteObjectDatabase> al = expandOneAlternate(id, pm); if (al != null && !al.isEmpty()) { - for (final WalkRemoteObjectDatabase alt : al) { + for (WalkRemoteObjectDatabase alt : al) { remotes.add(alt); noPacksYet.add(alt); noAlternatesYet.add(alt); @@ -693,14 +693,14 @@ class WalkFetchConnection extends BaseFetchConnection { } catch (IOException e) { throw new TransportException(e.getMessage(), e); } - for (final Ref r : refs) { + for (Ref r : refs) { try { markLocalObjComplete(revWalk.parseAny(r.getObjectId())); } catch (IOException readError) { throw new TransportException(MessageFormat.format(JGitText.get().localRefIsMissingObjects, r.getName()), readError); } } - for (final ObjectId id : have) { + for (ObjectId id : have) { try { markLocalObjComplete(revWalk.parseAny(id)); } catch (IOException readError) { @@ -739,7 +739,7 @@ class WalkFetchConnection extends BaseFetchConnection { localCommitQueue.next(); markTreeComplete(c.getTree()); - for (final RevCommit p : c.getParents()) + for (RevCommit p : c.getParents()) pushLocalCommit(p); } } catch (IOException err) { @@ -813,7 +813,7 @@ class WalkFetchConnection extends BaseFetchConnection { PackIndex index; - RemotePack(final WalkRemoteObjectDatabase c, final String pn) { + RemotePack(WalkRemoteObjectDatabase c, String pn) { connection = c; packName = pn; idxName = packName.substring(0, packName.length() - 5) + ".idx"; //$NON-NLS-1$ @@ -831,7 +831,7 @@ class WalkFetchConnection extends BaseFetchConnection { } } - void openIndex(final ProgressMonitor pm) throws IOException { + void openIndex(ProgressMonitor pm) throws IOException { if (index != null) return; if (tmpIdx == null) @@ -850,7 +850,7 @@ class WalkFetchConnection extends BaseFetchConnection { pm.beginTask("Get " + idxName.substring(0, 12) + "..idx", //$NON-NLS-1$ //$NON-NLS-2$ s.length < 0 ? ProgressMonitor.UNKNOWN : (int) (s.length / 1024)); - try (final FileOutputStream fos = new FileOutputStream(tmpIdx)) { + try (FileOutputStream fos = new FileOutputStream(tmpIdx)) { final byte[] buf = new byte[2048]; int cnt; while (!pm.isCancelled() && (cnt = s.in.read(buf)) >= 0) { @@ -878,7 +878,7 @@ class WalkFetchConnection extends BaseFetchConnection { } } - void downloadPack(final ProgressMonitor monitor) throws IOException { + void downloadPack(ProgressMonitor monitor) throws IOException { String name = "pack/" + packName; //$NON-NLS-1$ WalkRemoteObjectDatabase.FileStream s = connection.open(name); try { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java index 5cc616ed3b..4c754252a3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java @@ -157,7 +157,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { // ref using the directory name being created. // final List<RemoteRefUpdate> updates = new ArrayList<>(); - for (final RemoteRefUpdate u : refUpdates.values()) { + for (RemoteRefUpdate u : refUpdates.values()) { final String n = u.getRemoteName(); if (!n.startsWith("refs/") || !Repository.isValidRefName(n)) { //$NON-NLS-1$ u.setStatus(Status.REJECTED_OTHER_REASON); @@ -177,7 +177,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { // if (!updates.isEmpty()) sendpack(updates, monitor); - for (final RemoteRefUpdate u : updates) + for (RemoteRefUpdate u : updates) updateCommand(u); // Is this a new repository? If so we should create additional @@ -196,10 +196,10 @@ class WalkPushConnection extends BaseConnection implements PushConnection { if (!packedRefUpdates.isEmpty()) { try { refWriter.writePackedRefs(); - for (final RemoteRefUpdate u : packedRefUpdates) + for (RemoteRefUpdate u : packedRefUpdates) u.setStatus(Status.OK); } catch (IOException err) { - for (final RemoteRefUpdate u : packedRefUpdates) { + for (RemoteRefUpdate u : packedRefUpdates) { u.setStatus(Status.REJECTED_OTHER_REASON); u.setMessage(err.getMessage()); } @@ -225,14 +225,14 @@ class WalkPushConnection extends BaseConnection implements PushConnection { String pathPack = null; String pathIdx = null; - try (final PackWriter writer = new PackWriter(transport.getPackConfig(), + try (PackWriter writer = new PackWriter(transport.getPackConfig(), local.newObjectReader())) { final Set<ObjectId> need = new HashSet<>(); final Set<ObjectId> have = new HashSet<>(); - for (final RemoteRefUpdate r : updates) + for (RemoteRefUpdate r : updates) need.add(r.getNewObjectId()); - for (final Ref r : getRefs()) { + for (Ref r : getRefs()) { have.add(r.getObjectId()); if (r.getPeeledObjectId() != null) have.add(r.getPeeledObjectId()); @@ -247,7 +247,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { return; packNames = new LinkedHashMap<>(); - for (final String n : dest.getPackNames()) + for (String n : dest.getPackNames()) packNames.put(n, n); final String base = "pack-" + writer.computeName().name(); //$NON-NLS-1$ @@ -379,7 +379,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { // default branch and is likely what they want to remain as // the default on the new remote. // - for (final RemoteRefUpdate u : updates) { + for (RemoteRefUpdate u : updates) { final String n = u.getRemoteName(); if (n.equals(Constants.R_HEADS + Constants.MASTER)) return n; @@ -388,7 +388,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { // Pick any branch, under the assumption the user pushed only // one to the remote side. // - for (final RemoteRefUpdate u : updates) { + for (RemoteRefUpdate u : updates) { final String n = u.getRemoteName(); if (n.startsWith(Constants.R_HEADS)) return n; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java index dde7b08154..aa71c9445a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java @@ -202,7 +202,7 @@ abstract class WalkRemoteObjectDatabase { * @throws IOException * deletion is not supported, or deletion failed. */ - void deleteFile(final String path) throws IOException { + void deleteFile(String path) throws IOException { throw new IOException(MessageFormat.format(JGitText.get().deletingNotSupported, path)); } @@ -263,7 +263,7 @@ abstract class WalkRemoteObjectDatabase { * writing is not supported, or attempting to write the file * failed, possibly due to permissions or remote disk full, etc. */ - void writeFile(final String path, final byte[] data) throws IOException { + void writeFile(String path, byte[] data) throws IOException { try (OutputStream os = writeFile(path, null, null)) { os.write(data); } @@ -278,7 +278,7 @@ abstract class WalkRemoteObjectDatabase { * @throws IOException * deletion is not supported, or deletion failed. */ - void deleteRef(final String name) throws IOException { + void deleteRef(String name) throws IOException { deleteFile(ROOT_DIR + name); } @@ -291,7 +291,7 @@ abstract class WalkRemoteObjectDatabase { * @throws IOException * deletion is not supported, or deletion failed. */ - void deleteRefLog(final String name) throws IOException { + void deleteRefLog(String name) throws IOException { deleteFile(ROOT_DIR + Constants.LOGS + "/" + name); //$NON-NLS-1$ } @@ -309,7 +309,7 @@ abstract class WalkRemoteObjectDatabase { * writing is not supported, or attempting to write the file * failed, possibly due to permissions or remote disk full, etc. */ - void writeRef(final String name, final ObjectId value) throws IOException { + void writeRef(String name, ObjectId value) throws IOException { final ByteArrayOutputStream b; b = new ByteArrayOutputStream(Constants.OBJECT_ID_STRING_LENGTH + 1); @@ -333,9 +333,9 @@ abstract class WalkRemoteObjectDatabase { * writing is not supported, or attempting to write the file * failed, possibly due to permissions or remote disk full, etc. */ - void writeInfoPacks(final Collection<String> packNames) throws IOException { + void writeInfoPacks(Collection<String> packNames) throws IOException { final StringBuilder w = new StringBuilder(); - for (final String n : packNames) { + for (String n : packNames) { w.append("P "); //$NON-NLS-1$ w.append(n); w.append('\n'); @@ -361,7 +361,7 @@ abstract class WalkRemoteObjectDatabase { * exists, or after it was determined to exist but before the * stream could be created. */ - BufferedReader openReader(final String path) throws IOException { + BufferedReader openReader(String path) throws IOException { final InputStream is = open(path).in; return new BufferedReader(new InputStreamReader(is, Constants.CHARSET)); } @@ -475,7 +475,7 @@ abstract class WalkRemoteObjectDatabase { * stream containing the file data. This stream will be * closed by the caller when reading is complete. */ - FileStream(final InputStream i) { + FileStream(InputStream i) { in = i; length = -1; } @@ -490,7 +490,7 @@ abstract class WalkRemoteObjectDatabase { * total number of bytes available for reading through * <code>i</code>. */ - FileStream(final InputStream i, final long n) { + FileStream(InputStream i, long n) { in = i; length = n; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java index ad409f6d6f..470ed02841 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java @@ -326,7 +326,7 @@ public abstract class AbstractTreeIterator { return pathCompare(p, p.mode); } - int pathCompare(final AbstractTreeIterator p, final int pMode) { + int pathCompare(AbstractTreeIterator p, int pMode) { // Its common when we are a subtree for both parents to match; // when this happens everything in path[0..cPos] is known to // be equal and does not require evaluation again. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java index 0639b0dbdd..f5d45c7687 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java @@ -63,7 +63,7 @@ public class EmptyTreeIterator extends AbstractTreeIterator { // Create a root empty tree. } - EmptyTreeIterator(final AbstractTreeIterator p) { + EmptyTreeIterator(AbstractTreeIterator p) { super(p); pathLen = pathOffset; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java index b0509705dd..61b130f93f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java @@ -135,7 +135,7 @@ public class NameConflictTreeWalk extends TreeWalk { if (isTree(minRef)) { if (skipEntry(minRef)) { - for (final AbstractTreeIterator t : trees) { + for (AbstractTreeIterator t : trees) { if (t.matches == minRef) { t.next(1); t.matches = null; @@ -231,7 +231,7 @@ public class NameConflictTreeWalk extends TreeWalk { // A tree D/F may have been handled earlier. We need to // not report this path if it has already been reported. // - for (final AbstractTreeIterator t : trees) { + for (AbstractTreeIterator t : trees) { if (t.matches == minRef || t.first()) continue; @@ -267,7 +267,7 @@ public class NameConflictTreeWalk extends TreeWalk { // such entries match this entry. // AbstractTreeIterator treeMatch = null; - for (final AbstractTreeIterator t : trees) { + for (AbstractTreeIterator t : trees) { if (t.matches == minRef || t.eof()) continue; @@ -306,7 +306,7 @@ public class NameConflictTreeWalk extends TreeWalk { // matching iterators instead of the file iterator. // This way isSubtree is true and isRecursive works. // - for (final AbstractTreeIterator t : trees) + for (AbstractTreeIterator t : trees) if (t.matches == minRef) t.matches = treeMatch; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java index 8db95da344..d500aae681 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java @@ -1361,7 +1361,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { trees[i] = trees[i].parent; AbstractTreeIterator minRef = null; - for (final AbstractTreeIterator t : trees) { + for (AbstractTreeIterator t : trees) { if (t.matches != t) continue; if (minRef == null || t.pathCompare(minRef) < 0) @@ -1377,11 +1377,11 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { return p; } - static String pathOf(final AbstractTreeIterator t) { + static String pathOf(AbstractTreeIterator t) { return RawParseUtils.decode(Constants.CHARSET, t.path, 0, t.pathLen); } - static String pathOf(final byte[] buf, int pos, int end) { + static String pathOf(byte[] buf, int pos, int end) { return RawParseUtils.decode(Constants.CHARSET, buf, pos, end); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java index 44385eacb2..10e9196411 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java @@ -1175,7 +1175,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { int encodedNameLen; - void encodeName(final CharsetEncoder enc) { + void encodeName(CharsetEncoder enc) { final ByteBuffer b; try { b = enc.encode(CharBuffer.wrap(getName())); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java index 62a5440aa2..a960bd7a8e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java @@ -120,7 +120,7 @@ public abstract class AndTreeFilter extends TreeFilter { private final TreeFilter b; - Binary(final TreeFilter one, final TreeFilter two) { + Binary(TreeFilter one, TreeFilter two) { a = one; b = two; } @@ -170,7 +170,7 @@ public abstract class AndTreeFilter extends TreeFilter { private static class List extends AndTreeFilter { private final TreeFilter[] subfilters; - List(final TreeFilter[] list) { + List(TreeFilter[] list) { subfilters = list; } @@ -186,7 +186,7 @@ public abstract class AndTreeFilter extends TreeFilter { throws MissingObjectException, IncorrectObjectTypeException, IOException { int m = 0; - for (final TreeFilter f : subfilters) { + for (TreeFilter f : subfilters) { int r = f.matchFilter(walker); if (r == 1) { return 1; @@ -200,7 +200,7 @@ public abstract class AndTreeFilter extends TreeFilter { @Override public boolean shouldBeRecursive() { - for (final TreeFilter f : subfilters) + for (TreeFilter f : subfilters) if (f.shouldBeRecursive()) return true; return false; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java index 0a3b7d02d4..995561e59e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java @@ -112,7 +112,7 @@ class ByteArraySet { * pre-computed hash of toFind * @return true if the mapping exists for this byte array; false otherwise. */ - boolean contains(final byte[] toFind, int length, int hash) { + boolean contains(byte[] toFind, int length, int hash) { return get(toFind, length, hash) != null; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java index 07c6bfcfc4..308ff0c962 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java @@ -118,7 +118,7 @@ public abstract class OrTreeFilter extends TreeFilter { private final TreeFilter b; - Binary(final TreeFilter one, final TreeFilter two) { + Binary(TreeFilter one, TreeFilter two) { a = one; b = two; } @@ -168,7 +168,7 @@ public abstract class OrTreeFilter extends TreeFilter { private static class List extends OrTreeFilter { private final TreeFilter[] subfilters; - List(final TreeFilter[] list) { + List(TreeFilter[] list) { subfilters = list; } @@ -184,7 +184,7 @@ public abstract class OrTreeFilter extends TreeFilter { throws MissingObjectException, IncorrectObjectTypeException, IOException { int m = 1; - for (final TreeFilter f : subfilters) { + for (TreeFilter f : subfilters) { int r = f.matchFilter(walker); if (r == 0) { return 0; @@ -198,7 +198,7 @@ public abstract class OrTreeFilter extends TreeFilter { @Override public boolean shouldBeRecursive() { - for (final TreeFilter f : subfilters) + for (TreeFilter f : subfilters) if (f.shouldBeRecursive()) return true; return false; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java index 66b3c84073..9267fb64f5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java @@ -115,7 +115,7 @@ public class PathFilter extends TreeFilter { /** {@inheritDoc} */ @Override public boolean shouldBeRecursive() { - for (final byte b : pathRaw) + for (byte b : pathRaw) if (b == '/') return true; return false; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java index 26cf8857bd..5cf5750808 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java @@ -88,7 +88,7 @@ public class PathFilterGroup { JGitText.get().atLeastOnePathIsRequired); final PathFilter[] p = new PathFilter[paths.size()]; int i = 0; - for (final String s : paths) + for (String s : paths) p[i++] = PathFilter.create(s); return create(p); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java index 25e9aafe14..6b58790b23 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java @@ -70,7 +70,7 @@ public abstract class CachedAuthenticator extends Authenticator { protected final PasswordAuthentication getPasswordAuthentication() { final String host = getRequestingHost(); final int port = getRequestingPort(); - for (final CachedAuthentication ca : cached) { + for (CachedAuthentication ca : cached) { if (ca.host.equals(host) && ca.port == port) return ca.toPasswordAuthentication(); } 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 0681a3f68e..3372bbe6a4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -470,7 +470,7 @@ public abstract class FS { if (path == null) return null; - for (final String p : path.split(File.pathSeparator)) { + for (String p : path.split(File.pathSeparator)) { for (String command : lookFor) { final File e = new File(p, command); if (e.isFile()) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/LongMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/LongMap.java index 146966dd4e..8c7f672848 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/LongMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/LongMap.java @@ -182,7 +182,7 @@ public class LongMap<V> { V value; Node<V> next; - Node(final long k, final V v) { + Node(long k, V v) { key = k; value = v; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java index 057b17785e..3ed7aeb954 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java @@ -238,7 +238,7 @@ public abstract class TemporaryBuffer extends OutputStream { throw new OutOfMemoryError(JGitText.get().lengthExceedsMaximumArraySize); final byte[] out = new byte[(int) len]; int outPtr = 0; - for (final Block b : blocks) { + for (Block b : blocks) { System.arraycopy(b.buffer, 0, out, outPtr, b.count); outPtr += b.count; } @@ -265,7 +265,7 @@ public abstract class TemporaryBuffer extends OutputStream { JGitText.get().lengthExceedsMaximumArraySize); final byte[] out = new byte[(int) len]; int outPtr = 0; - for (final Block b : blocks) { + for (Block b : blocks) { System.arraycopy(b.buffer, 0, out, outPtr, b.count); outPtr += b.count; } @@ -292,7 +292,7 @@ public abstract class TemporaryBuffer extends OutputStream { throws IOException { if (pm == null) pm = NullProgressMonitor.INSTANCE; - for (final Block b : blocks) { + for (Block b : blocks) { os.write(b.buffer, 0, b.count); pm.update(b.count / 1024); } @@ -373,7 +373,7 @@ public abstract class TemporaryBuffer extends OutputStream { overflow = overflow(); final Block last = blocks.remove(blocks.size() - 1); - for (final Block b : blocks) + for (Block b : blocks) overflow.write(b.buffer, 0, b.count); blocks = null; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java index 475b0c110d..b7feddda57 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java @@ -145,7 +145,7 @@ public final class InterruptTimer { } static final class AlarmThread extends Thread { - AlarmThread(final String name, final AlarmState q) { + AlarmThread(String name, AlarmState q) { super(q); setName(name); setDaemon(true); @@ -161,7 +161,7 @@ public final class InterruptTimer { private static final class AutoKiller { private final AlarmState state; - AutoKiller(final AlarmState s) { + AutoKiller(AlarmState s) { state = s; } @@ -203,7 +203,7 @@ public final class InterruptTimer { } } - synchronized void begin(final int timeout) { + synchronized void begin(int timeout) { if (terminated) throw new IllegalStateException(JGitText.get().timerAlreadyTerminated); callingThread = Thread.currentThread(); |