From 6d370d837c5faa7caff2e6e3e4723b887f2fbdca Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 14 May 2018 18:42:02 +0200 Subject: Remove 'final' in parameter lists Change-Id: Id924f79c8b2c720297ebc49bf9c5d4ddd6d52547 Signed-off-by: Han-Wen Nienhuys --- .../src/org/eclipse/jgit/junit/JGitTestUtil.java | 10 ++++---- .../jgit/junit/LocalDiskRepositoryTestCase.java | 10 ++++---- .../org/eclipse/jgit/junit/MockSystemReader.java | 4 ++-- .../org/eclipse/jgit/junit/RepositoryTestCase.java | 16 ++++++------- .../src/org/eclipse/jgit/junit/TestRepository.java | 28 +++++++++++----------- .../src/org/eclipse/jgit/junit/TestRng.java | 4 ++-- 6 files changed, 36 insertions(+), 36 deletions(-) (limited to 'org.eclipse.jgit.junit') diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java index 27f745e4e9..a102da1f49 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java @@ -142,7 +142,7 @@ public abstract class JGitTestUtil { * @param fileName * @return the test resource file */ - public static File getTestResourceFile(final String fileName) { + public static File getTestResourceFile(String fileName) { if (fileName == null || fileName.length() <= 0) { return null; } @@ -242,7 +242,7 @@ public abstract class JGitTestUtil { * @throws IOException * the file could not be written. */ - public static void write(final File f, final String body) + public static void write(File f, String body) throws IOException { FileUtils.mkdirs(f.getParentFile(), true); try (Writer w = new OutputStreamWriter(new FileOutputStream(f), @@ -261,7 +261,7 @@ public abstract class JGitTestUtil { * @throws IOException * the file does not exist, or could not be read. */ - public static String read(final File file) throws IOException { + public static String read(File file) throws IOException { final byte[] body = IO.readFully(file); return new String(body, 0, body.length, CHARSET); } @@ -274,7 +274,7 @@ public abstract class JGitTestUtil { * @return the content of the file * @throws IOException */ - public static String read(final Repository db, final String name) + public static String read(Repository db, String name) throws IOException { File file = new File(db.getWorkTree(), name); return read(file); @@ -288,7 +288,7 @@ public abstract class JGitTestUtil { * name of the file * @return {@code true} if the file exists */ - public static boolean check(final Repository db, final String name) { + public static boolean check(Repository db, String name) { File file = new File(db.getWorkTree(), name); return file.exists(); } diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index 3c00bd3df1..6cdd0eb23c 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -225,7 +225,7 @@ public abstract class LocalDiskRepositoryTestCase { * @param dir * the recursively directory to delete, if present. */ - protected void recursiveDelete(final File dir) { + protected void recursiveDelete(File dir) { recursiveDelete(dir, false, true); } @@ -540,7 +540,7 @@ public abstract class LocalDiskRepositoryTestCase { * @throws IOException * the file could not be written. */ - protected File write(final String body) throws IOException { + protected File write(String body) throws IOException { final File f = File.createTempFile("temp", "txt", tmp); try { write(f, body); @@ -571,7 +571,7 @@ public abstract class LocalDiskRepositoryTestCase { * @throws IOException * the file could not be written. */ - protected void write(final File f, final String body) throws IOException { + protected void write(File f, String body) throws IOException { JGitTestUtil.write(f, body); } @@ -583,11 +583,11 @@ public abstract class LocalDiskRepositoryTestCase { * @return the content of the file * @throws IOException */ - protected String read(final File f) throws IOException { + protected String read(File f) throws IOException { return JGitTestUtil.read(f); } - private static String[] toEnvArray(final Map env) { + private static String[] toEnvArray(Map env) { final String[] envp = new String[env.size()]; int i = 0; for (Map.Entry e : env.entrySet()) diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java index 05d15229bc..d3d7d682e8 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java @@ -109,7 +109,7 @@ public class MockSystemReader extends SystemReader { setCurrentPlatform(); } - private void init(final String n) { + private void init(String n) { setProperty(n, n); } @@ -197,7 +197,7 @@ public class MockSystemReader extends SystemReader { * number of seconds to add to the current time. * @since 4.2 */ - public void tick(final int secDelta) { + public void tick(int secDelta) { now += secDelta * 1000L; } diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java index 93fc771cb3..e983e5dfb6 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java @@ -92,7 +92,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @param dst * @throws IOException */ - protected static void copyFile(final File src, final File dst) + protected static void copyFile(File src, File dst) throws IOException { try (FileInputStream fis = new FileInputStream(src); FileOutputStream fos = new FileOutputStream(dst)) { @@ -112,7 +112,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @return the trash file * @throws IOException */ - protected File writeTrashFile(final String name, final String data) + protected File writeTrashFile(String name, String data) throws IOException { return JGitTestUtil.writeTrashFile(db, name, data); } @@ -128,7 +128,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @throws Exception * @since 4.2 */ - protected Path writeLink(final String link, final String target) + protected Path writeLink(String link, String target) throws Exception { return JGitTestUtil.writeLink(db, link, target); } @@ -155,7 +155,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @return the file's content * @throws IOException */ - protected String read(final String name) throws IOException { + protected String read(String name) throws IOException { return JGitTestUtil.read(db, name); } @@ -166,7 +166,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * file name * @return if the file exists */ - protected boolean check(final String name) { + protected boolean check(String name) { return JGitTestUtil.check(db, name); } @@ -177,7 +177,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * file name * @throws IOException */ - protected void deleteTrashFile(final String name) throws IOException { + protected void deleteTrashFile(String name) throws IOException { JGitTestUtil.deleteTrashFile(db, name); } @@ -189,7 +189,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * expected content * @throws IOException */ - protected static void checkFile(File f, final String checkData) + protected static void checkFile(File f, String checkData) throws IOException { try (Reader r = new InputStreamReader(new FileInputStream(f), CHARSET)) { @@ -500,7 +500,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @param mode * @return the DirCacheEntry */ - protected DirCacheEntry createEntry(final String path, final FileMode mode) { + protected DirCacheEntry createEntry(String path, FileMode mode) { return createEntry(path, mode, DirCacheEntry.STAGE_0, path); } diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java index 89a86d8eea..4891c01945 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java @@ -244,7 +244,7 @@ public class TestRepository { * @param secDelta * number of seconds to add to the current time. */ - public void tick(final int secDelta) { + public void tick(int secDelta) { mockSystemReader.tick(secDelta); } @@ -267,7 +267,7 @@ public class TestRepository { * @return reference to the blob. * @throws Exception */ - public RevBlob blob(final String content) throws Exception { + public RevBlob blob(String content) throws Exception { return blob(content.getBytes(CHARSET)); } @@ -279,7 +279,7 @@ public class TestRepository { * @return reference to the blob. * @throws Exception */ - public RevBlob blob(final byte[] content) throws Exception { + public RevBlob blob(byte[] content) throws Exception { ObjectId id; try (ObjectInserter ins = inserter) { id = ins.insert(Constants.OBJ_BLOB, content); @@ -298,7 +298,7 @@ public class TestRepository { * @return the entry. * @throws Exception */ - public DirCacheEntry file(final String path, final RevBlob blob) + public DirCacheEntry file(String path, RevBlob blob) throws Exception { final DirCacheEntry e = new DirCacheEntry(path); e.setFileMode(FileMode.REGULAR_FILE); @@ -315,7 +315,7 @@ public class TestRepository { * @return reference to the tree specified by the entry list. * @throws Exception */ - public RevTree tree(final DirCacheEntry... entries) throws Exception { + public RevTree tree(DirCacheEntry... entries) throws Exception { final DirCache dc = DirCache.newInCore(); final DirCacheBuilder b = dc.builder(); for (final DirCacheEntry e : entries) @@ -339,7 +339,7 @@ public class TestRepository { * @return the parsed object entry at this path, never null. * @throws Exception */ - public RevObject get(final RevTree tree, final String path) + public RevObject get(RevTree tree, String path) throws Exception { try (TreeWalk tw = new TreeWalk(pool.getObjectReader())) { tw.setFilter(PathFilterGroup.createFromStrings(Collections @@ -370,7 +370,7 @@ public class TestRepository { * @return the new commit. * @throws Exception */ - public RevCommit commit(final RevCommit... parents) throws Exception { + public RevCommit commit(RevCommit... parents) throws Exception { return commit(1, tree(), parents); } @@ -386,7 +386,7 @@ public class TestRepository { * @return the new commit. * @throws Exception */ - public RevCommit commit(final RevTree tree, final RevCommit... parents) + public RevCommit commit(RevTree tree, RevCommit... parents) throws Exception { return commit(1, tree, parents); } @@ -404,7 +404,7 @@ public class TestRepository { * @return the new commit. * @throws Exception */ - public RevCommit commit(final int secDelta, final RevCommit... parents) + public RevCommit commit(int secDelta, RevCommit... parents) throws Exception { return commit(secDelta, tree(), parents); } @@ -470,7 +470,7 @@ public class TestRepository { * @return the annotated tag object. * @throws Exception */ - public RevTag tag(final String name, final RevObject dst) throws Exception { + public RevTag tag(String name, RevObject dst) throws Exception { final TagBuilder t = new TagBuilder(); t.setObjectId(dst); t.setTag(name); @@ -759,7 +759,7 @@ public class TestRepository { final FileRepository fr = (FileRepository) db; RefWriter rw = new RefWriter(fr.getAllRefs().values()) { @Override - protected void writeFile(final String name, final byte[] bin) + protected void writeFile(String name, byte[] bin) throws IOException { File path = new File(fr.getDirectory(), name); TestRepository.this.writeFile(path, bin); @@ -791,7 +791,7 @@ public class TestRepository { * @return {@code object} * @throws Exception */ - public T parseBody(final T object) throws Exception { + public T parseBody(T object) throws Exception { pool.parseBody(object); return object; } @@ -944,7 +944,7 @@ public class TestRepository { return new File(packdir, "pack-" + name.name() + t); } - private void writeFile(final File p, final byte[] bin) throws IOException, + private void writeFile(File p, byte[] bin) throws IOException, ObjectWritingException { final LockFile lck = new LockFile(p); if (!lck.lock()) @@ -1093,7 +1093,7 @@ public class TestRepository { return add(path, blob(content)); } - public CommitBuilder add(String path, final RevBlob id) + public CommitBuilder add(String path, RevBlob id) throws Exception { return edit(new PathEdit(path) { @Override diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRng.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRng.java index 54c81f2d86..f7af36a838 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRng.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRng.java @@ -55,7 +55,7 @@ public class TestRng { * @param seed * seed to bootstrap, usually this is the test method name. */ - public TestRng(final String seed) { + public TestRng(String seed) { next = 0; for (int i = 0; i < seed.length(); i++) next = next * 11 + seed.charAt(i); @@ -68,7 +68,7 @@ public class TestRng { * number of random bytes to produce. * @return array of {@code cnt} randomly generated bytes. */ - public byte[] nextBytes(final int cnt) { + public byte[] nextBytes(int cnt) { final byte[] r = new byte[cnt]; for (int i = 0; i < cnt; i++) r[i] = (byte) nextInt(); -- cgit v1.2.3