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.test | |
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.test')
21 files changed, 52 insertions, 52 deletions
diff --git a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java index f26952ea76..79d8d0e10b 100644 --- a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java +++ b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java @@ -85,7 +85,7 @@ public class EGitPatchHistoryTest { int errors; - PatchReader(final HashMap<String, HashMap<String, StatInfo>> s) + PatchReader(HashMap<String, HashMap<String, StatInfo>> s) throws IOException { super(new String[] { "-p" }); stats = s; @@ -103,7 +103,7 @@ public class EGitPatchHistoryTest { p.parse(buf, 0, buf.length - 1); assertEquals("File count " + cid, files.size(), p.getFiles().size()); if (!p.getErrors().isEmpty()) { - for (final FormatError e : p.getErrors()) { + for (FormatError e : p.getErrors()) { System.out.println("error " + e.getMessage()); System.out.println(" at " + e.getLineText()); } @@ -111,7 +111,7 @@ public class EGitPatchHistoryTest { fail("Unexpected error in " + cid); } - for (final FileHeader fh : p.getFiles()) { + for (FileHeader fh : p.getFiles()) { final String fileName; if (fh.getChangeType() != FileHeader.ChangeType.DELETE) fileName = fh.getNewPath(); @@ -121,7 +121,7 @@ public class EGitPatchHistoryTest { final String nid = fileName + " in " + cid; assertNotNull("No " + nid, s); int added = 0, deleted = 0; - for (final HunkHeader h : fh.getHunks()) { + for (HunkHeader h : fh.getHunks()) { added += h.getOldImage().getLinesAdded(); deleted += h.getOldImage().getLinesDeleted(); } @@ -188,7 +188,7 @@ public class EGitPatchHistoryTest { static abstract class CommitReader { private Process proc; - CommitReader(final String[] args) throws IOException { + CommitReader(String[] args) throws IOException { final String[] realArgs = new String[3 + args.length + 1]; realArgs[0] = "git"; realArgs[1] = "log"; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitOnlyTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitOnlyTest.java index cc21b473ec..bbd6ec0bde 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitOnlyTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitOnlyTest.java @@ -1289,7 +1289,7 @@ public class CommitOnlyTest extends RepositoryTestCase { return null; } - static private String getHead(final Git git, final String path) + static private String getHead(Git git, String path) throws Exception { try { final Repository repo = git.getRepository(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java index 2b108870f9..3598f3a4a1 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java @@ -78,7 +78,7 @@ public class DirCacheBuilderIteratorTest extends RepositoryTestCase { final int expIdx = 2; final DirCacheBuilder b = dc.builder(); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.addTree(new DirCacheBuildIterator(b)); tw.setRecursive(true); tw.setFilter(PathFilterGroup.createFromStrings(Collections diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java index 0b261840c2..c362e7497c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java @@ -99,7 +99,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { assertEquals(ls.size(), dc.getEntryCount()); { final Iterator<CGitIndexRecord> rItr = ls.values().iterator(); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.setRecursive(true); tw.addTree(new DirCacheIterator(dc)); while (rItr.hasNext()) { @@ -180,7 +180,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { assertEquals(cList.size(), jTree.getEntrySpan()); final ArrayList<CGitLsTreeRecord> subtrees = new ArrayList<>(); - for (final CGitLsTreeRecord r : cTree.values()) { + for (CGitLsTreeRecord r : cTree.values()) { if (FileMode.TREE.equals(r.mode)) subtrees.add(r); } @@ -268,7 +268,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { final String path; - CGitIndexRecord(final String line) { + CGitIndexRecord(String line) { final int tab = line.indexOf('\t'); final int sp1 = line.indexOf(' '); final int sp2 = line.indexOf(' ', sp1 + 1); @@ -286,7 +286,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { final String path; - CGitLsTreeRecord(final String line) { + CGitLsTreeRecord(String line) { final int tab = line.indexOf('\t'); final int sp1 = line.indexOf(' '); final int sp2 = line.indexOf(' ', sp1 + 1); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java index dd242e5a1a..82565fceec 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java @@ -76,7 +76,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { final DirCache dc = DirCache.newInCore(); assertEquals(0, dc.getEntryCount()); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.addTree(new DirCacheIterator(dc)); assertFalse(tw.next()); } @@ -126,7 +126,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { b.finish(); final DirCacheIterator i = new DirCacheIterator(dc); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.addTree(i); int pathIdx = 0; while (tw.next()) { @@ -164,7 +164,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { final int expPos[] = { 0, -1, 4 }; final DirCacheIterator i = new DirCacheIterator(dc); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.addTree(i); tw.setRecursive(false); int pathIdx = 0; @@ -205,7 +205,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { b.finish(); final DirCacheIterator i = new DirCacheIterator(dc); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.addTree(i); tw.setRecursive(true); int pathIdx = 0; @@ -240,7 +240,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { b.add(ents[i]); b.finish(); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.addTree(new DirCacheIterator(dc)); tw.setRecursive(true); int pathIdx = 0; @@ -402,7 +402,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { b.add(ents[i]); b.finish(); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { for (int victimIdx = 0; victimIdx < paths.length; victimIdx++) { tw.reset(); tw.addTree(new DirCacheIterator(dc)); @@ -430,7 +430,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { final DirCache dc = DirCache.read(path, FS.DETECTED); assertEquals(2, dc.getEntryCount()); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.setRecursive(true); tw.addTree(new DirCacheIterator(dc)); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java index 2895b30263..643daa5c95 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java @@ -220,7 +220,7 @@ public class ConcurrentRepackTest extends RepositoryTestCase { private File[] pack(Repository src, RevObject... list) throws IOException { try (PackWriter pw = new PackWriter(src)) { - for (final RevObject o : list) { + for (RevObject o : list) { pw.addObject(o); } @@ -253,7 +253,7 @@ public class ConcurrentRepackTest extends RepositoryTestCase { private static void delete(File[] list) throws IOException { final long begin = list[0].getParentFile().lastModified(); - for (final File f : list) { + for (File f : list) { FileUtils.delete(f); assertFalse(f + " was removed", f.exists()); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java index ed427d8895..04bed09af3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java @@ -368,7 +368,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { ObjectId.fromString("902d5476fa249b7abc9d84c611577a81381f0327"), ObjectId.fromString("6ff87c4664981e4397625791c8ea3bbb5f2279a3") , ObjectId.fromString("5b6e7c66c276e7610d4a73c70ec1a1f7c1003259") }; - try (final RevWalk parser = new RevWalk(db)) { + try (RevWalk parser = new RevWalk(db)) { final RevObject forcedOrderRevs[] = new RevObject[forcedOrder.length]; for (int i = 0; i < forcedOrder.length; i++) forcedOrderRevs[i] = parser.parseAny(forcedOrder[i]); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java index a549d32df9..e113db12ac 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java @@ -305,7 +305,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase { // object (as it already exists in the pack). // final Repository newdb = createBareRepository(); - try (final ObjectInserter oi = newdb.newObjectInserter()) { + try (ObjectInserter oi = newdb.newObjectInserter()) { final ObjectId treeId = oi.insert(new TreeFormatter()); assertEquals("4b825dc642cb6eb9a060e54bf8d69288fbee4904", treeId.name()); @@ -373,7 +373,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase { @Test public void test007_Open() throws IOException { - try (final FileRepository db2 = new FileRepository(db.getDirectory())) { + try (FileRepository db2 = new FileRepository(db.getDirectory())) { assertEquals(db.getDirectory(), db2.getDirectory()); assertEquals(db.getObjectDatabase().getDirectory(), db2 .getObjectDatabase().getDirectory()); @@ -557,7 +557,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase { @Test public void test026_CreateCommitMultipleparents() throws IOException { final ObjectId treeId; - try (final ObjectInserter oi = db.newObjectInserter()) { + try (ObjectInserter oi = db.newObjectInserter()) { final ObjectId blobId = oi.insert(Constants.OBJ_BLOB, "and this is the data in me\n".getBytes(Constants.CHARSET .name())); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java index bee11cd71a..82ad28ed21 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java @@ -133,7 +133,7 @@ public class WindowCacheGetTest extends SampleDataRepositoryTestCase { } private void doCacheTests() throws IOException { - for (final TestObject o : toLoad) { + for (TestObject o : toLoad) { final ObjectLoader or = db.open(o.id, o.type); assertNotNull(or); assertEquals(o.type, or.getType()); @@ -145,7 +145,7 @@ public class WindowCacheGetTest extends SampleDataRepositoryTestCase { int type; - void setType(final String typeStr) throws CorruptObjectException { + void setType(String typeStr) throws CorruptObjectException { final byte[] typeRaw = Constants.encode(typeStr + " "); final MutableInteger ptr = new MutableInteger(); type = Constants.decodeTypeString(id, typeRaw, (byte) ' ', ptr); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/XInputStream.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/XInputStream.java index 46f9ee3fff..910999c101 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/XInputStream.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/XInputStream.java @@ -53,7 +53,7 @@ import org.eclipse.jgit.util.NB; class XInputStream extends BufferedInputStream { private final byte[] intbuf = new byte[8]; - XInputStream(final InputStream s) { + XInputStream(InputStream s) { super(s); } @@ -63,7 +63,7 @@ class XInputStream extends BufferedInputStream { return b; } - synchronized void readFully(final byte[] b, int o, int len) + synchronized void readFully(byte[] b, int o, int len) throws IOException { int r; while (len > 0 && (r = read(b, o, len)) > 0) { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java index 122a3973d0..8e389ae252 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java @@ -76,7 +76,7 @@ public class RevObjectTest extends RevWalkTestCase { final RevCommit a2; final RevCommit b2; - try (final RevWalk rw2 = new RevWalk(db)) { + try (RevWalk rw2 = new RevWalk(db)) { a2 = rw2.parseCommit(a1); b2 = rw2.parseCommit(b1); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter6012Test.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter6012Test.java index 70b4e154ad..cef55210f0 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter6012Test.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter6012Test.java @@ -105,14 +105,14 @@ public class RevWalkPathFilter6012Test extends RevWalkTestCase { protected void check(RevCommit... order) throws Exception { markStart(i); final StringBuilder act = new StringBuilder(); - for (final RevCommit z : rw) { + for (RevCommit z : rw) { final String name = byName.get(z); assertNotNull(name); act.append(name); act.append(' '); } final StringBuilder exp = new StringBuilder(); - for (final RevCommit z : order) { + for (RevCommit z : order) { final String name = byName.get(z); assertNotNull(name); exp.append(name); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java index 104a69c9f7..611cd0cef2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java @@ -422,7 +422,7 @@ public class PushProcessTest extends SampleDataRepositoryTestCase { PushConnection { MockPushConnection() { final Map<String, Ref> refsMap = new HashMap<>(); - for (final Ref r : advertisedRefs) + for (Ref r : advertisedRefs) refsMap.put(r.getName(), r); available(refsMap); } @@ -443,7 +443,7 @@ public class PushProcessTest extends SampleDataRepositoryTestCase { public void push(ProgressMonitor monitor, Map<String, RemoteRefUpdate> refsToUpdate) throws TransportException { - for (final RemoteRefUpdate rru : refsToUpdate.values()) { + for (RemoteRefUpdate rru : refsToUpdate.values()) { assertEquals(Status.NOT_ATTEMPTED, rru.getStatus()); rru.setStatus(connectionUpdateStatus); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java index 7aae7b0c32..b77042220f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java @@ -136,7 +136,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas try (TransportLocal t = new TransportLocal(src, uriOf(dst), dst.getDirectory()) { @Override - ReceivePack createReceivePack(final Repository db) { + ReceivePack createReceivePack(Repository db) { db.close(); dst.incrementOpen(); @@ -203,7 +203,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas throws Exception { return new TransportLocal(src, uriOf(dst), dst.getDirectory()) { @Override - ReceivePack createReceivePack(final Repository db) { + ReceivePack createReceivePack(Repository db) { db.close(); dst.incrementOpen(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java index d4c47d37e3..c239922d71 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java @@ -142,7 +142,7 @@ public class TransportTest extends SampleDataRepositoryTestCase { assertEquals(12, result.size()); boolean foundA = false; boolean foundB = false; - for (final RemoteRefUpdate rru : result) { + for (RemoteRefUpdate rru : result) { if ("refs/heads/a".equals(rru.getSrcRef()) && "refs/heads/test/a".equals(rru.getRemoteName())) foundA = true; @@ -174,7 +174,7 @@ public class TransportTest extends SampleDataRepositoryTestCase { assertEquals(2, result.size()); boolean foundA = false; boolean foundC = false; - for (final RemoteRefUpdate rru : result) { + for (RemoteRefUpdate rru : result) { if ("refs/heads/a".equals(rru.getSrcRef()) && "refs/heads/b".equals(rru.getRemoteName())) foundA = true; @@ -233,7 +233,7 @@ public class TransportTest extends SampleDataRepositoryTestCase { assertEquals(2, result.size()); boolean foundA = false; boolean foundC = false; - for (final RemoteRefUpdate rru : result) { + for (RemoteRefUpdate rru : result) { if ("refs/heads/a".equals(rru.getSrcRef()) && "refs/heads/b".equals(rru.getRemoteName())) { foundA = true; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/CanonicalTreeParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/CanonicalTreeParserTest.java index 57eec0b58e..6195e640fb 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/CanonicalTreeParserTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/CanonicalTreeParserTest.java @@ -93,7 +93,7 @@ public class CanonicalTreeParserTest { private static byte[] mktree(byte[]... data) throws Exception { final ByteArrayOutputStream out = new ByteArrayOutputStream(); - for (final byte[] e : data) + for (byte[] e : data) out.write(e); return out.toByteArray(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java index 87fe00b1c6..232422edf6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java @@ -60,14 +60,14 @@ import org.junit.Test; public class PostOrderTreeWalkTest extends RepositoryTestCase { @Test public void testInitialize_NoPostOrder() throws Exception { - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { assertFalse(tw.isPostOrderTraversal()); } } @Test public void testInitialize_TogglePostOrder() throws Exception { - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { assertFalse(tw.isPostOrderTraversal()); tw.setPostOrderTraversal(true); assertTrue(tw.isPostOrderTraversal()); @@ -78,7 +78,7 @@ public class PostOrderTreeWalkTest extends RepositoryTestCase { @Test public void testResetDoesNotAffectPostOrder() throws Exception { - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.setPostOrderTraversal(true); assertTrue(tw.isPostOrderTraversal()); tw.reset(); @@ -104,7 +104,7 @@ public class PostOrderTreeWalkTest extends RepositoryTestCase { b.finish(); assertEquals(4, tree.getEntryCount()); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.setPostOrderTraversal(false); tw.addTree(new DirCacheIterator(tree)); @@ -132,7 +132,7 @@ public class PostOrderTreeWalkTest extends RepositoryTestCase { b.finish(); assertEquals(4, tree.getEntryCount()); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.setPostOrderTraversal(true); tw.addTree(new DirCacheIterator(tree)); @@ -166,7 +166,7 @@ public class PostOrderTreeWalkTest extends RepositoryTestCase { b.finish(); assertEquals(4, tree.getEntryCount()); - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.setPostOrderTraversal(true); tw.addTree(new DirCacheIterator(tree)); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java index d921aabdc1..71a2f327c8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java @@ -254,7 +254,7 @@ public class PathFilterGroupTest { } } - TreeWalk fakeWalk(final String path) throws IOException { + TreeWalk fakeWalk(String path) throws IOException { DirCache dc = DirCache.newInCore(); DirCacheEditor dce = dc.editor(); dce.add(new DirCacheEditor.PathEdit(path) { @@ -274,7 +274,7 @@ public class PathFilterGroupTest { return ret; } - TreeWalk fakeWalkAtSubtree(final String path) throws IOException { + TreeWalk fakeWalkAtSubtree(String path) throws IOException { DirCache dc = DirCache.newInCore(); DirCacheEditor dce = dc.editor(); dce.add(new DirCacheEditor.PathEdit(path + "/README") { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java index 38adda3120..148d5ac820 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java @@ -113,7 +113,7 @@ public class PathSuffixFilterTest extends RepositoryTestCase { private List<String> getMatchingPaths(String suffixFilter, final ObjectId treeId, boolean recursiveWalk) throws IOException { - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.setFilter(PathSuffixFilter.create(suffixFilter)); tw.setRecursive(recursiveWalk); tw.addTree(treeId); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/TreeFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/TreeFilterTest.java index c3423b6fb1..8686c4f094 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/TreeFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/TreeFilterTest.java @@ -55,7 +55,7 @@ import org.junit.Test; public class TreeFilterTest extends RepositoryTestCase { @Test public void testALL_IncludesAnything() throws Exception { - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.addTree(new EmptyTreeIterator()); assertTrue(TreeFilter.ALL.include(tw)); } @@ -73,7 +73,7 @@ public class TreeFilterTest extends RepositoryTestCase { @Test public void testNotALL_IncludesNothing() throws Exception { - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.addTree(new EmptyTreeIterator()); assertFalse(TreeFilter.ALL.negate().include(tw)); } @@ -81,7 +81,7 @@ public class TreeFilterTest extends RepositoryTestCase { @Test public void testANY_DIFF_IncludesSingleTreeCase() throws Exception { - try (final TreeWalk tw = new TreeWalk(db)) { + try (TreeWalk tw = new TreeWalk(db)) { tw.addTree(new EmptyTreeIterator()); assertTrue(TreeFilter.ANY_DIFF.include(tw)); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/TemporaryBufferTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/TemporaryBufferTest.java index e73dab2ce6..edcce126bb 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/TemporaryBufferTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/TemporaryBufferTest.java @@ -248,7 +248,7 @@ public class TemporaryBufferTest { public void testInCoreInputStream() throws IOException { final int cnt = 256; final byte[] test = new TestRng(getName()).nextBytes(cnt); - try (final TemporaryBuffer.Heap b = new TemporaryBuffer.Heap(cnt + 4)) { + try (TemporaryBuffer.Heap b = new TemporaryBuffer.Heap(cnt + 4)) { b.write(test); InputStream in = b.openInputStream(); byte[] act = new byte[cnt]; |