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 --- .../src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java | 2 +- org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java | 10 +++++----- .../src/org/eclipse/jgit/revplot/PlotCommitList.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/revplot') 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 { 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 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 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 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 extends @SuppressWarnings("unchecked") public void findPassingThrough(final PlotCommit currCommit, final Collection result) { - for (final PlotLane p : currCommit.passingLanes) + for (PlotLane p : currCommit.passingLanes) result.add((L) p); } -- cgit v1.2.3