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.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java | 6 +++--- org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'org.eclipse.jgit.ui/src') diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java index dcf27b4a7d..b1fffd82f9 100644 --- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java +++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java @@ -66,11 +66,11 @@ final class AWTPlotRenderer extends AbstractPlotRenderer transient Graphics2D g; - AWTPlotRenderer(final GraphCellRender c) { + AWTPlotRenderer(GraphCellRender c) { cell = c; } - void paint(final Graphics in, final PlotCommit commit) { + void paint(Graphics in, PlotCommit commit) { g = (Graphics2D) in.create(); try { final int h = cell.getHeight(); @@ -138,7 +138,7 @@ final class AWTPlotRenderer extends AbstractPlotRenderer return myLane != null ? myLane.color : Color.black; } - void paintTriangleDown(final int cx, final int y, final int h) { + void paintTriangleDown(int cx, int y, int h) { final int tipX = cx; final int tipY = y + h; final int baseX1 = cx - 10 / 2; diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java index 3f9217d1c3..943a3256fb 100644 --- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java +++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java @@ -175,7 +175,7 @@ public class CommitGraphPane extends JTable { } } - PersonIdent authorFor(final PlotCommit c) { + PersonIdent authorFor(PlotCommit c) { if (c != lastCommit) { lastCommit = c; lastAuthor = c.getAuthorIdent(); @@ -259,7 +259,7 @@ public class CommitGraphPane extends JTable { strokeCache[i] = new BasicStroke(i); } - static Stroke stroke(final int width) { + static Stroke stroke(int width) { if (width < strokeCache.length) return strokeCache[width]; return new BasicStroke(width); -- cgit v1.2.3