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.ui/src/org/eclipse | |
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.ui/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java | 6 | ||||
-rw-r--r-- | org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java | 4 |
2 files changed, 5 insertions, 5 deletions
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<SwingLane, Color> transient Graphics2D g; - AWTPlotRenderer(final GraphCellRender c) { + AWTPlotRenderer(GraphCellRender c) { cell = c; } - void paint(final Graphics in, final PlotCommit<SwingLane> commit) { + void paint(Graphics in, PlotCommit<SwingLane> commit) { g = (Graphics2D) in.create(); try { final int h = cell.getHeight(); @@ -138,7 +138,7 @@ final class AWTPlotRenderer extends AbstractPlotRenderer<SwingLane, Color> 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<SwingLane> c) { + PersonIdent authorFor(PlotCommit<SwingLane> 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); |