From f3ec7cf3f0436a79e252251a31dbc62694555897 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 16 May 2018 16:34:16 +0200 Subject: 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 --- org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java') 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; -- cgit v1.2.3