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.lfs | |
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.lfs')
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java | 2 | ||||
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java index d268857914..bdd1b39c0d 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java @@ -173,7 +173,7 @@ public final class AbbreviatedLongObjectId implements Serializable { return r << (16 - n) * 4; } - static long mask(final int nibbles, final long word, final long v) { + static long mask(int nibbles, long word, long v) { final long b = (word - 1) * 16; if (b + 16 <= nibbles) { // We have all of the bits required for this word. diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java index cdb297eb1c..0788922639 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java @@ -476,7 +476,7 @@ public abstract class AnyLongObjectId implements Comparable<AnyLongObjectId> { 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, long w) { + static void formatHexChar(char[] dst, int p, long w) { int o = p + 15; while (o >= p && w != 0) { dst[o--] = hexchar[(int) (w & 0xf)]; |