diff options
Diffstat (limited to 'org.eclipse.jgit.test')
57 files changed, 163 insertions, 163 deletions
diff --git a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs index 47cca36924..64f74989e1 100644 --- a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs @@ -76,7 +76,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore 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 76930f2b86..7c0ea44c35 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 @@ -89,7 +89,7 @@ public class EGitPatchHistoryTest { super(new String[] { "-p" }); stats = s; - offBy1 = new HashSet<String>(); + offBy1 = new HashSet<>(); offBy1.add("9bda5ece6806cd797416eaa47c7b927cc6e9c3b2"); } @@ -158,7 +158,7 @@ public class EGitPatchHistoryTest { } static class NumStatReader extends CommitReader { - final HashMap<String, HashMap<String, StatInfo>> stats = new HashMap<String, HashMap<String, StatInfo>>(); + final HashMap<String, HashMap<String, StatInfo>> stats = new HashMap<>(); NumStatReader() throws IOException { super(new String[] { "--numstat" }); @@ -166,7 +166,7 @@ public class EGitPatchHistoryTest { @Override void onCommit(String commitId, byte[] buf) { - final HashMap<String, StatInfo> files = new HashMap<String, StatInfo>(); + final HashMap<String, StatInfo> files = new HashMap<>(); final MutableInteger ptr = new MutableInteger(); while (ptr.value < buf.length) { if (buf[ptr.value] == '\n') diff --git a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java b/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java index 4454e1a393..5a01eae9b5 100644 --- a/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java +++ b/org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java @@ -49,7 +49,7 @@ import java.util.Set; public class Sets { @SafeVarargs public static <T> Set<T> of(T... elements) { - Set<T> ret = new HashSet<T>(); + Set<T> ret = new HashSet<>(); for (T element : elements) ret.add(element); return ret; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java index 40545ce2a4..edab96b971 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java @@ -192,7 +192,7 @@ public class ArchiveCommandTest extends RepositoryTestCase { private class MockFormat implements ArchiveCommand.Format<MockOutputStream> { - private Map<String, String> entries = new HashMap<String, String>(); + private Map<String, String> entries = new HashMap<>(); private int size() { return entries.size(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java index fd42ca5b3d..85436db472 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java @@ -144,7 +144,7 @@ public class CleanCommandTest extends RepositoryTestCase { assertTrue(files.size() > 0); // run clean with setPaths - Set<String> paths = new TreeSet<String>(); + Set<String> paths = new TreeSet<>(); paths.add("File3.txt"); Set<String> cleanedFiles = git.clean().setPaths(paths).call(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java index e7a84f2d1d..ae0b8dd3c2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java @@ -88,7 +88,7 @@ public class CloneCommandTest extends RepositoryTestCase { @Override public void setUp() throws Exception { super.setUp(); - tr = new TestRepository<Repository>(db); + tr = new TestRepository<>(db); git = new Git(db); // commit something diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java index 1310625a9b..38178bfd0e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java @@ -62,7 +62,7 @@ public class LogCommandTest extends RepositoryTestCase { @Test public void logAllCommits() throws Exception { - List<RevCommit> commits = new ArrayList<RevCommit>(); + List<RevCommit> commits = new ArrayList<>(); Git git = Git.wrap(db); writeTrashFile("Test.txt", "Hello world"); @@ -94,7 +94,7 @@ public class LogCommandTest extends RepositoryTestCase { @Test public void logAllCommitsWithTag() throws Exception { - List<RevCommit> commits = new ArrayList<RevCommit>(); + List<RevCommit> commits = new ArrayList<>(); Git git = Git.wrap(db); writeTrashFile("Test.txt", "Hello world"); @@ -123,7 +123,7 @@ public class LogCommandTest extends RepositoryTestCase { } private List<RevCommit> createCommits(Git git) throws Exception { - List<RevCommit> commits = new ArrayList<RevCommit>(); + List<RevCommit> commits = new ArrayList<>(); writeTrashFile("Test.txt", "Hello world"); git.add().addFilepattern("Test.txt").call(); commits.add(git.commit().setMessage("commit#1").call()); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java index cb3dbf1bc2..4b23349fa6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java @@ -1556,7 +1556,7 @@ public class MergeCommandTest extends RepositoryTestCase { @Test public void testRecursiveMergeWithConflict() throws Exception { - TestRepository<Repository> db_t = new TestRepository<Repository>(db); + TestRepository<Repository> db_t = new TestRepository<>(db); BranchBuilder master = db_t.branch("master"); RevCommit m0 = master.commit().add("f", "1\n2\n3\n4\n5\n6\n7\n8\n9\n") .message("m0").create(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java index bd62200fce..138b7afcd6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java @@ -64,7 +64,7 @@ public class NameRevCommandTest extends RepositoryTestCase { @Before public void setUp() throws Exception { super.setUp(); - tr = new TestRepository<Repository>(db); + tr = new TestRepository<>(db); git = new Git(db); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java index b044c01db6..1d9cd78140 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java @@ -204,7 +204,7 @@ public class TreeWalkAttributeTest extends RepositoryTestCase { @Test public void testIndexOnly() throws IOException, NoFilepatternException, GitAPIException { - List<File> attrFiles = new ArrayList<File>(); + List<File> attrFiles = new ArrayList<>(); attrFiles.add(writeGlobalAttributeFile("globalAttributesFile", "*.txt -custom2")); attrFiles.add(writeAttributesFile(".git/info/attributes", @@ -813,7 +813,7 @@ public class TreeWalkAttributeTest extends RepositoryTestCase { } private static Set<Attribute> asSet(Collection<Attribute> attributes) { - Set<Attribute> ret = new HashSet<Attribute>(); + Set<Attribute> ret = new HashSet<>(); for (Attribute a : attributes) { ret.add(a); } @@ -853,7 +853,7 @@ public class TreeWalkAttributeTest extends RepositoryTestCase { } static Set<Attribute> asSet(Attribute... attrs) { - HashSet<Attribute> result = new HashSet<Attribute>(); + HashSet<Attribute> result = new HashSet<>(); for (Attribute attr : attrs) result.add(attr); return result; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java index b4234dcba3..fabf03440a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java @@ -89,7 +89,7 @@ public class DiffFormatterTest extends RepositoryTestCase { @Before public void setUp() throws Exception { super.setUp(); - testDb = new TestRepository<Repository>(db); + testDb = new TestRepository<>(db); df = new DiffFormatter(DisabledOutputStream.INSTANCE); df.setRepository(db); df.setAbbreviationLength(8); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java index 4315be9e49..64eb1c9ba5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java @@ -75,7 +75,7 @@ public class RenameDetectorTest extends RepositoryTestCase { @Before public void setUp() throws Exception { super.setUp(); - testDb = new TestRepository<Repository>(db); + testDb = new TestRepository<>(db); rd = new RenameDetector(db); } 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 3e780467bf..92ce4e178b 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 @@ -178,7 +178,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { .getObjectId()); assertEquals(cList.size(), jTree.getEntrySpan()); - final ArrayList<CGitLsTreeRecord> subtrees = new ArrayList<CGitLsTreeRecord>(); + final ArrayList<CGitLsTreeRecord> subtrees = new ArrayList<>(); for (final CGitLsTreeRecord r : cTree.values()) { if (FileMode.TREE.equals(r.mode)) subtrees.add(r); @@ -233,7 +233,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { } private static Map<String, CGitIndexRecord> readLsFiles() throws Exception { - final LinkedHashMap<String, CGitIndexRecord> r = new LinkedHashMap<String, CGitIndexRecord>(); + final LinkedHashMap<String, CGitIndexRecord> r = new LinkedHashMap<>(); final BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream(pathOf("gitgit.lsfiles")), "UTF-8")); try { @@ -249,7 +249,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { } private static Map<String, CGitLsTreeRecord> readLsTree() throws Exception { - final LinkedHashMap<String, CGitLsTreeRecord> r = new LinkedHashMap<String, CGitLsTreeRecord>(); + final LinkedHashMap<String, CGitLsTreeRecord> r = new LinkedHashMap<>(); final BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream(pathOf("gitgit.lstree")), "UTF-8")); try { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java index c85e156352..20897a8ba5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java @@ -72,7 +72,7 @@ public class DirCachePathEditTest { } private static final class RecordingEdit extends PathEdit { - final List<DirCacheEntry> entries = new ArrayList<DirCacheEntry>(); + final List<DirCacheEntry> entries = new ArrayList<>(); public RecordingEdit(String entryPath) { super(entryPath); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java index b1138f04cd..c97b318800 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java @@ -57,7 +57,7 @@ public class ManifestParserTest { public void testManifestParser() throws Exception { String baseUrl = "https://git.google.com/"; StringBuilder xmlContent = new StringBuilder(); - Set<String> results = new HashSet<String>(); + Set<String> results = new HashSet<>(); xmlContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\".\" />") diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java index b738f7ea74..e71ee6d25f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java @@ -206,7 +206,7 @@ public class DfsInserterTest { // Verify that we have a foo in both packs, and 1 of them is garbage. DfsReader reader = new DfsReader(db.getObjectDatabase()); DfsPackFile packs[] = db.getObjectDatabase().getPacks(); - Set<PackSource> pack_sources = new HashSet<PackSource>(); + Set<PackSource> pack_sources = new HashSet<>(); assertEquals(2, packs.length); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java index 29da63f0b0..343120ef5f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java @@ -87,7 +87,7 @@ public class AbbreviationTest extends LocalDiskRepositoryTestCase { super.setUp(); db = createBareRepository(); reader = db.newObjectReader(); - test = new TestRepository<Repository>(db); + test = new TestRepository<>(db); } @Override @@ -171,7 +171,7 @@ public class AbbreviationTest extends LocalDiskRepositoryTestCase { ObjectId id = id("9d5b926ed164e8ee88d3b8b1e525d699adda01ba"); byte[] idBuf = toByteArray(id); - List<PackedObjectInfo> objects = new ArrayList<PackedObjectInfo>(); + List<PackedObjectInfo> objects = new ArrayList<>(); for (int i = 0; i < 256; i++) { idBuf[9] = (byte) i; objects.add(new PackedObjectInfo(ObjectId.fromRaw(idBuf))); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java index 98a9501766..9998666052 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java @@ -57,7 +57,7 @@ import org.junit.Test; public class FileSnapshotTest { - private List<File> files = new ArrayList<File>(); + private List<File> files = new ArrayList<>(); private File trash; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java index fc91bd0381..d16998db55 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java @@ -67,7 +67,7 @@ public abstract class GcTestCase extends LocalDiskRepositoryTestCase { public void setUp() throws Exception { super.setUp(); repo = createWorkRepository(); - tr = new TestRepository<FileRepository>(repo, new RevWalk(repo), + tr = new TestRepository<>(repo, new RevWalk(repo), mockSystemReader); gc = new GC(repo); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java index 986bfe51d1..91bd523975 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java @@ -117,7 +117,7 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { cfg.install(); repo = createBareRepository(); - tr = new TestRepository<Repository>(repo); + tr = new TestRepository<>(repo); wc = (WindowCursor) repo.newObjectReader(); } @@ -291,7 +291,7 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { f = new FileOutputStream(idxName); try { - List<PackedObjectInfo> list = new ArrayList<PackedObjectInfo>(); + List<PackedObjectInfo> list = new ArrayList<>(); list.add(a); list.add(b); Collections.sort(list); 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 76df038764..c817dc3d7b 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 @@ -469,7 +469,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { public void testDeltaStatistics() throws Exception { config.setDeltaCompress(true); FileRepository repo = createBareRepository(); - TestRepository<FileRepository> testRepo = new TestRepository<FileRepository>(repo); + TestRepository<FileRepository> testRepo = new TestRepository<>(repo); ArrayList<RevObject> blobs = new ArrayList<>(); blobs.add(testRepo.blob(genDeltableData(1000))); blobs.add(testRepo.blob(genDeltableData(1005))); @@ -538,7 +538,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { public void testExclude() throws Exception { FileRepository repo = createBareRepository(); - TestRepository<FileRepository> testRepo = new TestRepository<FileRepository>( + TestRepository<FileRepository> testRepo = new TestRepository<>( repo); BranchBuilder bb = testRepo.branch("refs/heads/master"); contentA = testRepo.blob("A"); @@ -663,7 +663,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { private FileRepository setupRepoForShallowFetch() throws Exception { FileRepository repo = createBareRepository(); - TestRepository<Repository> r = new TestRepository<Repository>(repo); + TestRepository<Repository> r = new TestRepository<>(repo); BranchBuilder bb = r.branch("refs/heads/master"); contentA = r.blob("A"); contentB = r.blob("B"); @@ -731,7 +731,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { // TODO: testWritePackDeltasDepth() private void writeVerifyPack1() throws IOException { - final HashSet<ObjectId> interestings = new HashSet<ObjectId>(); + final HashSet<ObjectId> interestings = new HashSet<>(); interestings.add(ObjectId .fromString("82c6b885ff600be425b4ea96dee75dca255b69e7")); createVerifyOpenPack(interestings, NONE, false, false); @@ -754,10 +754,10 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { private void writeVerifyPack2(boolean deltaReuse) throws IOException { config.setReuseDeltas(deltaReuse); - final HashSet<ObjectId> interestings = new HashSet<ObjectId>(); + final HashSet<ObjectId> interestings = new HashSet<>(); interestings.add(ObjectId .fromString("82c6b885ff600be425b4ea96dee75dca255b69e7")); - final HashSet<ObjectId> uninterestings = new HashSet<ObjectId>(); + final HashSet<ObjectId> uninterestings = new HashSet<>(); uninterestings.add(ObjectId .fromString("540a36d136cf413e4b064c2b0e0a4db60f77feab")); createVerifyOpenPack(interestings, uninterestings, false, false); @@ -786,10 +786,10 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { } private void writeVerifyPack4(final boolean thin) throws IOException { - final HashSet<ObjectId> interestings = new HashSet<ObjectId>(); + final HashSet<ObjectId> interestings = new HashSet<>(); interestings.add(ObjectId .fromString("82c6b885ff600be425b4ea96dee75dca255b69e7")); - final HashSet<ObjectId> uninterestings = new HashSet<ObjectId>(); + final HashSet<ObjectId> uninterestings = new HashSet<>(); uninterestings.add(ObjectId .fromString("c59759f143fb1fe21c197981df75a7ee00290799")); createVerifyOpenPack(interestings, uninterestings, thin, false); @@ -878,7 +878,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { } private void verifyObjectsOrder(final ObjectId objectsOrder[]) { - final List<PackIndex.MutableEntry> entries = new ArrayList<PackIndex.MutableEntry>(); + final List<PackIndex.MutableEntry> entries = new ArrayList<>(); for (MutableEntry me : pack) { entries.add(me.cloneEntry()); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java index b5df7a66c6..53db123d34 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java @@ -108,7 +108,7 @@ public class RefDirectoryTest extends LocalDiskRepositoryTestCase { diskRepo = createBareRepository(); refdir = (RefDirectory) diskRepo.getRefDatabase(); - repo = new TestRepository<Repository>(diskRepo); + repo = new TestRepository<>(diskRepo); A = repo.commit().create(); B = repo.commit(repo.getRevWalk().parseCommit(A)); v1_0 = repo.tag("v1_0", B); @@ -1023,7 +1023,7 @@ public class RefDirectoryTest extends LocalDiskRepositoryTestCase { assertEquals(v0_1.getId(), all.get("refs/tags/v0.1").getObjectId()); all = refdir.getRefs(RefDatabase.ALL); - refdir.pack(new ArrayList<String>(all.keySet())); + refdir.pack(new ArrayList<>(all.keySet())); all = refdir.getRefs(RefDatabase.ALL); assertEquals(5, all.size()); @@ -1267,8 +1267,8 @@ public class RefDirectoryTest extends LocalDiskRepositoryTestCase { final RefDatabase refDb = newRepo.getRefDatabase(); File packedRefs = new File(newRepo.getDirectory(), "packed-refs"); assertTrue(packedRefs.createNewFile()); - final AtomicReference<StackOverflowError> error = new AtomicReference<StackOverflowError>(); - final AtomicReference<IOException> exception = new AtomicReference<IOException>(); + final AtomicReference<StackOverflowError> error = new AtomicReference<>(); + final AtomicReference<IOException> exception = new AtomicReference<>(); final AtomicInteger changeCount = new AtomicInteger(); newRepo.getListenerList().addRefsChangedListener( new RefsChangedListener() { 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 aa061bafc0..cc348388cf 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 @@ -73,7 +73,7 @@ public class WindowCacheGetTest extends SampleDataRepositoryTestCase { public void setUp() throws Exception { super.setUp(); - toLoad = new ArrayList<TestObject>(); + toLoad = new ArrayList<>(); final BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream(JGitTestUtil .getTestResourceFile("all_packed_objects.txt")), diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchTrackingStatusTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchTrackingStatusTest.java index e261b96732..8e5641930d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchTrackingStatusTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchTrackingStatusTest.java @@ -60,7 +60,7 @@ public class BranchTrackingStatusTest extends RepositoryTestCase { @Override public void setUp() throws Exception { super.setUp(); - util = new TestRepository<Repository>(db); + util = new TestRepository<>(db); StoredConfig config = util.getRepository().getConfig(); config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, "master", ConfigConstants.CONFIG_KEY_REMOTE, "origin"); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java index aebbafeff2..e9505f67d0 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java @@ -139,7 +139,7 @@ public class ConfigTest { @Test public void test005_PutGetStringList() { Config c = new Config(); - final LinkedList<String> values = new LinkedList<String>(); + final LinkedList<String> values = new LinkedList<>(); values.add("value1"); values.add("value2"); c.setStringList("my", null, "somename", values); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java index 388456f949..75b574e92c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java @@ -130,7 +130,7 @@ public class DirCacheCheckoutTest extends RepositoryTestCase { if ((args.length % 2) > 0) throw new IllegalArgumentException("needs to be pairs"); - HashMap<String, String> map = new HashMap<String, String>(); + HashMap<String, String> map = new HashMap<>(); for (int i = 0; i < args.length; i += 2) { map.put(args[i], args[i + 1]); } @@ -228,7 +228,7 @@ public class DirCacheCheckoutTest extends RepositoryTestCase { @Test public void testInitialCheckout() throws Exception { try (Git git = new Git(db)) { - TestRepository<Repository> db_t = new TestRepository<Repository>(db); + TestRepository<Repository> db_t = new TestRepository<>(db); BranchBuilder master = db_t.branch("master"); master.commit().add("f", "1").message("m0").create(); assertFalse(new File(db.getWorkTree(), "f").exists()); @@ -377,7 +377,7 @@ public class DirCacheCheckoutTest extends RepositoryTestCase { // rules 4 and 5 HashMap<String, String> idxMap; - idxMap = new HashMap<String, String>(); + idxMap = new HashMap<>(); idxMap.put("foo", "foo"); setupCase(null, null, idxMap); go(); @@ -387,7 +387,7 @@ public class DirCacheCheckoutTest extends RepositoryTestCase { assertTrue(getConflicts().isEmpty()); // rules 6 and 7 - idxMap = new HashMap<String, String>(); + idxMap = new HashMap<>(); idxMap.put("foo", "foo"); setupCase(null, idxMap, idxMap); go(); @@ -396,7 +396,7 @@ public class DirCacheCheckoutTest extends RepositoryTestCase { // rules 8 and 9 HashMap<String, String> mergeMap; - mergeMap = new HashMap<String, String>(); + mergeMap = new HashMap<>(); mergeMap.put("foo", "merge"); setupCase(null, mergeMap, idxMap); @@ -408,7 +408,7 @@ public class DirCacheCheckoutTest extends RepositoryTestCase { // rule 10 - HashMap<String, String> headMap = new HashMap<String, String>(); + HashMap<String, String> headMap = new HashMap<>(); headMap.put("foo", "foo"); setupCase(headMap, null, idxMap); go(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java index 3c1ff98600..2cb8f86fc2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java @@ -210,7 +210,7 @@ public class IndexDiffTest extends RepositoryTestCase { diff.diff(); assertEquals("[b]", - new TreeSet<String>(diff.getChanged()).toString()); + new TreeSet<>(diff.getChanged()).toString()); assertEquals("[]", diff.getAdded().toString()); assertEquals("[]", diff.getRemoved().toString()); assertEquals("[]", diff.getMissing().toString()); @@ -251,7 +251,7 @@ public class IndexDiffTest extends RepositoryTestCase { IndexDiff diff = new IndexDiff(db, Constants.HEAD, iterator); diff.diff(); - assertEquals("[]", new TreeSet<String>(diff.getChanged()).toString()); + assertEquals("[]", new TreeSet<>(diff.getChanged()).toString()); assertEquals("[]", diff.getAdded().toString()); assertEquals("[]", diff.getRemoved().toString()); assertEquals("[]", diff.getMissing().toString()); @@ -291,7 +291,7 @@ public class IndexDiffTest extends RepositoryTestCase { IndexDiff diff = new IndexDiff(db, Constants.HEAD, iterator); diff.diff(); - assertEquals("[]", new TreeSet<String>(diff.getChanged()).toString()); + assertEquals("[]", new TreeSet<>(diff.getChanged()).toString()); assertEquals("[]", diff.getAdded().toString()); assertEquals("[]", diff.getRemoved().toString()); assertEquals("[]", diff.getMissing().toString()); @@ -444,7 +444,7 @@ public class IndexDiffTest extends RepositoryTestCase { diff = new IndexDiff(db, Constants.HEAD, new FileTreeIterator(db)); diff.diff(); - assertEquals(new HashSet<String>(Arrays.asList("target")), + assertEquals(new HashSet<>(Arrays.asList("target")), diff.getUntrackedFolders()); writeTrashFile("src/tst/A.java", ""); @@ -452,7 +452,7 @@ public class IndexDiffTest extends RepositoryTestCase { diff = new IndexDiff(db, Constants.HEAD, new FileTreeIterator(db)); diff.diff(); - assertEquals(new HashSet<String>(Arrays.asList("target", "src/tst")), + assertEquals(new HashSet<>(Arrays.asList("target", "src/tst")), diff.getUntrackedFolders()); git.rm().addFilepattern("src/com/B.java").addFilepattern("src/org") @@ -463,7 +463,7 @@ public class IndexDiffTest extends RepositoryTestCase { diff = new IndexDiff(db, Constants.HEAD, new FileTreeIterator(db)); diff.diff(); assertEquals( - new HashSet<String>(Arrays.asList("src/org", "src/tst", + new HashSet<>(Arrays.asList("src/org", "src/tst", "target")), diff.getUntrackedFolders()); } @@ -497,7 +497,7 @@ public class IndexDiffTest extends RepositoryTestCase { diff = new IndexDiff(db, Constants.HEAD, new FileTreeIterator(db)); diff.diff(); - assertEquals(new HashSet<String>(Arrays.asList("src")), + assertEquals(new HashSet<>(Arrays.asList("src")), diff.getUntrackedFolders()); git.add().addFilepattern("src").call(); @@ -510,7 +510,7 @@ public class IndexDiffTest extends RepositoryTestCase { diff = new IndexDiff(db, Constants.HEAD, new FileTreeIterator(db)); diff.diff(); assertEquals( - new HashSet<String>(Arrays.asList("srcs/com", "sr", "src/tst", + new HashSet<>(Arrays.asList("srcs/com", "sr", "src/tst", "target")), diff.getUntrackedFolders()); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdOwnerMapTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdOwnerMapTest.java index a36a5e9429..898fcb6686 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdOwnerMapTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdOwnerMapTest.java @@ -73,7 +73,7 @@ public class ObjectIdOwnerMapTest { @Test public void testEmptyMap() { - ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<SubId>(); + ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<>(); assertTrue(m.isEmpty()); assertEquals(0, m.size()); @@ -86,7 +86,7 @@ public class ObjectIdOwnerMapTest { @Test public void testAddGetAndContains() { - ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<SubId>(); + ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<>(); m.add(id_1); m.add(id_2); m.add(id_3); @@ -108,7 +108,7 @@ public class ObjectIdOwnerMapTest { @Test public void testClear() { - ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<SubId>(); + ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<>(); m.add(id_1); assertSame(id_1, m.get(id_1)); @@ -126,7 +126,7 @@ public class ObjectIdOwnerMapTest { @Test public void testAddIfAbsent() { - ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<SubId>(); + ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<>(); m.add(id_1); assertSame(id_1, m.addIfAbsent(new SubId(id_1))); @@ -145,7 +145,7 @@ public class ObjectIdOwnerMapTest { @Test public void testAddGrowsWithObjects() { int n = 16384; - ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<SubId>(); + ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<>(); m.add(id_1); for (int i = 32; i < n; i++) m.add(new SubId(id(i))); @@ -159,7 +159,7 @@ public class ObjectIdOwnerMapTest { @Test public void testAddIfAbsentGrowsWithObjects() { int n = 16384; - ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<SubId>(); + ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<>(); m.add(id_1); for (int i = 32; i < n; i++) m.addIfAbsent(new SubId(id(i))); @@ -172,7 +172,7 @@ public class ObjectIdOwnerMapTest { @Test public void testIterator() { - ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<SubId>(); + ObjectIdOwnerMap<SubId> m = new ObjectIdOwnerMap<>(); m.add(id_1); m.add(id_2); m.add(id_3); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSubclassMapTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSubclassMapTest.java index 07561deac1..adb2b12601 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSubclassMapTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSubclassMapTest.java @@ -73,7 +73,7 @@ public class ObjectIdSubclassMapTest { @Test public void testEmptyMap() { - ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<SubId>(); + ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<>(); assertTrue(m.isEmpty()); assertEquals(0, m.size()); @@ -86,7 +86,7 @@ public class ObjectIdSubclassMapTest { @Test public void testAddGetAndContains() { - ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<SubId>(); + ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<>(); m.add(id_1); m.add(id_2); m.add(id_3); @@ -108,7 +108,7 @@ public class ObjectIdSubclassMapTest { @Test public void testClear() { - ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<SubId>(); + ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<>(); m.add(id_1); assertSame(id_1, m.get(id_1)); @@ -126,7 +126,7 @@ public class ObjectIdSubclassMapTest { @Test public void testAddIfAbsent() { - ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<SubId>(); + ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<>(); m.add(id_1); assertSame(id_1, m.addIfAbsent(new SubId(id_1))); @@ -144,7 +144,7 @@ public class ObjectIdSubclassMapTest { @Test public void testAddGrowsWithObjects() { - ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<SubId>(); + ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<>(); m.add(id_1); for (int i = 32; i < 8000; i++) m.add(new SubId(id(i))); @@ -157,7 +157,7 @@ public class ObjectIdSubclassMapTest { @Test public void testAddIfAbsentGrowsWithObjects() { - ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<SubId>(); + ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<>(); m.add(id_1); for (int i = 32; i < 8000; i++) m.addIfAbsent(new SubId(id(i))); @@ -170,7 +170,7 @@ public class ObjectIdSubclassMapTest { @Test public void testIterator() { - ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<SubId>(); + ObjectIdSubclassMap<SubId> m = new ObjectIdSubclassMap<>(); m.add(id_1); m.add(id_2); m.add(id_3); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java index aa46d1a2b2..2da144c876 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java @@ -60,7 +60,7 @@ import org.eclipse.jgit.util.FileUtils; public class RacyGitTests extends RepositoryTestCase { public void testIterator() throws IllegalStateException, IOException, InterruptedException { - TreeSet<Long> modTimes = new TreeSet<Long>(); + TreeSet<Long> modTimes = new TreeSet<>(); File lastFile = null; for (int i = 0; i < 10; i++) { lastFile = new File(db.getWorkTree(), "0." + i); @@ -123,7 +123,7 @@ public class RacyGitTests extends RepositoryTestCase { public void testRacyGitDetection() throws IOException, IllegalStateException, InterruptedException { - TreeSet<Long> modTimes = new TreeSet<Long>(); + TreeSet<Long> modTimes = new TreeSet<>(); File lastFile; // wait to ensure that modtimes of the file doesn't match last index diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java index c88eb3bd9e..1c21194248 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java @@ -63,7 +63,7 @@ public class RefDatabaseConflictingNamesTest { @Override public Map<String, Ref> getRefs(String prefix) throws IOException { if (ALL.equals(prefix)) { - Map<String, Ref> existing = new HashMap<String, Ref>(); + Map<String, Ref> existing = new HashMap<>(); existing.put("refs/heads/a/b", null /* not used */); existing.put("refs/heads/q", null /* not used */); return existing; @@ -141,8 +141,8 @@ public class RefDatabaseConflictingNamesTest { private void assertConflictingNames(String proposed, String... conflicts) throws IOException { - Set<String> expected = new HashSet<String>(Arrays.asList(conflicts)); + Set<String> expected = new HashSet<>(Arrays.asList(conflicts)); assertEquals(expected, - new HashSet<String>(refDatabase.getConflictingNames(proposed))); + new HashSet<>(refDatabase.getConflictingNames(proposed))); } } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java index 707757b343..7fb3309982 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java @@ -99,7 +99,7 @@ public class RefTest extends SampleDataRepositoryTestCase { "ab/c", "dummy", true); config.save(); assertEquals("[ab/c, origin]", - new TreeSet<String>(db.getRemoteNames()).toString()); + new TreeSet<>(db.getRemoteNames()).toString()); // one-level deep remote branch assertEquals("master", diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/RecursiveMergerTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/RecursiveMergerTest.java index 0e7109c58a..039a6e8cfc 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/RecursiveMergerTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/RecursiveMergerTest.java @@ -110,7 +110,7 @@ public class RecursiveMergerTest extends RepositoryTestCase { @Before public void setUp() throws Exception { super.setUp(); - db_t = new TestRepository<FileRepository>(db); + db_t = new TestRepository<>(db); } @Theory @@ -778,7 +778,7 @@ public class RecursiveMergerTest extends RepositoryTestCase { db.close(); file.delete(); db = new FileRepository(db.getDirectory()); - db_t = new TestRepository<FileRepository>(db); + db_t = new TestRepository<>(db); break; } } @@ -846,7 +846,7 @@ public class RecursiveMergerTest extends RepositoryTestCase { db.getConfig().setBoolean("core", null, "bare", true); db.getDirectory().renameTo(new File(workTreeFile, "test.git")); db = new FileRepository(new File(workTreeFile, "test.git")); - db_t = new TestRepository<FileRepository>(db); + db_t = new TestRepository<>(db); } } finally { if (fos != null) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/DefaultNoteMergerTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/DefaultNoteMergerTest.java index d3a6f18389..a8d3904c84 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/DefaultNoteMergerTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/DefaultNoteMergerTest.java @@ -75,7 +75,7 @@ public class DefaultNoteMergerTest extends RepositoryTestCase { @Before public void setUp() throws Exception { super.setUp(); - tr = new TestRepository<Repository>(db); + tr = new TestRepository<>(db); reader = db.newObjectReader(); inserter = db.newObjectInserter(); merger = new DefaultNoteMerger(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapMergerTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapMergerTest.java index be7bead6bd..117ea0c7d2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapMergerTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapMergerTest.java @@ -97,7 +97,7 @@ public class NoteMapMergerTest extends RepositoryTestCase { @Before public void setUp() throws Exception { super.setUp(); - tr = new TestRepository<Repository>(db); + tr = new TestRepository<>(db); reader = db.newObjectReader(); inserter = db.newObjectInserter(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapTest.java index 325c9e2eba..a4a4909bcf 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapTest.java @@ -83,7 +83,7 @@ public class NoteMapTest extends RepositoryTestCase { public void setUp() throws Exception { super.setUp(); - tr = new TestRepository<Repository>(db); + tr = new TestRepository<>(db); reader = db.newObjectReader(); inserter = db.newObjectInserter(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java index d32172ae09..f265315338 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java @@ -96,7 +96,7 @@ public class AbstractPlotRendererTest extends RepositoryTestCase { throws IOException { TestPlotWalk walk = new TestPlotWalk(db); walk.markStart(walk.parseCommit(start)); - PlotCommitList<PlotLane> commitList = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> commitList = new PlotCommitList<>(); commitList.source(walk); commitList.fillTo(1000); return commitList; @@ -116,7 +116,7 @@ public class AbstractPlotRendererTest extends RepositoryTestCase { private static class TestPlotRenderer extends AbstractPlotRenderer<PlotLane, Object> { - List<Integer> indentations = new LinkedList<Integer>(); + List<Integer> indentations = new LinkedList<>(); @Override protected int drawLabel(int x, int y, Ref ref) { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/PlotCommitListTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/PlotCommitListTest.java index ecc119b29a..9a6043f321 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/PlotCommitListTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/PlotCommitListTest.java @@ -123,7 +123,7 @@ public class PlotCommitListTest extends RevWalkTestCase { } private static Set<Integer> asSet(int... numbers) { - Set<Integer> result = new HashSet<Integer>(); + Set<Integer> result = new HashSet<>(); for (int n : numbers) result.add(Integer.valueOf(n)); return result; @@ -138,7 +138,7 @@ public class PlotCommitListTest extends RevWalkTestCase { PlotWalk pw = new PlotWalk(db); pw.markStart(pw.lookupCommit(c.getId())); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -159,7 +159,7 @@ public class PlotCommitListTest extends RevWalkTestCase { PlotWalk pw = new PlotWalk(db); pw.markStart(pw.lookupCommit(d.getId())); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -181,7 +181,7 @@ public class PlotCommitListTest extends RevWalkTestCase { pw.markStart(pw.lookupCommit(b.getId())); pw.markStart(pw.lookupCommit(c.getId())); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -205,7 +205,7 @@ public class PlotCommitListTest extends RevWalkTestCase { pw.markStart(pw.lookupCommit(c.getId())); pw.markStart(pw.lookupCommit(d.getId())); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -240,7 +240,7 @@ public class PlotCommitListTest extends RevWalkTestCase { // pw.markStart(pw.lookupCommit(f.getId())); pw.markStart(pw.lookupCommit(g.getId())); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -274,7 +274,7 @@ public class PlotCommitListTest extends RevWalkTestCase { pw.markStart(pw.lookupCommit(i.getId())); pw.markStart(pw.lookupCommit(g.getId())); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); Set<Integer> childPositions = asSet(0, 1); @@ -333,7 +333,7 @@ public class PlotCommitListTest extends RevWalkTestCase { PlotWalk pw = new PlotWalk(db); pw.markStart(pw.lookupCommit(merge_fixed_logged_npe.getId())); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -406,7 +406,7 @@ public class PlotCommitListTest extends RevWalkTestCase { PlotWalk pw = new PlotWalk(db); pw.markStart(pw.lookupCommit(m3)); pw.markStart(pw.lookupCommit(s2)); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -471,7 +471,7 @@ public class PlotCommitListTest extends RevWalkTestCase { pw.markStart(pw.lookupCommit(e.getId())); pw.markStart(pw.lookupCommit(a5.getId())); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -520,7 +520,7 @@ public class PlotCommitListTest extends RevWalkTestCase { PlotWalk pw = new PlotWalk(db); pw.markStart(pw.lookupCommit(a4)); pw.markStart(pw.lookupCommit(b3)); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -565,7 +565,7 @@ public class PlotCommitListTest extends RevWalkTestCase { PlotWalk pw = new PlotWalk(db); pw.markStart(pw.lookupCommit(a4)); pw.markStart(pw.lookupCommit(b3)); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -615,7 +615,7 @@ public class PlotCommitListTest extends RevWalkTestCase { pw.markStart(pw.lookupCommit(a4)); pw.markStart(pw.lookupCommit(b2)); pw.markStart(pw.lookupCommit(c)); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -654,7 +654,7 @@ public class PlotCommitListTest extends RevWalkTestCase { PlotWalk pw = new PlotWalk(db); pw.markStart(pw.lookupCommit(a3)); pw.markStart(pw.lookupCommit(b1)); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(2); // don't process a1 @@ -677,7 +677,7 @@ public class PlotCommitListTest extends RevWalkTestCase { PlotWalk pw = new PlotWalk(db); pw.markStart(pw.lookupCommit(a)); pw.markStart(pw.lookupCommit(b)); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); @@ -696,7 +696,7 @@ public class PlotCommitListTest extends RevWalkTestCase { PlotWalk pw = new PlotWalk(db); pw.markStart(pw.lookupCommit(a)); pw.markStart(pw.lookupCommit(b2)); - PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>(); + PlotCommitList<PlotLane> pcl = new PlotCommitList<>(); pcl.source(pw); pcl.fillTo(Integer.MAX_VALUE); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java index a4252ee11f..a280045d4e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java @@ -72,7 +72,7 @@ public class FIFORevQueueTest extends RevQueueTestCase<FIFORevQueue> { @Test public void testAddLargeBlocks() throws Exception { - final ArrayList<RevCommit> lst = new ArrayList<RevCommit>(); + final ArrayList<RevCommit> lst = new ArrayList<>(); for (int i = 0; i < 3 * BlockRevQueue.Block.BLOCK_SIZE; i++) { final RevCommit c = commit(); lst.add(c); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java index eaf0f8ad51..ed8bc70d94 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java @@ -73,7 +73,7 @@ public class LIFORevQueueTest extends RevQueueTestCase<LIFORevQueue> { @Test public void testAddLargeBlocks() throws Exception { - final ArrayList<RevCommit> lst = new ArrayList<RevCommit>(); + final ArrayList<RevCommit> lst = new ArrayList<>(); for (int i = 0; i < 3 * BlockRevQueue.Block.BLOCK_SIZE; i++) { final RevCommit c = commit(); lst.add(c); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitListTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitListTest.java index 4d75322f42..c069ba841b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitListTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitListTest.java @@ -62,7 +62,7 @@ public class RevCommitListTest extends RepositoryTestCase { for (int i = 0; i < count; i++) git.commit().setCommitter(committer).setAuthor(author) .setMessage("commit " + i).call(); - list = new RevCommitList<RevCommit>(); + list = new RevCommitList<>(); w.markStart(w.lookupCommit(db.resolve(Constants.HEAD))); list.source(w); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java index 05e552e419..1860185493 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java @@ -58,7 +58,7 @@ import org.junit.Test; public class RevWalkFollowFilterTest extends RevWalkTestCase { private static class DiffCollector extends RenameCallback { - List<DiffEntry> diffs = new ArrayList<DiffEntry>(); + List<DiffEntry> diffs = new ArrayList<>(); @Override public void renamed(DiffEntry diff) { 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 2ff08dd713..631e3956fc 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 @@ -95,7 +95,7 @@ public class RevWalkPathFilter6012Test extends RevWalkTestCase { h = commit(f.getTree(), g, f); i = commit(tree(file(pA, zS), file(pE, zY), file(pF, zF)), h); - byName = new HashMap<RevCommit, String>(); + byName = new HashMap<>(); for (Field z : RevWalkPathFilter6012Test.class.getDeclaredFields()) { if (z.getType() == RevCommit.class) byName.put((RevCommit) z.get(this), z.getName()); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java index 30586ee1e2..f12cc0872f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java @@ -62,7 +62,7 @@ public abstract class RevWalkTestCase extends RepositoryTestCase { @Override public void setUp() throws Exception { super.setUp(); - util = new TestRepository<Repository>(db, createRevWalk()); + util = new TestRepository<>(db, createRevWalk()); rw = util.getRevWalk(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java index 2b032e13c6..8998a85462 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java @@ -91,7 +91,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { @Before public void setUp() throws Exception { super.setUp(); - testDb = new TestRepository<Repository>(db); + testDb = new TestRepository<>(db); } @Test diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java index 3dc022d386..ea15ebe7de 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java @@ -113,7 +113,7 @@ public class HttpAuthTest { } private static class AuthHeadersResponse extends JDKHttpConnection { - Map<String, List<String>> headerFields = new HashMap<String, List<String>>(); + Map<String, List<String>> headerFields = new HashMap<>(); public AuthHeadersResponse(String[] authHeaders) throws MalformedURLException, IOException { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/LongMapTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/LongMapTest.java index 3e427e5dfb..1a86aaff33 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/LongMapTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/LongMapTest.java @@ -57,7 +57,7 @@ public class LongMapTest { @Before public void setUp() throws Exception { - map = new LongMap<Long>(); + map = new LongMap<>(); } @Test diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java index c829be900e..b2497b879a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java @@ -169,7 +169,7 @@ public class PackParserTest extends RepositoryTestCase { @Test public void testPackWithDuplicateBlob() throws Exception { final byte[] data = Constants.encode("0123456789abcdefg"); - TestRepository<Repository> d = new TestRepository<Repository>(db); + TestRepository<Repository> d = new TestRepository<>(db); assertTrue(db.hasObject(d.blob(data))); TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024); 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 bd3faf4ef7..104a69c9f7 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 @@ -83,8 +83,8 @@ public class PushProcessTest extends SampleDataRepositoryTestCase { public void setUp() throws Exception { super.setUp(); transport = new MockTransport(db, new URIish()); - refUpdates = new HashSet<RemoteRefUpdate>(); - advertisedRefs = new HashSet<Ref>(); + refUpdates = new HashSet<>(); + advertisedRefs = new HashSet<>(); connectionUpdateStatus = Status.OK; } @@ -421,7 +421,7 @@ public class PushProcessTest extends SampleDataRepositoryTestCase { private class MockPushConnection extends BaseConnection implements PushConnection { MockPushConnection() { - final Map<String, Ref> refsMap = new HashMap<String, Ref>(); + final Map<String, Ref> refsMap = new HashMap<>(); for (final Ref r : advertisedRefs) refsMap.put(r.getName(), r); available(refsMap); 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 0fa266a651..3411122888 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 @@ -108,7 +108,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas // Fill dst with a some common history. // - TestRepository<Repository> d = new TestRepository<Repository>(dst); + TestRepository<Repository> d = new TestRepository<>(dst); a = d.blob("a"); A = d.commit(d.tree(d.file("a", a))); B = d.commit().parent(A).create(); @@ -183,7 +183,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas // Now use b but in a different commit than what is hidden. // - TestRepository<Repository> s = new TestRepository<Repository>(src); + TestRepository<Repository> s = new TestRepository<>(src); RevCommit N = s.commit().parent(B).add("q", b).create(); s.update(R_MASTER, N); @@ -274,7 +274,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas @Test public void testUsingHiddenDeltaBaseFails() throws Exception { byte[] delta = { 0x1, 0x1, 0x1, 'c' }; - TestRepository<Repository> s = new TestRepository<Repository>(src); + TestRepository<Repository> s = new TestRepository<>(src); RevCommit N = s.commit().parent(B).add("q", s.blob(BinaryDelta.apply(dst.open(b).getCachedBytes(), delta))) .create(); @@ -327,7 +327,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas public void testUsingHiddenCommonBlobFails() throws Exception { // Try to use the 'b' blob that is hidden. // - TestRepository<Repository> s = new TestRepository<Repository>(src); + TestRepository<Repository> s = new TestRepository<>(src); RevCommit N = s.commit().parent(B).add("q", s.blob("b")).create(); // But don't include it in the pack. @@ -377,7 +377,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas public void testUsingUnknownBlobFails() throws Exception { // Try to use the 'n' blob that is not on the server. // - TestRepository<Repository> s = new TestRepository<Repository>(src); + TestRepository<Repository> s = new TestRepository<>(src); RevBlob n = s.blob("n"); RevCommit N = s.commit().parent(B).add("q", n).create(); @@ -426,7 +426,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas @Test public void testUsingUnknownTreeFails() throws Exception { - TestRepository<Repository> s = new TestRepository<Repository>(src); + TestRepository<Repository> s = new TestRepository<>(src); RevCommit N = s.commit().parent(B).add("q", s.blob("a")).create(); RevTree t = s.parseBody(N).getTree(); @@ -548,7 +548,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas private static final class HidePrivateHook extends AbstractAdvertiseRefsHook { @Override public Map<String, Ref> getAdvertisedRefs(Repository r, RevWalk revWalk) { - Map<String, Ref> refs = new HashMap<String, Ref>(r.getAllRefs()); + Map<String, Ref> refs = new HashMap<>(r.getAllRefs()); assertNotNull(refs.remove(R_PRIVATE)); return refs; } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java index 31b64187c8..b926e482f6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java @@ -98,10 +98,10 @@ public class TestProtocolTest { @Before public void setUp() throws Exception { - protos = new ArrayList<TransportProtocol>(); - local = new TestRepository<InMemoryRepository>( + protos = new ArrayList<>(); + local = new TestRepository<>( new InMemoryRepository(new DfsRepositoryDescription("local"))); - remote = new TestRepository<InMemoryRepository>( + remote = new TestRepository<>( new InMemoryRepository(new DfsRepositoryDescription("remote"))); } @@ -240,7 +240,7 @@ public class TestProtocolTest { private TestProtocol<User> registerProto(UploadPackFactory<User> upf, ReceivePackFactory<User> rpf) { - TestProtocol<User> proto = new TestProtocol<User>(upf, rpf); + TestProtocol<User> proto = new TestProtocol<>(upf, rpf); protos.add(proto); Transport.register(proto); return proto; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java index a60bb39cea..def9d93a86 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java @@ -460,14 +460,14 @@ public class WalkEncryptionTest { static List<String> cryptoCipherList(String regex) { Set<String> source = Security.getAlgorithms("Cipher"); - Set<String> target = new TreeSet<String>(); + Set<String> target = new TreeSet<>(); for (String algo : source) { algo = algo.toUpperCase(Locale.ROOT); if (algo.matches(regex)) { target.add(algo); } } - return new ArrayList<String>(target); + return new ArrayList<>(target); } /** @@ -599,7 +599,7 @@ public class WalkEncryptionTest { } static List<Object[]> product(List<String> one, List<String> two) { - List<Object[]> result = new ArrayList<Object[]>(); + List<Object[]> result = new ArrayList<>(); for (String s1 : one) { for (String s2 : two) { result.add(new Object[] { s1, s2 }); @@ -1241,10 +1241,10 @@ public class WalkEncryptionTest { @Parameters(name = "Profile: {0} Version: {1}") public static Collection<Object[]> argsList() { - List<String> algorithmList = new ArrayList<String>(); + List<String> algorithmList = new ArrayList<>(); algorithmList.addAll(cryptoCipherListPBE()); - List<String> versionList = new ArrayList<String>(); + List<String> versionList = new ArrayList<>(); versionList.add("0"); versionList.add("1"); @@ -1284,10 +1284,10 @@ public class WalkEncryptionTest { @Parameters(name = "Profile: {0} Version: {1}") public static Collection<Object[]> argsList() { - List<String> algorithmList = new ArrayList<String>(); + List<String> algorithmList = new ArrayList<>(); algorithmList.addAll(cryptoCipherListTrans()); - List<String> versionList = new ArrayList<String>(); + List<String> versionList = new ArrayList<>(); versionList.add("1"); return product(algorithmList, versionList); 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 3885c41688..38adda3120 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 @@ -118,7 +118,7 @@ public class PathSuffixFilterTest extends RepositoryTestCase { tw.setRecursive(recursiveWalk); tw.addTree(treeId); - List<String> paths = new ArrayList<String>(); + List<String> paths = new ArrayList<>(); while (tw.next()) paths.add(tw.getPathString()); return paths; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java index 8b042bd67c..0a3de85f7c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java @@ -57,22 +57,22 @@ public class BlockListTest { public void testEmptyList() { BlockList<String> empty; - empty = new BlockList<String>(); + empty = new BlockList<>(); assertEquals(0, empty.size()); assertTrue(empty.isEmpty()); assertFalse(empty.iterator().hasNext()); - empty = new BlockList<String>(0); + empty = new BlockList<>(0); assertEquals(0, empty.size()); assertTrue(empty.isEmpty()); assertFalse(empty.iterator().hasNext()); - empty = new BlockList<String>(1); + empty = new BlockList<>(1); assertEquals(0, empty.size()); assertTrue(empty.isEmpty()); assertFalse(empty.iterator().hasNext()); - empty = new BlockList<String>(64); + empty = new BlockList<>(64); assertEquals(0, empty.size()); assertTrue(empty.isEmpty()); assertFalse(empty.iterator().hasNext()); @@ -80,7 +80,7 @@ public class BlockListTest { @Test public void testGet() { - BlockList<String> list = new BlockList<String>(4); + BlockList<String> list = new BlockList<>(4); try { list.get(-1); @@ -121,7 +121,7 @@ public class BlockListTest { @Test public void testSet() { - BlockList<String> list = new BlockList<String>(4); + BlockList<String> list = new BlockList<>(4); try { list.set(-1, "foo"); @@ -168,7 +168,7 @@ public class BlockListTest { @Test public void testAddToEnd() { - BlockList<Integer> list = new BlockList<Integer>(4); + BlockList<Integer> list = new BlockList<>(4); int cnt = BlockList.BLOCK_SIZE * 3; for (int i = 0; i < cnt; i++) @@ -192,7 +192,7 @@ public class BlockListTest { @Test public void testAddSlowPath() { - BlockList<String> list = new BlockList<String>(4); + BlockList<String> list = new BlockList<>(4); String fooStr = "foo"; String barStr = "bar"; @@ -223,7 +223,7 @@ public class BlockListTest { @Test public void testRemoveFromEnd() { - BlockList<String> list = new BlockList<String>(4); + BlockList<String> list = new BlockList<>(4); String fooStr = "foo"; String barStr = "bar"; @@ -245,7 +245,7 @@ public class BlockListTest { @Test public void testRemoveSlowPath() { - BlockList<String> list = new BlockList<String>(4); + BlockList<String> list = new BlockList<>(4); String fooStr = "foo"; String barStr = "bar"; @@ -270,7 +270,7 @@ public class BlockListTest { @Test public void testAddRemoveAdd() { - BlockList<Integer> list = new BlockList<Integer>(); + BlockList<Integer> list = new BlockList<>(); for (int i = 0; i < BlockList.BLOCK_SIZE + 1; i++) list.add(Integer.valueOf(i)); assertEquals(Integer.valueOf(BlockList.BLOCK_SIZE), @@ -283,14 +283,14 @@ public class BlockListTest { @Test public void testAddAllFromOtherList() { - BlockList<Integer> src = new BlockList<Integer>(4); + BlockList<Integer> src = new BlockList<>(4); int cnt = BlockList.BLOCK_SIZE * 2; for (int i = 0; i < cnt; i++) src.add(Integer.valueOf(42 + i)); src.add(Integer.valueOf(1)); - BlockList<Integer> dst = new BlockList<Integer>(4); + BlockList<Integer> dst = new BlockList<>(4); dst.add(Integer.valueOf(255)); dst.addAll(src); assertEquals(cnt + 2, dst.size()); @@ -301,7 +301,7 @@ public class BlockListTest { @Test public void testFastIterator() { - BlockList<Integer> list = new BlockList<Integer>(4); + BlockList<Integer> list = new BlockList<>(4); int cnt = BlockList.BLOCK_SIZE * 3; for (int i = 0; i < cnt; i++) @@ -318,7 +318,7 @@ public class BlockListTest { @Test public void testAddRejectsBadIndexes() { - BlockList<Integer> list = new BlockList<Integer>(4); + BlockList<Integer> list = new BlockList<>(4); list.add(Integer.valueOf(41)); try { @@ -336,7 +336,7 @@ public class BlockListTest { @Test public void testRemoveRejectsBadIndexes() { - BlockList<Integer> list = new BlockList<Integer>(4); + BlockList<Integer> list = new BlockList<>(4); list.add(Integer.valueOf(41)); try { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ReadLinesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ReadLinesTest.java index 1fe3dbd32c..796af991c9 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ReadLinesTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ReadLinesTest.java @@ -51,7 +51,7 @@ import org.junit.Before; import org.junit.Test; public class ReadLinesTest { - List<String> l = new ArrayList<String>(); + List<String> l = new ArrayList<>(); @Before public void clearList() { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefListTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefListTest.java index 4b7ab26f49..5a1468a8b6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefListTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefListTest.java @@ -89,7 +89,7 @@ public class RefListTest { @Test public void testEmptyBuilder() { - RefList<Ref> list = new RefList.Builder<Ref>().toRefList(); + RefList<Ref> list = new RefList.Builder<>().toRefList(); assertEquals(0, list.size()); assertFalse(list.iterator().hasNext()); assertEquals(-1, list.find("a")); @@ -111,7 +111,7 @@ public class RefListTest { @Test public void testBuilder_AddThenSort() { - RefList.Builder<Ref> builder = new RefList.Builder<Ref>(1); + RefList.Builder<Ref> builder = new RefList.Builder<>(1); builder.add(REF_B); builder.add(REF_A); @@ -129,7 +129,7 @@ public class RefListTest { @Test public void testBuilder_AddAll() { - RefList.Builder<Ref> builder = new RefList.Builder<Ref>(1); + RefList.Builder<Ref> builder = new RefList.Builder<>(1); Ref[] src = { REF_A, REF_B, REF_c, REF_A }; builder.addAll(src, 1, 2); @@ -141,7 +141,7 @@ public class RefListTest { @Test public void testBuilder_Set() { - RefList.Builder<Ref> builder = new RefList.Builder<Ref>(); + RefList.Builder<Ref> builder = new RefList.Builder<>(); builder.add(REF_A); builder.add(REF_A); @@ -163,7 +163,7 @@ public class RefListTest { @Test public void testBuilder_Remove() { - RefList.Builder<Ref> builder = new RefList.Builder<Ref>(); + RefList.Builder<Ref> builder = new RefList.Builder<>(); builder.add(REF_A); builder.add(REF_B); builder.remove(0); @@ -364,7 +364,7 @@ public class RefListTest { exp.append(REF_B); exp.append("]"); - RefList.Builder<Ref> list = new RefList.Builder<Ref>(); + RefList.Builder<Ref> list = new RefList.Builder<>(); list.add(REF_A); list.add(REF_B); assertEquals(exp.toString(), list.toString()); @@ -442,16 +442,16 @@ public class RefListTest { @Test public void testCopyConstructorReusesArray() { - RefList.Builder<Ref> one = new RefList.Builder<Ref>(); + RefList.Builder<Ref> one = new RefList.Builder<>(); one.add(REF_A); - RefList<Ref> two = new RefList<Ref>(one.toRefList()); + RefList<Ref> two = new RefList<>(one.toRefList()); one.set(0, REF_B); assertSame(REF_B, two.get(0)); } private static RefList<Ref> toList(Ref... refs) { - RefList.Builder<Ref> b = new RefList.Builder<Ref>(refs.length); + RefList.Builder<Ref> b = new RefList.Builder<>(refs.length); b.addAll(refs, 0, refs.length); return b.toRefList(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java index 78ab27a851..e6402a46dc 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java @@ -481,7 +481,7 @@ public class RefMapTest { } private static RefList<Ref> toList(Ref... refs) { - RefList.Builder<Ref> b = new RefList.Builder<Ref>(refs.length); + RefList.Builder<Ref> b = new RefList.Builder<>(refs.length); b.addAll(refs, 0, refs.length); return b.toRefList(); } |