aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2017-02-20 13:17:27 +0900
committerMatthias Sohn <matthias.sohn@sap.com>2017-02-20 22:47:23 +0100
commit3b4448637fbb9d74e0c9d44048ba76bb7c1214ce (patch)
tree85bbb116d5b0336cb365a3f5a4d6c074afe80cc6
parent43eb8511f5d8225c0b4e2f899db2126334e5facf (diff)
downloadjgit-3b4448637fbb9d74e0c9d44048ba76bb7c1214ce.tar.gz
jgit-3b4448637fbb9d74e0c9d44048ba76bb7c1214ce.zip
Enable and fix warnings about redundant specification of type arguments
Since the introduction of generic type parameter inference in Java 7, it's not necessary to explicitly specify the type of generic parameters. Enable the warning in Eclipse, and fix all occurrences. Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r--org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java2
-rw-r--r--org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java4
-rw-r--r--org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java4
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java4
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java2
-rw-r--r--org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java2
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java2
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java10
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java2
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java6
-rw-r--r--org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java4
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java4
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java6
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java2
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java4
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java2
-rw-r--r--org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java6
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java2
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java4
-rw-r--r--org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java10
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java6
-rw-r--r--org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java4
-rw-r--r--org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java2
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java12
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java2
-rw-r--r--org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java6
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java4
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java12
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java4
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java4
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java14
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java6
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java10
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java14
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java2
-rw-r--r--org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java6
-rw-r--r--org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/TreeWalkAttributeTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/ManifestParserTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java18
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java8
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchTrackingStatusTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java12
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java16
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdOwnerMapTest.java14
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSubclassMapTest.java14
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/RecursiveMergerTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/DefaultNoteMergerTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapMergerTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/AbstractPlotRendererTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/PlotCommitListTest.java32
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitListTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter6012Test.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/LongMapTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java14
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java8
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java14
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java32
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ReadLinesTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefListTest.java18
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RefMapTest.java2
-rw-r--r--org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java2
-rw-r--r--org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyResult.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNode.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesRule.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/HashedSequencePair.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/LowLevelDiffAlgorithm.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java26
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/Subsequence.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerList.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java20
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRefDatabase.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java22
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObjectCache.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BaseSearch.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaCache.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java40
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java28
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java18
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/LongMap.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/NetRC.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java16
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java16
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TestProtocol.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java16
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java20
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java22
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java14
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/FileResolver.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java2
289 files changed, 765 insertions, 765 deletions
diff --git a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
index 47cca36924..64f74989e1 100644
--- a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.ant.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.ant/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs
index adfb7aa3b5..4d260cf480 100644
--- a/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.ant/.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.archive/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs
index 763144c86b..06ddbabb48 100644
--- a/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.archive/.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.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java
index 1be126aa8a..9d3decd933 100644
--- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java
+++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ArchiveFormats.java
@@ -55,7 +55,7 @@ import org.eclipse.jgit.api.ArchiveCommand;
* that performs the same registration automatically.
*/
public class ArchiveFormats {
- private static final List<String> myFormats = new ArrayList<String>();
+ private static final List<String> myFormats = new ArrayList<>();
private static final void register(String name, ArchiveCommand.Format<?> fmt) {
myFormats.add(name);
diff --git a/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs
index adfb7aa3b5..4d260cf480 100644
--- a/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.http.apache/.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.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
index 9285d17662..945ecd5812 100644
--- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
+++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
@@ -264,9 +264,9 @@ public class HttpClientConnection implements HttpConnection {
@Override
public Map<String, List<String>> getHeaderFields() {
- Map<String, List<String>> ret = new HashMap<String, List<String>>();
+ Map<String, List<String>> ret = new HashMap<>();
for (Header hdr : resp.getAllHeaders()) {
- List<String> list = new LinkedList<String>();
+ List<String> list = new LinkedList<>();
for (HeaderElement hdrElem : hdr.getElements())
list.add(hdrElem.toString());
ret.put(hdr.getName(), list);
diff --git a/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs
index adfb7aa3b5..4d260cf480 100644
--- a/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.http.server/.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.http.server/src/org/eclipse/jgit/http/server/GitFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java
index 529b8391fa..807037155c 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java
@@ -95,9 +95,9 @@ public class GitFilter extends MetaFilter {
private ReceivePackFactory<HttpServletRequest> receivePackFactory = new DefaultReceivePackFactory();
- private final List<Filter> uploadPackFilters = new LinkedList<Filter>();
+ private final List<Filter> uploadPackFilters = new LinkedList<>();
- private final List<Filter> receivePackFilters = new LinkedList<Filter>();
+ private final List<Filter> receivePackFilters = new LinkedList<>();
/**
* New servlet that will load its base directory from {@code web.xml}.
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java
index 800c5d4fee..adb6c425df 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java
@@ -89,7 +89,7 @@ public class MetaFilter implements Filter {
/** Empty filter with no bindings. */
public MetaFilter() {
- this.bindings = new ArrayList<ServletBinderImpl>();
+ this.bindings = new ArrayList<>();
}
/**
@@ -144,7 +144,7 @@ public class MetaFilter implements Filter {
}
private static Set<Object> newIdentitySet() {
- final Map<Object, Object> m = new IdentityHashMap<Object, Object>();
+ final Map<Object, Object> m = new IdentityHashMap<>();
return new AbstractSet<Object>() {
@Override
public boolean add(Object o) {
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java
index c2b0370977..4e879a9760 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java
@@ -58,7 +58,7 @@ abstract class ServletBinderImpl implements ServletBinder {
private HttpServlet httpServlet;
ServletBinderImpl() {
- this.filters = new ArrayList<Filter>();
+ this.filters = new ArrayList<>();
}
@Override
diff --git a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
index 47cca36924..64f74989e1 100644
--- a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.http.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.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java
index 822df7175f..ab6dc35f79 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java
@@ -213,7 +213,7 @@ public class DumbClientDumbServerTest extends HttpTestCase {
@Test
public void testInitialClone_Packed() throws Exception {
- new TestRepository<Repository>(remoteRepository).packAndPrune();
+ new TestRepository<>(remoteRepository).packAndPrune();
Repository dst = createBareRepository();
assertFalse(dst.hasObject(A_txt));
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java
index ab4ac131ef..06bfd7988b 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java
@@ -241,7 +241,7 @@ public class DumbClientSmartServerTest extends HttpTestCase {
@Test
public void testInitialClone_Packed() throws Exception {
- new TestRepository<Repository>(remoteRepository).packAndPrune();
+ new TestRepository<>(remoteRepository).packAndPrune();
Repository dst = createBareRepository();
assertFalse(dst.hasObject(A_txt));
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java
index 7c6d591513..82e79b8e50 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java
@@ -83,7 +83,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
private static void assertUnreasonable(String name)
throws ServiceNotEnabledException {
- FileResolver<RepositoryResolver> r = new FileResolver<RepositoryResolver>(
+ FileResolver<RepositoryResolver> r = new FileResolver<>(
new File("."), false);
try {
r.open(null, name);
@@ -103,7 +103,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
FileResolver<RepositoryResolver> resolver;
assertFalse("no git-daemon-export-ok", export.exists());
- resolver = new FileResolver<RepositoryResolver>(base, false /*
+ resolver = new FileResolver<>(base, false /*
* require
* flag
*/);
@@ -114,7 +114,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
assertEquals("Service not enabled", e.getMessage());
}
- resolver = new FileResolver<RepositoryResolver>(base, true /*
+ resolver = new FileResolver<>(base, true /*
* export
* all
*/);
@@ -125,7 +125,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
}
FileUtils.createNewFile(export);
- resolver = new FileResolver<RepositoryResolver>(base, false /*
+ resolver = new FileResolver<>(base, false /*
* require
* flag
*/);
@@ -142,7 +142,7 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
final Repository a = createBareRepository();
final String name = a.getDirectory().getName() + "-not-a-git";
final File base = a.getDirectory().getParentFile();
- FileResolver<RepositoryResolver> resolver = new FileResolver<RepositoryResolver>(
+ FileResolver<RepositoryResolver> resolver = new FileResolver<>(
base, false);
try {
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java
index 0a68ed2617..ef8daec31f 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java
@@ -112,7 +112,7 @@ public class SetAdditionalHeadersTest extends HttpTestCase {
assertTrue("isa TransportHttp", t instanceof TransportHttp);
assertTrue("isa HttpTransport", t instanceof HttpTransport);
- HashMap<String, String> headers = new HashMap<String, String>();
+ HashMap<String, String> headers = new HashMap<>();
headers.put("Cookie", "someTokenValue=23gBog34");
headers.put("AnotherKey", "someValue");
((TransportHttp) t).setAdditionalHeaders(headers);
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
index f887da4c77..ed223c96ef 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
@@ -437,7 +437,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
// Create a new commit on the remote.
//
- b = new TestRepository<Repository>(remoteRepository).branch(master);
+ b = new TestRepository<>(remoteRepository).branch(master);
RevCommit Z = b.commit().message("Z").create();
// Now incrementally update.
@@ -497,7 +497,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
// Create a new commit on the remote.
//
- b = new TestRepository<Repository>(remoteRepository).branch(master);
+ b = new TestRepository<>(remoteRepository).branch(master);
RevCommit Z = b.commit().message("Z").create();
// Now incrementally update.
@@ -614,7 +614,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
final String repoName = "refs-unreadable";
RefsUnreadableInMemoryRepository badRefsRepo = new RefsUnreadableInMemoryRepository(
new DfsRepositoryDescription(repoName));
- final TestRepository<Repository> repo = new TestRepository<Repository>(
+ final TestRepository<Repository> repo = new TestRepository<>(
badRefsRepo);
ServletContextHandler app = noRefServer.addContext("/git");
diff --git a/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs
index 47cca36924..64f74989e1 100644
--- a/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.junit.http/.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.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java
index 6580ade8ea..6b7853d730 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java
@@ -76,7 +76,7 @@ public class AccessEvent {
}
private static Map<String, String> cloneHeaders(final Request req) {
- Map<String, String> r = new TreeMap<String, String>();
+ Map<String, String> r = new TreeMap<>();
Enumeration hn = req.getHeaderNames();
while (hn.hasMoreElements()) {
String key = (String) hn.nextElement();
@@ -88,7 +88,7 @@ public class AccessEvent {
}
private static Map<String, String> cloneHeaders(final Response rsp) {
- Map<String, String> r = new TreeMap<String, String>();
+ Map<String, String> r = new TreeMap<>();
Enumeration<String> hn = rsp.getHttpFields().getFieldNames();
while (hn.hasMoreElements()) {
String key = hn.nextElement();
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
index 1575cb650c..e9480fa9ff 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
@@ -262,7 +262,7 @@ public class AppServer {
/** @return all requests since the server was started. */
public List<AccessEvent> getRequests() {
- return new ArrayList<AccessEvent>(log.getEvents());
+ return new ArrayList<>(log.getEvents());
}
/**
@@ -282,7 +282,7 @@ public class AppServer {
* @return all requests which match the given path.
*/
public List<AccessEvent> getRequests(String path) {
- ArrayList<AccessEvent> r = new ArrayList<AccessEvent>();
+ ArrayList<AccessEvent> r = new ArrayList<>();
for (AccessEvent event : log.getEvents()) {
if (event.getPath().equals(path)) {
r.add(event);
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java
index 5db76eb7b9..1b94e02fa4 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java
@@ -88,7 +88,7 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase {
protected TestRepository<Repository> createTestRepository()
throws IOException {
- return new TestRepository<Repository>(createBareRepository());
+ return new TestRepository<>(createBareRepository());
}
protected URIish toURIish(String path) throws URISyntaxException {
@@ -120,12 +120,12 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase {
protected static void fsck(Repository db, RevObject... tips)
throws Exception {
TestRepository<? extends Repository> tr =
- new TestRepository<Repository>(db);
+ new TestRepository<>(db);
tr.fsck(tips);
}
protected static Set<RefSpec> mirror(String... refs) {
- HashSet<RefSpec> r = new HashSet<RefSpec>();
+ HashSet<RefSpec> r = new HashSet<>();
for (String name : refs) {
RefSpec rs = new RefSpec(name);
rs = rs.setDestination(name);
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java
index 4f11ea8fca..9defcd9833 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java
@@ -52,7 +52,7 @@ import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
public class MockServletConfig implements ServletConfig {
- private final Map<String, String> parameters = new HashMap<String, String>();
+ private final Map<String, String> parameters = new HashMap<>();
public void setInitParameter(String name, String value) {
parameters.put(name, value);
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
index 5fed122637..f28ef893bb 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
@@ -53,7 +53,7 @@ import org.slf4j.helpers.MessageFormatter;
/** Logs warnings into an array for later inspection. */
public class RecordingLogger implements Logger {
- private static List<Warning> warnings = new ArrayList<Warning>();
+ private static List<Warning> warnings = new ArrayList<>();
/** Clear the warnings, automatically done by {@link AppServer#setUp()} */
public static void clear() {
@@ -65,7 +65,7 @@ public class RecordingLogger implements Logger {
/** @return the warnings (if any) from the last execution */
public static List<Warning> getWarnings() {
synchronized (warnings) {
- ArrayList<Warning> copy = new ArrayList<Warning>(warnings);
+ ArrayList<Warning> copy = new ArrayList<>(warnings);
return Collections.unmodifiableList(copy);
}
}
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java
index 14ea03a921..c218c07a6c 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/TestRequestLog.java
@@ -61,7 +61,7 @@ import org.eclipse.jetty.server.handler.HandlerWrapper;
class TestRequestLog extends HandlerWrapper {
private static final int MAX = 16;
- private final List<AccessEvent> events = new ArrayList<AccessEvent>();
+ private final List<AccessEvent> events = new ArrayList<>();
private final Semaphore active = new Semaphore(MAX);
diff --git a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
index 47cca36924..64f74989e1 100644
--- a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.junit/.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.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
index b7929424f2..933faf9bfa 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
@@ -286,7 +286,7 @@ public abstract class LocalDiskRepositoryTestCase {
throws IllegalStateException, IOException {
DirCache dc = repo.readDirCache();
StringBuilder sb = new StringBuilder();
- TreeSet<Long> timeStamps = new TreeSet<Long>();
+ TreeSet<Long> timeStamps = new TreeSet<>();
// iterate once over the dircache just to collect all time stamps
if (0 != (includedOptions & MOD_TIME)) {
@@ -552,7 +552,7 @@ public abstract class LocalDiskRepositoryTestCase {
}
private static HashMap<String, String> cloneEnv() {
- return new HashMap<String, String>(System.getenv());
+ return new HashMap<>(System.getenv());
}
private static final class CleanupThread extends Thread {
@@ -574,7 +574,7 @@ public abstract class LocalDiskRepositoryTestCase {
}
}
- private final List<File> toDelete = new ArrayList<File>();
+ private final List<File> toDelete = new ArrayList<>();
@Override
public void run() {
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 6faa2ece48..68482c6c27 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
@@ -88,7 +88,7 @@ public class MockSystemReader extends SystemReader {
long now = 1250379778668L; // Sat Aug 15 20:12:58 GMT-03:30 2009
- final Map<String, String> values = new HashMap<String, String>();
+ final Map<String, String> values = new HashMap<>();
FileBasedConfig userGitConfig;
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 a44e999378..d1358ee2a5 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
@@ -876,7 +876,7 @@ public class TestRepository<R extends Repository> {
final File pack, idx;
try (PackWriter pw = new PackWriter(db)) {
- Set<ObjectId> all = new HashSet<ObjectId>();
+ Set<ObjectId> all = new HashSet<>();
for (Ref r : db.getAllRefs().values())
all.add(r.getObjectId());
pw.preparePack(m, all, PackWriter.NONE);
@@ -992,7 +992,7 @@ public class TestRepository<R extends Repository> {
private ObjectId topLevelTree;
- private final List<RevCommit> parents = new ArrayList<RevCommit>(2);
+ private final List<RevCommit> parents = new ArrayList<>(2);
private int tick = 1;
diff --git a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
index 47cca36924..64f74989e1 100644
--- a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs.server.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.lfs.server/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs
index 2db1c4f21b..ede0f7d55d 100644
--- a/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs.server/.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.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java
index c229758d43..ed896adff2 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java
@@ -94,10 +94,10 @@ public class S3Repository implements LargeFileRepository {
@Override
public Response.Action getDownloadAction(AnyLongObjectId oid) {
URL endpointUrl = getObjectUrl(oid);
- Map<String, String> queryParams = new HashMap<String, String>();
+ Map<String, String> queryParams = new HashMap<>();
queryParams.put(X_AMZ_EXPIRES,
Integer.toString(s3Config.getExpirationSeconds()));
- Map<String, String> headers = new HashMap<String, String>();
+ Map<String, String> headers = new HashMap<>();
String authorizationQueryParameters = SignerV4.createAuthorizationQuery(
s3Config, endpointUrl, METHOD_GET, headers, queryParams,
UNSIGNED_PAYLOAD);
@@ -111,7 +111,7 @@ public class S3Repository implements LargeFileRepository {
public Response.Action getUploadAction(AnyLongObjectId oid, long size) {
cacheObjectMetaData(oid, size);
URL objectUrl = getObjectUrl(oid);
- Map<String, String> headers = new HashMap<String, String>();
+ Map<String, String> headers = new HashMap<>();
headers.put(X_AMZ_CONTENT_SHA256, oid.getName());
headers.put(HDR_CONTENT_LENGTH, Long.toString(size));
headers.put(X_AMZ_STORAGE_CLASS, s3Config.getStorageClass());
@@ -134,10 +134,10 @@ public class S3Repository implements LargeFileRepository {
@Override
public long getSize(AnyLongObjectId oid) throws IOException {
URL endpointUrl = getObjectUrl(oid);
- Map<String, String> queryParams = new HashMap<String, String>();
+ Map<String, String> queryParams = new HashMap<>();
queryParams.put(X_AMZ_EXPIRES,
Integer.toString(s3Config.getExpirationSeconds()));
- Map<String, String> headers = new HashMap<String, String>();
+ Map<String, String> headers = new HashMap<>();
String authorizationQueryParameters = SignerV4.createAuthorizationQuery(
s3Config, endpointUrl, METHOD_HEAD, headers, queryParams,
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
index 4149484c8c..a9b0ec46e4 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
@@ -240,7 +240,7 @@ class SignerV4 {
private static String canonicalizeHeaderNames(
Map<String, String> headers) {
- List<String> sortedHeaders = new ArrayList<String>();
+ List<String> sortedHeaders = new ArrayList<>();
sortedHeaders.addAll(headers.keySet());
Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER);
@@ -260,7 +260,7 @@ class SignerV4 {
return ""; //$NON-NLS-1$
}
- List<String> sortedHeaders = new ArrayList<String>();
+ List<String> sortedHeaders = new ArrayList<>();
sortedHeaders.addAll(headers.keySet());
Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER);
@@ -305,7 +305,7 @@ class SignerV4 {
return ""; //$NON-NLS-1$
}
- SortedMap<String, String> sorted = new TreeMap<String, String>();
+ SortedMap<String, String> sorted = new TreeMap<>();
Iterator<Map.Entry<String, String>> pairs = parameters.entrySet()
.iterator();
diff --git a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
index 47cca36924..64f74989e1 100644
--- a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs.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.lfs/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs
index 2db1c4f21b..ede0f7d55d 100644
--- a/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.lfs/.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.pgm.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
index 47cca36924..64f74989e1 100644
--- a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.pgm.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.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java
index 0bc2a3f8db..0eeababc5d 100644
--- a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java
+++ b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java
@@ -79,7 +79,7 @@ public class CLIRepositoryTestCase extends LocalDiskRepositoryTestCase {
* @throws Exception
*/
protected String[] executeUnchecked(String... cmds) throws Exception {
- List<String> result = new ArrayList<String>(cmds.length);
+ List<String> result = new ArrayList<>(cmds.length);
for (String cmd : cmds) {
result.addAll(CLIGitCommand.executeUnchecked(cmd, db));
}
@@ -97,7 +97,7 @@ public class CLIRepositoryTestCase extends LocalDiskRepositoryTestCase {
* @throws Exception
*/
protected String[] execute(String... cmds) throws Exception {
- List<String> result = new ArrayList<String>(cmds.length);
+ List<String> result = new ArrayList<>(cmds.length);
for (String cmd : cmds) {
Result r = CLIGitCommand.executeRaw(cmd, db);
if (r.ex instanceof TerminatedByHelpException) {
diff --git a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
index 2d0c8974eb..69eb1989d7 100644
--- a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
+++ b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
@@ -189,7 +189,7 @@ public class CLIGitCommand extends Main {
* @return the array
*/
static String[] split(String commandLine) {
- final List<String> list = new ArrayList<String>();
+ final List<String> list = new ArrayList<>();
boolean inquote = false;
boolean inDblQuote = false;
StringBuilder r = new StringBuilder();
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
index c0593a78f3..18c49ea286 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
@@ -529,7 +529,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
@Test
public void testArchiveWithLongFilename() throws Exception {
StringBuilder filename = new StringBuilder();
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
for (int i = 0; i < 20; i++) {
filename.append("1234567890/");
l.add(filename.toString());
@@ -549,7 +549,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
@Test
public void testTarWithLongFilename() throws Exception {
StringBuilder filename = new StringBuilder();
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
for (int i = 0; i < 20; i++) {
filename.append("1234567890/");
l.add(filename.toString());
@@ -691,7 +691,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
}
private static String[] listZipEntries(byte[] zipData) throws IOException {
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
ZipInputStream in = new ZipInputStream(
new ByteArrayInputStream(zipData));
@@ -719,7 +719,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
}
private String[] listTarEntries(byte[] tarData) throws Exception {
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
Process proc = spawnAssumingCommandPresent("tar", "tf", "-");
BufferedReader reader = readFromProcess(proc);
OutputStream out = proc.getOutputStream();
@@ -750,7 +750,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
continue;
// found!
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
BufferedReader reader = new BufferedReader(
new InputStreamReader(in, "UTF-8"));
String line;
@@ -765,7 +765,7 @@ public class ArchiveTest extends CLIRepositoryTestCase {
private String[] tarEntryContent(byte[] tarData, String path)
throws Exception {
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
Process proc = spawnAssumingCommandPresent("tar", "Oxf", "-", path);
BufferedReader reader = readFromProcess(proc);
OutputStream out = proc.getOutputStream();
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java
index 23aa97eeed..c43accdb6f 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java
@@ -73,7 +73,7 @@ public class ConfigTest extends CLIRepositoryTestCase {
.equals("Mac OS X");
String[] output = execute("git config --list");
- List<String> expect = new ArrayList<String>();
+ List<String> expect = new ArrayList<>();
expect.add("core.filemode=" + !isWindows);
expect.add("core.logallrefupdates=true");
if (isMac)
diff --git a/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs
index 763144c86b..06ddbabb48 100644
--- a/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.pgm/.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.pgm/src/org/eclipse/jgit/pgm/Add.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java
index c36c485197..3c13590307 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java
@@ -58,7 +58,7 @@ class Add extends TextBuiltin {
private boolean update = false;
@Argument(required = true, metaVar = "metaVar_filepattern", usage = "usage_filesToAddContentFrom")
- private List<String> filepatterns = new ArrayList<String>();
+ private List<String> filepatterns = new ArrayList<>();
@Override
protected void run() throws Exception {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java
index 0f541715ab..419325405f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java
@@ -114,7 +114,7 @@ class Blame extends TextBuiltin {
private String rangeString;
@Option(name = "--reverse", metaVar = "metaVar_blameReverse", usage = "usage_blameReverse")
- private List<RevCommit> reverseRange = new ArrayList<RevCommit>(2);
+ private List<RevCommit> reverseRange = new ArrayList<>(2);
@Argument(index = 0, required = false, metaVar = "metaVar_revision")
private String revision;
@@ -124,7 +124,7 @@ class Blame extends TextBuiltin {
private ObjectReader reader;
- private final Map<RevCommit, String> abbreviatedCommits = new HashMap<RevCommit, String>();
+ private final Map<RevCommit, String> abbreviatedCommits = new HashMap<>();
private SimpleDateFormat dateFmt;
@@ -163,7 +163,7 @@ class Blame extends TextBuiltin {
if (!reverseRange.isEmpty()) {
RevCommit rangeStart = null;
- List<RevCommit> rangeEnd = new ArrayList<RevCommit>(2);
+ List<RevCommit> rangeEnd = new ArrayList<>(2);
for (RevCommit c : reverseRange) {
if (c.has(RevFlag.UNINTERESTING))
rangeStart = c;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
index 5f3740cbba..f6e3810a86 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
@@ -149,7 +149,7 @@ class Branch extends TextBuiltin {
@Argument(metaVar = "metaVar_name")
private String branch;
- private final Map<String, Ref> printRefs = new LinkedHashMap<String, Ref>();
+ private final Map<String, Ref> printRefs = new LinkedHashMap<>();
/** Only set for verbose branch listing at-the-moment */
private RevWalk rw;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
index 0c3b720fb6..c2f3c4675a 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
@@ -78,7 +78,7 @@ class Checkout extends TextBuiltin {
private String name;
@Option(name = "--", metaVar = "metaVar_paths", multiValued = true, handler = RestOfArgumentsHandler.class)
- private List<String> paths = new ArrayList<String>();
+ private List<String> paths = new ArrayList<>();
@Override
protected void run() throws Exception {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java
index 99ba3b4b48..cf4c6e3339 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java
@@ -100,7 +100,7 @@ public class CommandCatalog {
* @return all common commands, sorted by command name.
*/
public static CommandRef[] common() {
- final ArrayList<CommandRef> common = new ArrayList<CommandRef>();
+ final ArrayList<CommandRef> common = new ArrayList<>();
for (final CommandRef c : INSTANCE.commands.values())
if (c.isCommon())
common.add(c);
@@ -124,7 +124,7 @@ public class CommandCatalog {
private CommandCatalog() {
ldr = Thread.currentThread().getContextClassLoader();
- commands = new HashMap<String, CommandRef>();
+ commands = new HashMap<>();
final Enumeration<URL> catalogs = catalogs();
while (catalogs.hasMoreElements())
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
index 2cfbd86fa3..befc4ec272 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
@@ -75,7 +75,7 @@ class Commit extends TextBuiltin {
private boolean amend;
@Argument(metaVar = "metaVar_commitPaths", usage = "usage_CommitPaths")
- private List<String> paths = new ArrayList<String>();
+ private List<String> paths = new ArrayList<>();
@Override
protected void run() throws NoHeadException, NoMessageException,
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
index a7bdde9f66..1008593be3 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
@@ -87,16 +87,16 @@ class Daemon extends TextBuiltin {
int timeout = -1;
@Option(name = "--enable", metaVar = "metaVar_service", usage = "usage_enableTheServiceInAllRepositories", multiValued = true)
- final List<String> enable = new ArrayList<String>();
+ final List<String> enable = new ArrayList<>();
@Option(name = "--disable", metaVar = "metaVar_service", usage = "usage_disableTheServiceInAllRepositories", multiValued = true)
- final List<String> disable = new ArrayList<String>();
+ final List<String> disable = new ArrayList<>();
@Option(name = "--allow-override", metaVar = "metaVar_service", usage = "usage_configureTheServiceInDaemonServicename", multiValued = true)
- final List<String> canOverride = new ArrayList<String>();
+ final List<String> canOverride = new ArrayList<>();
@Option(name = "--forbid-override", metaVar = "metaVar_service", usage = "usage_configureTheServiceInDaemonServicename", multiValued = true)
- final List<String> forbidOverride = new ArrayList<String>();
+ final List<String> forbidOverride = new ArrayList<>();
@Option(name = "--export-all", usage = "usage_exportWithoutGitDaemonExportOk")
boolean exportAll;
@@ -109,7 +109,7 @@ class Daemon extends TextBuiltin {
}
@Argument(required = true, metaVar = "metaVar_directory", usage = "usage_directoriesToExport")
- final List<File> directory = new ArrayList<File>();
+ final List<File> directory = new ArrayList<>();
@Override
protected boolean requiresRepository() {
@@ -139,7 +139,7 @@ class Daemon extends TextBuiltin {
if (1 < threads)
packConfig.setExecutor(Executors.newFixedThreadPool(threads));
- final FileResolver<DaemonClient> resolver = new FileResolver<DaemonClient>();
+ final FileResolver<DaemonClient> resolver = new FileResolver<>();
for (final File f : directory) {
outw.println(MessageFormat.format(CLIText.get().exporting, f.getAbsolutePath()));
resolver.exportDirectory(f);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java
index 95c2132435..56b62418c0 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java
@@ -67,7 +67,7 @@ class DiffTree extends TextBuiltin {
}
@Argument(index = 1, metaVar = "metaVar_treeish", required = true)
- private final List<AbstractTreeIterator> trees = new ArrayList<AbstractTreeIterator>();
+ private final List<AbstractTreeIterator> trees = new ArrayList<>();
@Option(name = "--", metaVar = "metaVar_path", multiValued = true, handler = PathTreeFilterHandler.class)
private TreeFilter pathFilter = TreeFilter.ALL;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
index 82c401ff86..1108ddd10b 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
@@ -94,7 +94,7 @@ class Log extends RevWalkTextBuiltin {
@Option(name = "--no-standard-notes", usage = "usage_noShowStandardNotes")
private boolean noStandardNotes;
- private List<String> additionalNoteRefs = new ArrayList<String>();
+ private List<String> additionalNoteRefs = new ArrayList<>();
@Option(name = "--show-notes", usage = "usage_showNotes", metaVar = "metaVar_ref")
void addAdditionalNoteRef(String notesRef) {
@@ -204,7 +204,7 @@ class Log extends RevWalkTextBuiltin {
if (!noStandardNotes || !additionalNoteRefs.isEmpty()) {
createWalk();
- noteMaps = new LinkedHashMap<String, NoteMap>();
+ noteMaps = new LinkedHashMap<>();
if (!noStandardNotes) {
addNoteMap(Constants.R_NOTES_COMMITS);
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
index f35d4fdba8..7a5f3d8116 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
@@ -74,7 +74,7 @@ class LsRemote extends TextBuiltin {
protected void run() throws Exception {
LsRemoteCommand command = Git.lsRemoteRepository().setRemote(remote)
.setTimeout(timeout).setHeads(heads).setTags(tags);
- TreeSet<Ref> refs = new TreeSet<Ref>(new Comparator<Ref>() {
+ TreeSet<Ref> refs = new TreeSet<>(new Comparator<Ref>() {
@Override
public int compare(Ref r1, Ref r2) {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java
index 872ea67774..02d61e53e2 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java
@@ -68,7 +68,7 @@ class LsTree extends TextBuiltin {
@Argument(index = 1)
@Option(name = "--", metaVar = "metaVar_paths", multiValued = true, handler = StopOptionHandler.class)
- private List<String> paths = new ArrayList<String>();
+ private List<String> paths = new ArrayList<>();
@Override
protected void run() throws Exception {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
index 7d111ffccb..3addecb2f9 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
@@ -91,7 +91,7 @@ public class Main {
private TextBuiltin subcommand;
@Argument(index = 1, metaVar = "metaVar_arg")
- private List<String> arguments = new ArrayList<String>();
+ private List<String> arguments = new ArrayList<>();
PrintWriter writer;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java
index 9dcd5129b6..f8bae1d8be 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java
@@ -63,7 +63,7 @@ class MergeBase extends TextBuiltin {
}
@Argument(index = 1, metaVar = "metaVar_commitish", required = true)
- private final List<RevCommit> commits = new ArrayList<RevCommit>();
+ private final List<RevCommit> commits = new ArrayList<>();
@Override
protected void run() throws Exception {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
index 98af186b2f..1b805d16fc 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
@@ -77,7 +77,7 @@ class Push extends TextBuiltin {
private String remote = Constants.DEFAULT_REMOTE_NAME;
@Argument(index = 1, metaVar = "metaVar_refspec")
- private final List<RefSpec> refSpecs = new ArrayList<RefSpec>();
+ private final List<RefSpec> refSpecs = new ArrayList<>();
@Option(name = "--all")
private boolean all;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
index 6833ad3c05..a66b7fa639 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
@@ -68,7 +68,7 @@ class RevParse extends TextBuiltin {
boolean verify;
@Argument(index = 0, metaVar = "metaVar_commitish")
- private final List<ObjectId> commits = new ArrayList<ObjectId>();
+ private final List<ObjectId> commits = new ArrayList<>();
@Override
protected void run() throws Exception {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
index 1543586802..74135e4bae 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
@@ -124,12 +124,12 @@ abstract class RevWalkTextBuiltin extends TextBuiltin {
private String followPath;
@Argument(index = 0, metaVar = "metaVar_commitish")
- private final List<RevCommit> commits = new ArrayList<RevCommit>();
+ private final List<RevCommit> commits = new ArrayList<>();
@Option(name = "--", metaVar = "metaVar_path", multiValued = true, handler = PathTreeFilterHandler.class)
protected TreeFilter pathFilter = TreeFilter.ALL;
- private final List<RevFilter> revLimiter = new ArrayList<RevFilter>();
+ private final List<RevFilter> revLimiter = new ArrayList<>();
@Option(name = "--author")
void addAuthorRevFilter(final String who) {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java
index f4f864b397..79c3f094e8 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Rm.java
@@ -58,7 +58,7 @@ class Rm extends TextBuiltin {
@Argument(metaVar = "metaVar_path", usage = "usage_path", multiValued = true, required = true)
@Option(name = "--", handler = StopOptionHandler.class)
- private List<String> paths = new ArrayList<String>();
+ private List<String> paths = new ArrayList<>();
@Override
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
index 43b292e39c..b7f5e58285 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
@@ -117,7 +117,7 @@ class Status extends TextBuiltin {
Map<String, StageState> conflicting = status.getConflictingStageState();
// build a sorted list of all paths except untracked and ignored
- TreeSet<String> sorted = new TreeSet<String>();
+ TreeSet<String> sorted = new TreeSet<>();
sorted.addAll(added);
sorted.addAll(changed);
sorted.addAll(removed);
@@ -185,7 +185,7 @@ class Status extends TextBuiltin {
// untracked are always at the end of the list
if ("all".equals(untrackedFilesMode)) { //$NON-NLS-1$
- TreeSet<String> untracked = new TreeSet<String>(
+ TreeSet<String> untracked = new TreeSet<>(
status.getUntracked());
for (String path : untracked)
printPorcelainLine('?', '?', path);
@@ -221,7 +221,7 @@ class Status extends TextBuiltin {
Collection<String> untracked = status.getUntracked();
Map<String, StageState> unmergedStates = status
.getConflictingStageState();
- Collection<String> toBeCommitted = new ArrayList<String>(added);
+ Collection<String> toBeCommitted = new ArrayList<>(added);
toBeCommitted.addAll(changed);
toBeCommitted.addAll(removed);
int nbToBeCommitted = toBeCommitted.size();
@@ -232,7 +232,7 @@ class Status extends TextBuiltin {
toBeCommitted, added, changed, removed);
firstHeader = false;
}
- Collection<String> notStagedForCommit = new ArrayList<String>(modified);
+ Collection<String> notStagedForCommit = new ArrayList<>(modified);
notStagedForCommit.addAll(missing);
int nbNotStagedForCommit = notStagedForCommit.size();
if (nbNotStagedForCommit > 0) {
@@ -274,7 +274,7 @@ class Status extends TextBuiltin {
protected int printList(Collection<String> list) throws IOException {
if (!list.isEmpty()) {
- List<String> sortedList = new ArrayList<String>(list);
+ List<String> sortedList = new ArrayList<>(list);
java.util.Collections.sort(sortedList);
for (String filename : sortedList) {
outw.println(CLIText.formatLine(String.format(
@@ -291,7 +291,7 @@ class Status extends TextBuiltin {
Collection<String> set2,
@SuppressWarnings("unused") Collection<String> set3)
throws IOException {
- List<String> sortedList = new ArrayList<String>(list);
+ List<String> sortedList = new ArrayList<>(list);
java.util.Collections.sort(sortedList);
for (String filename : sortedList) {
String prefix;
@@ -311,7 +311,7 @@ class Status extends TextBuiltin {
private void printUnmerged(Map<String, StageState> unmergedStates)
throws IOException {
- List<String> paths = new ArrayList<String>(unmergedStates.keySet());
+ List<String> paths = new ArrayList<>(unmergedStates.keySet());
Collections.sort(paths);
for (String path : paths) {
StageState state = unmergedStates.get(path);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
index f8dd461877..44ec3f413c 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
@@ -115,13 +115,13 @@ class DiffAlgorithms extends TextBuiltin {
//
@Option(name = "--algorithm", multiValued = true, metaVar = "NAME", usage = "Enable algorithm(s)")
- List<String> algorithms = new ArrayList<String>();
+ List<String> algorithms = new ArrayList<>();
@Option(name = "--text-limit", metaVar = "LIMIT", usage = "Maximum size in KiB to scan per file revision")
int textLimit = 15 * 1024; // 15 MiB as later we do * 1024.
@Option(name = "--repository", aliases = { "-r" }, multiValued = true, metaVar = "GIT_DIR", usage = "Repository to scan")
- List<File> gitDirs = new ArrayList<File>();
+ List<File> gitDirs = new ArrayList<>();
@Option(name = "--count", metaVar = "LIMIT", usage = "Number of file revisions to be compared")
int count = 0; // unlimited
@@ -324,7 +324,7 @@ class DiffAlgorithms extends TextBuiltin {
}
private List<Test> init() {
- List<Test> all = new ArrayList<Test>();
+ List<Test> all = new ArrayList<>();
try {
for (Field f : DiffAlgorithms.class.getDeclaredFields()) {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
index 8cfcba9113..da602d0b89 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
@@ -112,7 +112,7 @@ class RebuildCommitGraph extends TextBuiltin {
private final ProgressMonitor pm = new TextProgressMonitor(errw);
- private Map<ObjectId, ObjectId> rewrites = new HashMap<ObjectId, ObjectId>();
+ private Map<ObjectId, ObjectId> rewrites = new HashMap<>();
@Override
protected void run() throws Exception {
@@ -137,8 +137,8 @@ class RebuildCommitGraph extends TextBuiltin {
}
private void recreateCommitGraph() throws IOException {
- final Map<ObjectId, ToRewrite> toRewrite = new HashMap<ObjectId, ToRewrite>();
- List<ToRewrite> queue = new ArrayList<ToRewrite>();
+ final Map<ObjectId, ToRewrite> toRewrite = new HashMap<>();
+ List<ToRewrite> queue = new ArrayList<>();
try (RevWalk rw = new RevWalk(db);
final BufferedReader br = new BufferedReader(
new InputStreamReader(new FileInputStream(graph),
@@ -176,7 +176,7 @@ class RebuildCommitGraph extends TextBuiltin {
while (!queue.isEmpty()) {
final ListIterator<ToRewrite> itr = queue
.listIterator(queue.size());
- queue = new ArrayList<ToRewrite>();
+ queue = new ArrayList<>();
REWRITE: while (itr.hasPrevious()) {
final ToRewrite t = itr.previous();
final ObjectId[] newParents = new ObjectId[t.oldParents.length];
@@ -278,7 +278,7 @@ class RebuildCommitGraph extends TextBuiltin {
}
private Map<String, Ref> computeNewRefs() throws IOException {
- final Map<String, Ref> refs = new HashMap<String, Ref>();
+ final Map<String, Ref> refs = new HashMap<>();
try (RevWalk rw = new RevWalk(db);
BufferedReader br = new BufferedReader(
new InputStreamReader(new FileInputStream(refList),
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
index 28d92aeca1..0eb4e05c55 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
@@ -251,16 +251,16 @@ class TextHashFunctions extends TextBuiltin {
//
@Option(name = "--hash", multiValued = true, metaVar = "NAME", usage = "Enable hash function(s)")
- List<String> hashFunctions = new ArrayList<String>();
+ List<String> hashFunctions = new ArrayList<>();
@Option(name = "--fold", multiValued = true, metaVar = "NAME", usage = "Enable fold function(s)")
- List<String> foldFunctions = new ArrayList<String>();
+ List<String> foldFunctions = new ArrayList<>();
@Option(name = "--text-limit", metaVar = "LIMIT", usage = "Maximum size in KiB to scan")
int textLimit = 15 * 1024; // 15 MiB as later we do * 1024.
@Option(name = "--repository", aliases = { "-r" }, multiValued = true, metaVar = "GIT_DIR", usage = "Repository to scan")
- List<File> gitDirs = new ArrayList<File>();
+ List<File> gitDirs = new ArrayList<>();
@Override
protected boolean requiresRepository() {
@@ -327,7 +327,7 @@ class TextHashFunctions extends TextBuiltin {
RawText txt = new RawText(raw);
int[] lines = new int[txt.size()];
int cnt = 0;
- HashSet<Line> u = new HashSet<Line>();
+ HashSet<Line> u = new HashSet<>();
for (int i = 0; i < txt.size(); i++) {
if (u.add(new Line(txt, i)))
lines[cnt++] = i;
@@ -386,8 +386,8 @@ class TextHashFunctions extends TextBuiltin {
}
private List<Function> init() {
- List<Hash> hashes = new ArrayList<Hash>();
- List<Fold> folds = new ArrayList<Fold>();
+ List<Hash> hashes = new ArrayList<>();
+ List<Fold> folds = new ArrayList<>();
try {
for (Field f : TextHashFunctions.class.getDeclaredFields()) {
@@ -410,7 +410,7 @@ class TextHashFunctions extends TextBuiltin {
throw new RuntimeException("Cannot determine names", e); //$NON-NLS-1$
}
- List<Function> all = new ArrayList<Function>();
+ List<Function> all = new ArrayList<>();
for (Hash cmp : hashes) {
if (include(cmp.name, hashFunctions)) {
for (Fold f : folds) {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
index b531ba65a4..020b62580f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
@@ -141,7 +141,7 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser {
@Override
public void parseArgument(final String... args) throws CmdLineException {
- final ArrayList<String> tmp = new ArrayList<String>(args.length);
+ final ArrayList<String> tmp = new ArrayList<>(args.length);
for (int argi = 0; argi < args.length; argi++) {
final String str = args[argi];
if (str.equals("--")) { //$NON-NLS-1$
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java
index e468023448..b873c3dc2c 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/PathTreeFilterHandler.java
@@ -81,7 +81,7 @@ public class PathTreeFilterHandler extends OptionHandler<TreeFilter> {
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
- final List<PathFilter> filters = new ArrayList<PathFilter>();
+ final List<PathFilter> filters = new ArrayList<>();
for (int idx = 0;; idx++) {
final String path;
try {
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();
}
diff --git a/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs
index 2db1c4f21b..ede0f7d55d 100644
--- a/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit.ui/.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.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java
index 7359093a12..fe0c486ae6 100644
--- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java
+++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/SwingCommitList.java
@@ -53,7 +53,7 @@ class SwingCommitList extends PlotCommitList<SwingCommitList.SwingLane> {
final LinkedList<Color> colors;
SwingCommitList() {
- colors = new LinkedList<Color>();
+ colors = new LinkedList<>();
repackColors();
}
diff --git a/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs
index 763144c86b..06ddbabb48 100644
--- a/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.jgit/.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/src/org/eclipse/jgit/api/AddCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java
index 0ef47a4152..1ed79449ef 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java
@@ -96,7 +96,7 @@ public class AddCommand extends GitCommand<DirCache> {
*/
public AddCommand(Repository repo) {
super(repo);
- filepatterns = new LinkedList<String>();
+ filepatterns = new LinkedList<>();
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
index 45311f7f9f..ba5673d977 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
@@ -198,10 +198,10 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
private void apply(File f, FileHeader fh)
throws IOException, PatchApplyException {
RawText rt = new RawText(f);
- List<String> oldLines = new ArrayList<String>(rt.size());
+ List<String> oldLines = new ArrayList<>(rt.size());
for (int i = 0; i < rt.size(); i++)
oldLines.add(rt.getString(i));
- List<String> newLines = new ArrayList<String>(oldLines);
+ List<String> newLines = new ArrayList<>(oldLines);
for (HunkHeader hh : fh.getHunks()) {
byte[] b = new byte[hh.getEndOffset() - hh.getStartOffset()];
@@ -209,7 +209,7 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
b.length);
RawText hrt = new RawText(b);
- List<String> hunkLines = new ArrayList<String>(hrt.size());
+ List<String> hunkLines = new ArrayList<>(hrt.size());
for (int i = 0; i < hrt.size(); i++)
hunkLines.add(hrt.getString(i));
int pos = 0;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyResult.java
index 558ef0f8a8..2ef6650e91 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyResult.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyResult.java
@@ -53,7 +53,7 @@ import java.util.List;
*/
public class ApplyResult {
- private List<File> updatedFiles = new ArrayList<File>();
+ private List<File> updatedFiles = new ArrayList<>();
/**
* @param f
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java
index 6c7dca5c2e..0d18eb3d07 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java
@@ -259,7 +259,7 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
* the --format= option)
*/
private static final ConcurrentMap<String, FormatEntry> formats =
- new ConcurrentHashMap<String, FormatEntry>();
+ new ConcurrentHashMap<>();
/**
* Replaces the entry for a key only if currently mapped to a given
@@ -377,7 +377,7 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
private String prefix;
private String format;
private Map<String, Object> formatOptions = new HashMap<>();
- private List<String> paths = new ArrayList<String>();
+ private List<String> paths = new ArrayList<>();
/** Filename suffix, for automatically choosing a format. */
private String suffix;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java
index ce73d0e6b8..b1c81ff154 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java
@@ -188,7 +188,7 @@ public class BlameCommand extends GitCommand<BlameResult> {
public BlameCommand reverse(AnyObjectId start, Collection<ObjectId> end)
throws IOException {
startCommit = start.toObjectId();
- reverseEndCommits = new ArrayList<ObjectId>(end);
+ reverseEndCommits = new ArrayList<>(end);
return this;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
index bb94e5494f..21d62837e9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
@@ -180,7 +180,7 @@ public class CheckoutCommand extends GitCommand<Ref> {
*/
protected CheckoutCommand(Repository repo) {
super(repo);
- this.paths = new LinkedList<String>();
+ this.paths = new LinkedList<>();
}
/**
@@ -320,10 +320,10 @@ public class CheckoutCommand extends GitCommand<Ref> {
if (!dco.getToBeDeleted().isEmpty()) {
status = new CheckoutResult(Status.NONDELETED,
dco.getToBeDeleted(),
- new ArrayList<String>(dco.getUpdated().keySet()),
+ new ArrayList<>(dco.getUpdated().keySet()),
dco.getRemoved());
} else
- status = new CheckoutResult(new ArrayList<String>(dco
+ status = new CheckoutResult(new ArrayList<>(dco
.getUpdated().keySet()), dco.getRemoved());
return ref;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java
index 92a67f46af..2186eb4b5a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java
@@ -139,11 +139,11 @@ public class CheckoutResult {
if (status == Status.CONFLICTS)
this.conflictList = fileList;
else
- this.conflictList = new ArrayList<String>(0);
+ this.conflictList = new ArrayList<>(0);
if (status == Status.NONDELETED)
this.undeletedList = fileList;
else
- this.undeletedList = new ArrayList<String>(0);
+ this.undeletedList = new ArrayList<>(0);
this.modifiedList = modified;
this.removedList = removed;
@@ -160,8 +160,8 @@ public class CheckoutResult {
CheckoutResult(List<String> modified, List<String> removed) {
myStatus = Status.OK;
- this.conflictList = new ArrayList<String>(0);
- this.undeletedList = new ArrayList<String>(0);
+ this.conflictList = new ArrayList<>(0);
+ this.undeletedList = new ArrayList<>(0);
this.modifiedList = modified;
this.removedList = removed;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java
index d3af7a6193..eed7b2a254 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java
@@ -85,7 +85,7 @@ import org.eclipse.jgit.treewalk.FileTreeIterator;
public class CherryPickCommand extends GitCommand<CherryPickResult> {
private String reflogPrefix = "cherry-pick:"; //$NON-NLS-1$
- private List<Ref> commits = new LinkedList<Ref>();
+ private List<Ref> commits = new LinkedList<>();
private String ourCommitName = null;
@@ -121,7 +121,7 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {
UnmergedPathsException, ConcurrentRefUpdateException,
WrongRepositoryStateException, NoHeadException {
RevCommit newHead = null;
- List<Ref> cherryPickedRefs = new LinkedList<Ref>();
+ List<Ref> cherryPickedRefs = new LinkedList<>();
checkCallable();
try (RevWalk revWalk = new RevWalk(repo)) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java
index 153513aa08..c58efb1478 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java
@@ -96,14 +96,14 @@ public class CleanCommand extends GitCommand<Set<String>> {
*/
@Override
public Set<String> call() throws NoWorkTreeException, GitAPIException {
- Set<String> files = new TreeSet<String>();
+ Set<String> files = new TreeSet<>();
try {
StatusCommand command = new StatusCommand(repo);
Status status = command.call();
- Set<String> untrackedAndIgnoredFiles = new TreeSet<String>(
+ Set<String> untrackedAndIgnoredFiles = new TreeSet<>(
status.getUntracked());
- Set<String> untrackedAndIgnoredDirs = new TreeSet<String>(
+ Set<String> untrackedAndIgnoredDirs = new TreeSet<>(
status.getUntrackedFolders());
FS fs = getRepository().getFS();
@@ -192,7 +192,7 @@ public class CleanCommand extends GitCommand<Set<String>> {
private Set<String> filterIgnorePaths(Set<String> inputPaths,
Set<String> ignoredNotInIndex, boolean exact) {
if (ignore) {
- Set<String> filtered = new TreeSet<String>(inputPaths);
+ Set<String> filtered = new TreeSet<>(inputPaths);
for (String path : inputPaths)
for (String ignored : ignoredNotInIndex)
if ((exact && path.equals(ignored))
@@ -208,7 +208,7 @@ public class CleanCommand extends GitCommand<Set<String>> {
private Set<String> filterFolders(Set<String> untracked,
Set<String> untrackedFolders) {
- Set<String> filtered = new TreeSet<String>(untracked);
+ Set<String> filtered = new TreeSet<>(untracked);
for (String file : untracked)
for (String folder : untrackedFolders)
if (file.startsWith(folder)) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
index baa6d7fce9..4b815b439d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
@@ -220,7 +220,7 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
RefSpec wcrs = new RefSpec();
wcrs = wcrs.setForceUpdate(true);
wcrs = wcrs.setSourceDestination(Constants.R_HEADS + "*", dst); //$NON-NLS-1$
- List<RefSpec> specs = new ArrayList<RefSpec>();
+ List<RefSpec> specs = new ArrayList<>();
if (cloneAllBranches)
specs.add(wcrs);
else if (branchesToClone != null
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
index f3bc91aeda..274ece6dca 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
@@ -112,7 +112,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
private boolean all;
- private List<String> only = new ArrayList<String>();
+ private List<String> only = new ArrayList<>();
private boolean[] onlyProcessed;
@@ -124,7 +124,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
* parents this commit should have. The current HEAD will be in this list
* and also all commits mentioned in .git/MERGE_HEAD
*/
- private List<ObjectId> parents = new LinkedList<ObjectId>();
+ private List<ObjectId> parents = new LinkedList<>();
private String reflogComment;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java
index dcfad6a44c..d7e7e5c294 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java
@@ -79,7 +79,7 @@ import org.eclipse.jgit.revwalk.RevWalk;
* >Git documentation about Branch</a>
*/
public class DeleteBranchCommand extends GitCommand<List<String>> {
- private final Set<String> branchNames = new HashSet<String>();
+ private final Set<String> branchNames = new HashSet<>();
private boolean force;
@@ -101,7 +101,7 @@ public class DeleteBranchCommand extends GitCommand<List<String>> {
public List<String> call() throws GitAPIException,
NotMergedException, CannotDeleteCurrentBranchException {
checkCallable();
- List<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<>();
if (branchNames.isEmpty())
return result;
try {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java
index 0d312dd402..77e3539996 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java
@@ -68,7 +68,7 @@ import org.eclipse.jgit.lib.Repository;
*/
public class DeleteTagCommand extends GitCommand<List<String>> {
- private final Set<String> tags = new HashSet<String>();
+ private final Set<String> tags = new HashSet<>();
/**
* @param repo
@@ -83,7 +83,7 @@ public class DeleteTagCommand extends GitCommand<List<String>> {
@Override
public List<String> call() throws GitAPIException {
checkCallable();
- List<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<>();
if (tags.isEmpty())
return result;
try {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java
index a119fcc848..389c511e1c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java
@@ -189,7 +189,7 @@ public class DescribeCommand extends GitCommand<String> {
if (target == null)
setTarget(Constants.HEAD);
- Map<ObjectId, Ref> tags = new HashMap<ObjectId, Ref>();
+ Map<ObjectId, Ref> tags = new HashMap<>();
for (Ref r : repo.getRefDatabase().getRefs(R_TAGS).values()) {
ObjectId key = repo.peel(r).getPeeledObjectId();
@@ -240,7 +240,7 @@ public class DescribeCommand extends GitCommand<String> {
}
}
- List<Candidate> candidates = new ArrayList<Candidate>(); // all the candidates we find
+ List<Candidate> candidates = new ArrayList<>(); // all the candidates we find
// is the target already pointing to a tag? if so, we are done!
Ref lucky = tags.get(target);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
index 1f4dcdd3e6..a9dca4d7bc 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
@@ -96,7 +96,7 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
*/
protected FetchCommand(Repository repo) {
super(repo);
- refSpecs = new ArrayList<RefSpec>(3);
+ refSpecs = new ArrayList<>(3);
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java
index 438ec89ff0..961eeaadd4 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java
@@ -106,7 +106,7 @@ public class ListBranchCommand extends GitCommand<List<Ref>> {
checkCallable();
List<Ref> resultRefs;
try {
- Collection<Ref> refs = new ArrayList<Ref>();
+ Collection<Ref> refs = new ArrayList<>();
// Also return HEAD if it's detached
Ref head = repo.exactRef(Constants.HEAD);
@@ -121,7 +121,7 @@ public class ListBranchCommand extends GitCommand<List<Ref>> {
refs.addAll(getRefs(Constants.R_HEADS));
refs.addAll(getRefs(Constants.R_REMOTES));
}
- resultRefs = new ArrayList<Ref>(filterRefs(refs));
+ resultRefs = new ArrayList<>(filterRefs(refs));
} catch (IOException e) {
throw new JGitInternalException(e.getMessage(), e);
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java
index cdb32ca2f2..476c10bdbc 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java
@@ -80,7 +80,7 @@ public class ListNotesCommand extends GitCommand<List<Note>> {
@Override
public List<Note> call() throws GitAPIException {
checkCallable();
- List<Note> notes = new ArrayList<Note>();
+ List<Note> notes = new ArrayList<>();
NoteMap map = NoteMap.newEmptyMap();
try (RevWalk walk = new RevWalk(repo)) {
Ref ref = repo.findRef(notesRef);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java
index 6d46cdf9a8..d649a53db1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java
@@ -78,7 +78,7 @@ public class ListTagCommand extends GitCommand<List<Ref>> {
public List<Ref> call() throws GitAPIException {
checkCallable();
Map<String, Ref> refList;
- List<Ref> tags = new ArrayList<Ref>();
+ List<Ref> tags = new ArrayList<>();
try (RevWalk revWalk = new RevWalk(repo)) {
refList = repo.getRefDatabase().getRefs(Constants.R_TAGS);
for (Ref ref : refList.values()) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java
index 47b2599812..f8fe95a88a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java
@@ -107,7 +107,7 @@ public class LogCommand extends GitCommand<Iterable<RevCommit>> {
private RevFilter revFilter;
- private final List<PathFilter> pathFilters = new ArrayList<PathFilter>();
+ private final List<PathFilter> pathFilters = new ArrayList<>();
private int maxCount = -1;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
index 9ad71250e8..5157a411fd 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
@@ -188,14 +188,14 @@ public class LsRemoteCommand extends
: Transport.open(new URIish(remote))) {
transport.setOptionUploadPack(uploadPack);
configure(transport);
- Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1);
+ Collection<RefSpec> refSpecs = new ArrayList<>(1);
if (tags)
refSpecs.add(new RefSpec(
"refs/tags/*:refs/remotes/origin/tags/*")); //$NON-NLS-1$
if (heads)
refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*")); //$NON-NLS-1$
Collection<Ref> refs;
- Map<String, Ref> refmap = new HashMap<String, Ref>();
+ Map<String, Ref> refmap = new HashMap<>();
try (FetchConnection fc = transport.openFetch()) {
refs = fc.getRefs();
if (refSpecs.isEmpty())
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
index de7b604cf2..b5d9e8a6b6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
@@ -102,7 +102,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
private MergeStrategy mergeStrategy = MergeStrategy.RECURSIVE;
- private List<Ref> commits = new LinkedList<Ref>();
+ private List<Ref> commits = new LinkedList<>();
private Boolean squash;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java
index aa8075d163..c487ef6509 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java
@@ -416,7 +416,7 @@ public class MergeResult {
*/
public void addConflict(String path, int[][] conflictingRanges) {
if (conflicts == null)
- conflicts = new HashMap<String, int[][]>();
+ conflicts = new HashMap<>();
conflicts.put(path, conflictingRanges);
}
@@ -428,7 +428,7 @@ public class MergeResult {
if (!lowLevelResult.containsConflicts())
return;
if (conflicts == null)
- conflicts = new HashMap<String, int[][]>();
+ conflicts = new HashMap<>();
int nrOfConflicts = 0;
// just counting
for (MergeChunk mergeChunk : lowLevelResult) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java
index fd28d0ec43..2a86fabede 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java
@@ -124,8 +124,8 @@ public class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
protected NameRevCommand(Repository repo) {
super(repo);
mergeCost = MERGE_COST;
- prefixes = new ArrayList<String>(2);
- revs = new ArrayList<ObjectId>(2);
+ prefixes = new ArrayList<>(2);
+ revs = new ArrayList<>(2);
walk = new RevWalk(repo) {
@Override
public NameRevCommit createCommit(AnyObjectId id) {
@@ -137,7 +137,7 @@ public class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
@Override
public Map<ObjectId, String> call() throws GitAPIException {
try {
- Map<ObjectId, String> nonCommits = new HashMap<ObjectId, String>();
+ Map<ObjectId, String> nonCommits = new HashMap<>();
FIFORevQueue pending = new FIFORevQueue();
if (refs != null) {
for (Ref ref : refs)
@@ -170,7 +170,7 @@ public class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
}
Map<ObjectId, String> result =
- new LinkedHashMap<ObjectId, String>(revs.size());
+ new LinkedHashMap<>(revs.size());
for (ObjectId id : revs) {
RevObject o = walk.parseAny(id);
if (o instanceof NameRevCommit) {
@@ -275,7 +275,7 @@ public class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
public NameRevCommand addAnnotatedTags() {
checkCallable();
if (refs == null)
- refs = new ArrayList<Ref>();
+ refs = new ArrayList<>();
try {
for (Ref ref : repo.getRefDatabase().getRefs(Constants.R_TAGS).values()) {
ObjectId id = ref.getObjectId();
@@ -302,7 +302,7 @@ public class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
public NameRevCommand addRef(Ref ref) {
checkCallable();
if (refs == null)
- refs = new ArrayList<Ref>();
+ refs = new ArrayList<>();
refs.add(ref);
return this;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java
index 01b57bde81..bf88842618 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java
@@ -109,7 +109,7 @@ public class PushCommand extends
*/
protected PushCommand(Repository repo) {
super(repo);
- refSpecs = new ArrayList<RefSpec>(3);
+ refSpecs = new ArrayList<>(3);
refLeaseSpecs = new HashMap<>();
}
@@ -132,7 +132,7 @@ public class PushCommand extends
org.eclipse.jgit.api.errors.TransportException {
checkCallable();
- ArrayList<PushResult> pushResults = new ArrayList<PushResult>(3);
+ ArrayList<PushResult> pushResults = new ArrayList<>(3);
try {
if (refSpecs.isEmpty()) {
@@ -283,7 +283,7 @@ public class PushCommand extends
* @since 4.7
*/
public List<RefLeaseSpec> getRefLeaseSpecs() {
- return new ArrayList<RefLeaseSpec>(refLeaseSpecs.values());
+ return new ArrayList<>(refLeaseSpecs.values());
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
index 617c37d610..f704492fe5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
@@ -299,7 +299,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
org.eclipse.jgit.api.Status status = Git.wrap(repo)
.status().setIgnoreSubmodules(IgnoreSubmoduleMode.ALL).call();
if (status.hasUncommittedChanges()) {
- List<String> list = new ArrayList<String>();
+ List<String> list = new ArrayList<>();
list.addAll(status.getUncommittedChanges());
return RebaseResult.uncommittedChanges(list);
}
@@ -650,7 +650,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
// Get the rewritten equivalents for the parents of the given commit
private List<RevCommit> getNewParents(RevCommit commitToPick)
throws IOException {
- List<RevCommit> newParents = new ArrayList<RevCommit>();
+ List<RevCommit> newParents = new ArrayList<>();
for (int p = 0; p < commitToPick.getParentCount(); p++) {
String parentHash = commitToPick.getParent(p).getName();
if (!new File(rebaseState.getRewrittenDir(), parentHash).exists())
@@ -1056,8 +1056,8 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
private void popSteps(int numSteps) throws IOException {
if (numSteps == 0)
return;
- List<RebaseTodoLine> todoLines = new LinkedList<RebaseTodoLine>();
- List<RebaseTodoLine> poppedLines = new LinkedList<RebaseTodoLine>();
+ List<RebaseTodoLine> todoLines = new LinkedList<>();
+ List<RebaseTodoLine> poppedLines = new LinkedList<>();
for (RebaseTodoLine line : repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), true)) {
@@ -1122,7 +1122,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}
rebaseState.createFile(QUIET, ""); //$NON-NLS-1$
- ArrayList<RebaseTodoLine> toDoSteps = new ArrayList<RebaseTodoLine>();
+ ArrayList<RebaseTodoLine> toDoSteps = new ArrayList<>();
toDoSteps.add(new RebaseTodoLine("# Created by EGit: rebasing " + headId.name() //$NON-NLS-1$
+ " onto " + upstreamCommit.name())); //$NON-NLS-1$
// determine the commits to be applied
@@ -1158,7 +1158,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
LogCommand cmd = git.log().addRange(upstreamCommit, headCommit);
commitsToUse = cmd.call();
}
- List<RevCommit> cherryPickList = new ArrayList<RevCommit>();
+ List<RevCommit> cherryPickList = new ArrayList<>();
for (RevCommit commit : commitsToUse) {
if (preserveMerges || commit.getParentCount() == 1)
cherryPickList.add(commit);
@@ -1605,7 +1605,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
if (raw.length == 0)
return null;
- Map<String, String> keyValueMap = new HashMap<String, String>();
+ Map<String, String> keyValueMap = new HashMap<>();
for (int p = 0; p < raw.length;) {
int end = RawParseUtils.nextLF(raw, p);
if (end == p)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
index 412219cead..c5222c2d5f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
@@ -121,7 +121,7 @@ public class ResetCommand extends GitCommand<Ref> {
private ResetType mode;
- private Collection<String> filepaths = new LinkedList<String>();
+ private Collection<String> filepaths = new LinkedList<>();
private boolean isReflogDisabled;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
index 20683d5c0f..c3152a93b4 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
@@ -85,11 +85,11 @@ import org.eclipse.jgit.treewalk.FileTreeIterator;
* >Git documentation about revert</a>
*/
public class RevertCommand extends GitCommand<RevCommit> {
- private List<Ref> commits = new LinkedList<Ref>();
+ private List<Ref> commits = new LinkedList<>();
private String ourCommitName = null;
- private List<Ref> revertedRefs = new LinkedList<Ref>();
+ private List<Ref> revertedRefs = new LinkedList<>();
private MergeResult failingResult;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java
index 069a9cfacc..9e2cf31100 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java
@@ -99,7 +99,7 @@ public class RmCommand extends GitCommand<DirCache> {
*/
public RmCommand(Repository repo) {
super(repo);
- filepatterns = new LinkedList<String>();
+ filepatterns = new LinkedList<>();
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java
index 2cbfead8c8..681f8e65ae 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java
@@ -262,9 +262,9 @@ public class StashCreateCommand extends GitCommand<RevCommit> {
return null;
MutableObjectId id = new MutableObjectId();
- List<PathEdit> wtEdits = new ArrayList<PathEdit>();
- List<String> wtDeletes = new ArrayList<String>();
- List<DirCacheEntry> untracked = new ArrayList<DirCacheEntry>();
+ List<PathEdit> wtEdits = new ArrayList<>();
+ List<String> wtDeletes = new ArrayList<>();
+ List<DirCacheEntry> untracked = new ArrayList<>();
boolean hasChanges = false;
do {
AbstractTreeIterator headIter = treeWalk.getTree(0,
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java
index a2946f9c1f..8420dd228e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java
@@ -95,7 +95,7 @@ public class StashListCommand extends GitCommand<Collection<RevCommit>> {
if (stashEntries.isEmpty())
return Collections.emptyList();
- final List<RevCommit> stashCommits = new ArrayList<RevCommit>(
+ final List<RevCommit> stashCommits = new ArrayList<>(
stashEntries.size());
try (RevWalk walk = new RevWalk(repo)) {
for (ReflogEntry entry : stashEntries) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java
index 48759c2d49..5b7c73b472 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java
@@ -189,7 +189,7 @@ public class Status {
* @since 3.2
*/
public Set<String> getUncommittedChanges() {
- Set<String> uncommittedChanges = new HashSet<String>();
+ Set<String> uncommittedChanges = new HashSet<>();
uncommittedChanges.addAll(diff.getAdded());
uncommittedChanges.addAll(diff.getChanged());
uncommittedChanges.addAll(diff.getRemoved());
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java
index 1d5f54213e..8f7804a003 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java
@@ -109,7 +109,7 @@ public class StatusCommand extends GitCommand<Status> {
*/
public StatusCommand addPath(String path) {
if (paths == null)
- paths = new LinkedList<String>();
+ paths = new LinkedList<>();
paths.add(path);
return this;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java
index 8f91b67925..4c5e317cb1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java
@@ -76,7 +76,7 @@ public class SubmoduleInitCommand extends GitCommand<Collection<String>> {
*/
public SubmoduleInitCommand(final Repository repo) {
super(repo);
- paths = new ArrayList<String>();
+ paths = new ArrayList<>();
}
/**
@@ -99,7 +99,7 @@ public class SubmoduleInitCommand extends GitCommand<Collection<String>> {
if (!paths.isEmpty())
generator.setFilter(PathFilterGroup.createFromStrings(paths));
StoredConfig config = repo.getConfig();
- List<String> initialized = new ArrayList<String>();
+ List<String> initialized = new ArrayList<>();
while (generator.next()) {
// Ignore entry if URL is already present in config file
if (generator.getConfigUrl() != null)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java
index 29d4b73756..8b27e4c41f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java
@@ -76,7 +76,7 @@ public class SubmoduleStatusCommand extends
*/
public SubmoduleStatusCommand(final Repository repo) {
super(repo);
- paths = new ArrayList<String>();
+ paths = new ArrayList<>();
}
/**
@@ -98,7 +98,7 @@ public class SubmoduleStatusCommand extends
try (SubmoduleWalk generator = SubmoduleWalk.forIndex(repo)) {
if (!paths.isEmpty())
generator.setFilter(PathFilterGroup.createFromStrings(paths));
- Map<String, SubmoduleStatus> statuses = new HashMap<String, SubmoduleStatus>();
+ Map<String, SubmoduleStatus> statuses = new HashMap<>();
while (generator.next()) {
SubmoduleStatus status = getStatus(generator);
statuses.put(status.getPath(), status);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java
index 8dc9ff9ab3..f97dce9833 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java
@@ -78,7 +78,7 @@ public class SubmoduleSyncCommand extends GitCommand<Map<String, String>> {
*/
public SubmoduleSyncCommand(final Repository repo) {
super(repo);
- paths = new ArrayList<String>();
+ paths = new ArrayList<>();
}
/**
@@ -115,7 +115,7 @@ public class SubmoduleSyncCommand extends GitCommand<Map<String, String>> {
try (SubmoduleWalk generator = SubmoduleWalk.forIndex(repo)) {
if (!paths.isEmpty())
generator.setFilter(PathFilterGroup.createFromStrings(paths));
- Map<String, String> synced = new HashMap<String, String>();
+ Map<String, String> synced = new HashMap<>();
StoredConfig config = repo.getConfig();
while (generator.next()) {
String remoteUrl = generator.getRemoteUrl();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java
index bd2fb8668e..29d5d49a45 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java
@@ -94,7 +94,7 @@ public class SubmoduleUpdateCommand extends
*/
public SubmoduleUpdateCommand(final Repository repo) {
super(repo);
- paths = new ArrayList<String>();
+ paths = new ArrayList<>();
}
/**
@@ -148,7 +148,7 @@ public class SubmoduleUpdateCommand extends
try (SubmoduleWalk generator = SubmoduleWalk.forIndex(repo)) {
if (!paths.isEmpty())
generator.setFilter(PathFilterGroup.createFromStrings(paths));
- List<String> updated = new ArrayList<String>();
+ List<String> updated = new ArrayList<>();
while (generator.next()) {
// Skip submodules not registered in .gitmodules file
if (generator.getModulesPath() == null)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java
index e317507139..7df35c925c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java
@@ -95,7 +95,7 @@ public class CheckoutConflictException extends GitAPIException {
*/
CheckoutConflictException addConflictingPath(String conflictingPath) {
if (conflictingPaths == null)
- conflictingPaths = new LinkedList<String>();
+ conflictingPaths = new LinkedList<>();
conflictingPaths.add(conflictingPath);
return this;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNode.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNode.java
index 7196502112..13aeaee7dc 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNode.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNode.java
@@ -65,7 +65,7 @@ public class AttributesNode {
/** Create an empty ignore node with no rules. */
public AttributesNode() {
- rules = new ArrayList<AttributesRule>();
+ rules = new ArrayList<>();
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesRule.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesRule.java
index 0532250f9c..c9c69db868 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesRule.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesRule.java
@@ -71,7 +71,7 @@ public class AttributesRule {
private static List<Attribute> parseAttributes(String attributesLine) {
// the C implementation oddly enough allows \r between attributes too.
- ArrayList<Attribute> result = new ArrayList<Attribute>();
+ ArrayList<Attribute> result = new ArrayList<>();
for (String attribute : attributesLine.split(ATTRIBUTES_SPLIT_REGEX)) {
attribute = attribute.trim();
if (attribute.length() == 0)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java
index 39421c6dee..bd6e5c859a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java
@@ -117,7 +117,7 @@ public abstract class DiffAlgorithm {
if (region.getLengthA() == 1 && region.getLengthB() == 1)
return EditList.singleton(region);
- SubsequenceComparator<S> cs = new SubsequenceComparator<S>(cmp);
+ SubsequenceComparator<S> cs = new SubsequenceComparator<>(cmp);
Subsequence<S> as = Subsequence.a(a, region);
Subsequence<S> bs = Subsequence.b(b, region);
EditList e = Subsequence.toBase(diffNonCommon(cs, as, bs), as, bs);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java
index 24409ee592..e1dfcff6bb 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java
@@ -179,7 +179,7 @@ public class DiffEntry {
else
treeFilterMarker = null;
- List<DiffEntry> r = new ArrayList<DiffEntry>();
+ List<DiffEntry> r = new ArrayList<>();
MutableObjectId idBuf = new MutableObjectId();
while (walk.next()) {
DiffEntry entry = new DiffEntry();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HashedSequencePair.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HashedSequencePair.java
index 74bbca1708..bf6d967c50 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HashedSequencePair.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HashedSequencePair.java
@@ -81,7 +81,7 @@ public class HashedSequencePair<S extends Sequence> {
/** @return obtain a comparator that uses the cached hash codes. */
public HashedSequenceComparator<S> getComparator() {
- return new HashedSequenceComparator<S>(cmp);
+ return new HashedSequenceComparator<>(cmp);
}
/** @return wrapper around A that includes cached hash codes. */
@@ -103,6 +103,6 @@ public class HashedSequencePair<S extends Sequence> {
final int[] hashes = new int[end];
for (int ptr = 0; ptr < end; ptr++)
hashes[ptr] = cmp.hash(base, ptr);
- return new HashedSequence<S>(base, hashes);
+ return new HashedSequence<>(base, hashes);
}
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java
index 80ac1b662e..4ef58455a7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java
@@ -134,14 +134,14 @@ public class HistogramDiff extends LowLevelDiffAlgorithm {
public <S extends Sequence> void diffNonCommon(EditList edits,
HashedSequenceComparator<S> cmp, HashedSequence<S> a,
HashedSequence<S> b, Edit region) {
- new State<S>(edits, cmp, a, b).diffRegion(region);
+ new State<>(edits, cmp, a, b).diffRegion(region);
}
private class State<S extends Sequence> {
private final HashedSequenceComparator<S> cmp;
private final HashedSequence<S> a;
private final HashedSequence<S> b;
- private final List<Edit> queue = new ArrayList<Edit>();
+ private final List<Edit> queue = new ArrayList<>();
/** Result edits we have determined that must be made to convert a to b. */
final EditList edits;
@@ -161,7 +161,7 @@ public class HistogramDiff extends LowLevelDiffAlgorithm {
}
private void diffReplace(Edit r) {
- Edit lcs = new HistogramDiffIndex<S>(maxChainLength, cmp, a, b, r)
+ Edit lcs = new HistogramDiffIndex<>(maxChainLength, cmp, a, b, r)
.findLongestCommonSequence();
if (lcs != null) {
// If we were given an edit, we can prove a result here.
@@ -214,7 +214,7 @@ public class HistogramDiff extends LowLevelDiffAlgorithm {
}
private SubsequenceComparator<HashedSequence<S>> subcmp() {
- return new SubsequenceComparator<HashedSequence<S>>(cmp);
+ return new SubsequenceComparator<>(cmp);
}
}
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/LowLevelDiffAlgorithm.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/LowLevelDiffAlgorithm.java
index e3861cd65e..55ceec8012 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/LowLevelDiffAlgorithm.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/LowLevelDiffAlgorithm.java
@@ -48,7 +48,7 @@ public abstract class LowLevelDiffAlgorithm extends DiffAlgorithm {
@Override
public <S extends Sequence> EditList diffNonCommon(
SequenceComparator<? super S> cmp, S a, S b) {
- HashedSequencePair<S> p = new HashedSequencePair<S>(cmp, a, b);
+ HashedSequencePair<S> p = new HashedSequencePair<>(cmp, a, b);
HashedSequenceComparator<S> hc = p.getComparator();
HashedSequence<S> ha = p.getA();
HashedSequence<S> hb = p.getB();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java
index 0e83990025..bc52473d93 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java
@@ -393,15 +393,15 @@ public class RenameDetector {
/** Reset this rename detector for another rename detection pass. */
public void reset() {
- entries = new ArrayList<DiffEntry>();
- deleted = new ArrayList<DiffEntry>();
- added = new ArrayList<DiffEntry>();
+ entries = new ArrayList<>();
+ deleted = new ArrayList<>();
+ added = new ArrayList<>();
done = false;
}
private void breakModifies(ContentSource.Pair reader, ProgressMonitor pm)
throws IOException {
- ArrayList<DiffEntry> newEntries = new ArrayList<DiffEntry>(entries.size());
+ ArrayList<DiffEntry> newEntries = new ArrayList<>(entries.size());
pm.beginTask(JGitText.get().renamesBreakingModifies, entries.size());
@@ -428,8 +428,8 @@ public class RenameDetector {
}
private void rejoinModifies(ProgressMonitor pm) {
- HashMap<String, DiffEntry> nameMap = new HashMap<String, DiffEntry>();
- ArrayList<DiffEntry> newAdded = new ArrayList<DiffEntry>(added.size());
+ HashMap<String, DiffEntry> nameMap = new HashMap<>();
+ ArrayList<DiffEntry> newAdded = new ArrayList<>(added.size());
pm.beginTask(JGitText.get().renamesRejoiningModifies, added.size()
+ deleted.size());
@@ -456,7 +456,7 @@ public class RenameDetector {
}
added = newAdded;
- deleted = new ArrayList<DiffEntry>(nameMap.values());
+ deleted = new ArrayList<>(nameMap.values());
}
private int calculateModifyScore(ContentSource.Pair reader, DiffEntry d)
@@ -508,8 +508,8 @@ public class RenameDetector {
HashMap<AbbreviatedObjectId, Object> deletedMap = populateMap(deleted, pm);
HashMap<AbbreviatedObjectId, Object> addedMap = populateMap(added, pm);
- ArrayList<DiffEntry> uniqueAdds = new ArrayList<DiffEntry>(added.size());
- ArrayList<List<DiffEntry>> nonUniqueAdds = new ArrayList<List<DiffEntry>>();
+ ArrayList<DiffEntry> uniqueAdds = new ArrayList<>(added.size());
+ ArrayList<List<DiffEntry>> nonUniqueAdds = new ArrayList<>();
for (Object o : addedMap.values()) {
if (o instanceof DiffEntry)
@@ -518,7 +518,7 @@ public class RenameDetector {
nonUniqueAdds.add((List<DiffEntry>) o);
}
- ArrayList<DiffEntry> left = new ArrayList<DiffEntry>(added.size());
+ ArrayList<DiffEntry> left = new ArrayList<>(added.size());
for (DiffEntry a : uniqueAdds) {
Object del = deletedMap.get(a.newId);
@@ -627,7 +627,7 @@ public class RenameDetector {
}
added = left;
- deleted = new ArrayList<DiffEntry>(deletedMap.size());
+ deleted = new ArrayList<>(deletedMap.size());
for (Object o : deletedMap.values()) {
if (o instanceof DiffEntry) {
DiffEntry e = (DiffEntry) o;
@@ -677,11 +677,11 @@ public class RenameDetector {
@SuppressWarnings("unchecked")
private HashMap<AbbreviatedObjectId, Object> populateMap(
List<DiffEntry> diffEntries, ProgressMonitor pm) {
- HashMap<AbbreviatedObjectId, Object> map = new HashMap<AbbreviatedObjectId, Object>();
+ HashMap<AbbreviatedObjectId, Object> map = new HashMap<>();
for (DiffEntry de : diffEntries) {
Object old = map.put(id(de), de);
if (old instanceof DiffEntry) {
- ArrayList<DiffEntry> list = new ArrayList<DiffEntry>(2);
+ ArrayList<DiffEntry> list = new ArrayList<>(2);
list.add((DiffEntry) old);
list.add(de);
map.put(id(de), list);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java
index 6088d72f3b..653658be3c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java
@@ -136,7 +136,7 @@ class SimilarityRenameDetector {
2 * srcs.size() * dsts.size());
int mNext = buildMatrix(pm);
- out = new ArrayList<DiffEntry>(Math.min(mNext, dsts.size()));
+ out = new ArrayList<>(Math.min(mNext, dsts.size()));
// Match rename pairs on a first come, first serve basis until
// we have looked at everything that is above our minimum score.
@@ -192,7 +192,7 @@ class SimilarityRenameDetector {
}
private static List<DiffEntry> compactSrcList(List<DiffEntry> in) {
- ArrayList<DiffEntry> r = new ArrayList<DiffEntry>(in.size());
+ ArrayList<DiffEntry> r = new ArrayList<>(in.size());
for (DiffEntry e : in) {
if (e.changeType == ChangeType.DELETE)
r.add(e);
@@ -201,7 +201,7 @@ class SimilarityRenameDetector {
}
private static List<DiffEntry> compactDstList(List<DiffEntry> in) {
- ArrayList<DiffEntry> r = new ArrayList<DiffEntry>(in.size());
+ ArrayList<DiffEntry> r = new ArrayList<>(in.size());
for (DiffEntry e : in) {
if (e != null)
r.add(e);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/Subsequence.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/Subsequence.java
index 017fe69973..50ca613cca 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/Subsequence.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/Subsequence.java
@@ -66,7 +66,7 @@ public final class Subsequence<S extends Sequence> extends Sequence {
* @return subsequence of {@code base} as described by A in {@code region}.
*/
public static <S extends Sequence> Subsequence<S> a(S a, Edit region) {
- return new Subsequence<S>(a, region.beginA, region.endA);
+ return new Subsequence<>(a, region.beginA, region.endA);
}
/**
@@ -81,7 +81,7 @@ public final class Subsequence<S extends Sequence> extends Sequence {
* @return subsequence of {@code base} as described by B in {@code region}.
*/
public static <S extends Sequence> Subsequence<S> b(S b, Edit region) {
- return new Subsequence<S>(b, region.beginB, region.endB);
+ return new Subsequence<>(b, region.beginB, region.endB);
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
index 17ddd35e64..ce52fedcb3 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
@@ -993,7 +993,7 @@ public class DirCache {
* @throws IOException
*/
private void updateSmudgedEntries() throws IOException {
- List<String> paths = new ArrayList<String>(128);
+ List<String> paths = new ArrayList<>(128);
try (TreeWalk walk = new TreeWalk(repository)) {
walk.setOperationType(OperationType.CHECKIN_OP);
for (int i = 0; i < entryCnt; i++)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
index c3184437b4..84f0da9e88 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -127,11 +127,11 @@ public class DirCacheCheckout {
private Repository repo;
- private HashMap<String, CheckoutMetadata> updated = new HashMap<String, CheckoutMetadata>();
+ private HashMap<String, CheckoutMetadata> updated = new HashMap<>();
- private ArrayList<String> conflicts = new ArrayList<String>();
+ private ArrayList<String> conflicts = new ArrayList<>();
- private ArrayList<String> removed = new ArrayList<String>();
+ private ArrayList<String> removed = new ArrayList<>();
private ObjectId mergeCommitTree;
@@ -147,7 +147,7 @@ public class DirCacheCheckout {
private boolean failOnConflict = true;
- private ArrayList<String> toBeDeleted = new ArrayList<String>();
+ private ArrayList<String> toBeDeleted = new ArrayList<>();
private boolean emptyDirCache;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java
index 0cc2b7653f..22bedcf91b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java
@@ -96,7 +96,7 @@ public class DirCacheEditor extends BaseDirCacheEditor {
*/
protected DirCacheEditor(final DirCache dc, final int ecnt) {
super(dc, ecnt);
- edits = new ArrayList<PathEdit>();
+ edits = new ArrayList<>();
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java
index 55b64eeb90..3a7b2c66d1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java
@@ -75,7 +75,7 @@ public class CompoundException extends Exception {
*/
public CompoundException(final Collection<Throwable> why) {
super(format(why));
- causeList = Collections.unmodifiableList(new ArrayList<Throwable>(why));
+ causeList = Collections.unmodifiableList(new ArrayList<>(why));
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerList.java b/org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerList.java
index 6ac4b0f8ba..12ef533add 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerList.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerList.java
@@ -50,7 +50,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
/** Manages a thread-safe list of {@link RepositoryListener}s. */
public class ListenerList {
- private final ConcurrentMap<Class<? extends RepositoryListener>, CopyOnWriteArrayList<ListenerHandle>> lists = new ConcurrentHashMap<Class<? extends RepositoryListener>, CopyOnWriteArrayList<ListenerHandle>>();
+ private final ConcurrentMap<Class<? extends RepositoryListener>, CopyOnWriteArrayList<ListenerHandle>> lists = new ConcurrentHashMap<>();
/**
* Register an IndexChangedListener.
@@ -126,7 +126,7 @@ public class ListenerList {
if (list == null) {
CopyOnWriteArrayList<ListenerHandle> newList;
- newList = new CopyOnWriteArrayList<ListenerHandle>();
+ newList = new CopyOnWriteArrayList<>();
list = lists.putIfAbsent(handle.type, newList);
if (list == null)
list = newList;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java
index f9c239431a..856d74e997 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java
@@ -120,9 +120,9 @@ public class FileNameMatcher {
private FileNameMatcher(final List<Head> headsStartValue,
final List<Head> heads) {
this.headsStartValue = headsStartValue;
- this.heads = new ArrayList<Head>(heads.size());
+ this.heads = new ArrayList<>(heads.size());
this.heads.addAll(heads);
- this.listForLocalUseage = new ArrayList<Head>(heads.size());
+ this.listForLocalUseage = new ArrayList<>(heads.size());
}
/**
@@ -158,7 +158,7 @@ public class FileNameMatcher {
final List<AbstractHead> allHeads = parseHeads(patternString,
invalidWildgetCharacter);
- List<Head> nextHeadsSuggestion = new ArrayList<Head>(2);
+ List<Head> nextHeadsSuggestion = new ArrayList<>(2);
nextHeadsSuggestion.add(LastHead.INSTANCE);
for (int i = allHeads.size() - 1; i >= 0; i--) {
final AbstractHead head = allHeads.get(i);
@@ -172,7 +172,7 @@ public class FileNameMatcher {
head.setNewHeads(nextHeadsSuggestion);
} else {
head.setNewHeads(nextHeadsSuggestion);
- nextHeadsSuggestion = new ArrayList<Head>(2);
+ nextHeadsSuggestion = new ArrayList<>(2);
nextHeadsSuggestion.add(head);
}
}
@@ -236,7 +236,7 @@ public class FileNameMatcher {
throws InvalidPatternException {
int currentIndex = 0;
- List<AbstractHead> heads = new ArrayList<AbstractHead>();
+ List<AbstractHead> heads = new ArrayList<>();
while (currentIndex < pattern.length()) {
final int groupStart = indexOfUnescaped(pattern, '[', currentIndex);
if (groupStart == -1) {
@@ -262,7 +262,7 @@ public class FileNameMatcher {
private static List<AbstractHead> createSimpleHeads(
final String patternPart, final Character invalidWildgetCharacter) {
- final List<AbstractHead> heads = new ArrayList<AbstractHead>(
+ final List<AbstractHead> heads = new ArrayList<>(
patternPart.length());
boolean escaped = false;
@@ -375,7 +375,7 @@ public class FileNameMatcher {
* reset and start point.
*/
public FileNameMatcher createMatcherForSuffix() {
- final List<Head> copyOfHeads = new ArrayList<Head>(heads.size());
+ final List<Head> copyOfHeads = new ArrayList<>(heads.size());
copyOfHeads.addAll(heads);
return new FileNameMatcher(copyOfHeads);
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java
index a7bd2eafba..5c18756786 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java
@@ -64,7 +64,7 @@ final class GroupHead extends AbstractHead {
GroupHead(String pattern, final String wholePattern)
throws InvalidPatternException {
super(false);
- this.characterClasses = new ArrayList<CharacterPattern>();
+ this.characterClasses = new ArrayList<>();
this.inverse = pattern.startsWith("!"); //$NON-NLS-1$
if (inverse) {
pattern = pattern.substring(1);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
index 55ded92a17..7b600ee060 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
@@ -132,8 +132,8 @@ public class ManifestParser extends DefaultHandler {
lastIndex--;
this.baseUrl = baseUrl.substring(0, lastIndex + 1);
- plusGroups = new HashSet<String>();
- minusGroups = new HashSet<String>();
+ plusGroups = new HashSet<>();
+ minusGroups = new HashSet<>();
if (groups == null || groups.length() == 0
|| groups.equals("default")) { //$NON-NLS-1$
// default means "all,-notdefault"
@@ -147,9 +147,9 @@ public class ManifestParser extends DefaultHandler {
}
}
- remotes = new HashMap<String, Remote>();
- projects = new ArrayList<RepoProject>();
- filteredProjects = new ArrayList<RepoProject>();
+ remotes = new HashMap<>();
+ projects = new ArrayList<>();
+ filteredProjects = new ArrayList<>();
}
/**
@@ -258,7 +258,7 @@ public class ManifestParser extends DefaultHandler {
return;
// Only do the following after we finished reading everything.
- Map<String, String> remoteUrls = new HashMap<String, String>();
+ Map<String, String> remoteUrls = new HashMap<>();
URI baseUri;
try {
baseUri = new URI(baseUrl);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
index c3c7714c14..dd68f60108 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
@@ -464,7 +464,7 @@ public class RepoCommand extends GitCommand<RevCommit> {
}
if (repo.isBare()) {
- bareProjects = new ArrayList<RepoProject>();
+ bareProjects = new ArrayList<>();
if (author == null)
author = new PersonIdent(repo);
if (callback == null)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java
index ff4a3ed1c6..700cf11070 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java
@@ -155,7 +155,7 @@ public class RepoProject implements Comparable<RepoProject> {
this.remote = remote;
this.groups = groups;
this.recommendShallow = recommendShallow;
- copyfiles = new ArrayList<CopyFile>();
+ copyfiles = new ArrayList<>();
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
index 8b1244ed1b..6314c63d2e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
@@ -83,7 +83,7 @@ public class IgnoreNode {
/** Create an empty ignore node with no rules. */
public IgnoreNode() {
- rules = new ArrayList<FastIgnoreRule>();
+ rules = new ArrayList<>();
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java
index 9bb93cd888..65224eab91 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java
@@ -90,7 +90,7 @@ public class PathMatcher extends AbstractMatcher {
static private List<IMatcher> createMatchers(List<String> segments,
Character pathSeparator, boolean dirOnly)
throws InvalidPatternException {
- List<IMatcher> matchers = new ArrayList<IMatcher>(segments.size());
+ List<IMatcher> matchers = new ArrayList<>(segments.size());
for (int i = 0; i < segments.size(); i++) {
String segment = segments.get(i);
IMatcher matcher = createNameMatcher0(segment, pathSeparator,
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java
index 1c467fe71b..da482fa50a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java
@@ -148,7 +148,7 @@ public class Strings {
if (count < 1)
throw new IllegalStateException(
"Pattern must have at least two segments: " + pattern); //$NON-NLS-1$
- List<String> segments = new ArrayList<String>(count);
+ List<String> segments = new ArrayList<>(count);
int right = 0;
while (true) {
int left = right;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
index f7decf1324..ef0b80c11f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
@@ -183,7 +183,7 @@ public final class DfsBlockCache {
if (tableSize < 1)
throw new IllegalArgumentException(JGitText.get().tSizeMustBeGreaterOrEqual1);
- table = new AtomicReferenceArray<HashEntry>(tableSize);
+ table = new AtomicReferenceArray<>(tableSize);
loadLocks = new ReentrantLock[cfg.getConcurrencyLevel()];
for (int i = 0; i < loadLocks.length; i++)
loadLocks[i] = new ReentrantLock(true /* fair */);
@@ -194,10 +194,10 @@ public final class DfsBlockCache {
blockSizeShift = Integer.numberOfTrailingZeros(blockSize);
clockLock = new ReentrantLock(true /* fair */);
- clockHand = new Ref<Object>(new DfsPackKey(), -1, 0, null);
+ clockHand = new Ref<>(new DfsPackKey(), -1, 0, null);
clockHand.next = clockHand;
- packCache = new ConcurrentHashMap<DfsPackDescription, DfsPackFile>(
+ packCache = new ConcurrentHashMap<>(
16, 0.75f, 1);
packFiles = Collections.unmodifiableCollection(packCache.values());
@@ -357,7 +357,7 @@ public final class DfsBlockCache {
}
key.cachedSize.addAndGet(v.size());
- Ref<DfsBlock> ref = new Ref<DfsBlock>(key, position, v.size(), v);
+ Ref<DfsBlock> ref = new Ref<>(key, position, v.size(), v);
ref.hot = true;
for (;;) {
HashEntry n = new HashEntry(clean(e2), ref);
@@ -461,7 +461,7 @@ public final class DfsBlockCache {
}
key.cachedSize.addAndGet(size);
- ref = new Ref<T>(key, pos, size, v);
+ ref = new Ref<>(key, pos, size, v);
ref.hot = true;
for (;;) {
HashEntry n = new HashEntry(clean(e2), ref);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
index 968313254b..d3803024a5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
@@ -127,9 +127,9 @@ public class DfsGarbageCollector {
repo = repository;
refdb = repo.getRefDatabase();
objdb = repo.getObjectDatabase();
- newPackDesc = new ArrayList<DfsPackDescription>(4);
- newPackStats = new ArrayList<PackStatistics>(4);
- newPackObj = new ArrayList<ObjectIdSet>(4);
+ newPackDesc = new ArrayList<>(4);
+ newPackStats = new ArrayList<>(4);
+ newPackObj = new ArrayList<>(4);
packConfig = new PackConfig(repo);
packConfig.setIndexVersion(2);
@@ -249,10 +249,10 @@ public class DfsGarbageCollector {
return true;
}
- allHeads = new HashSet<ObjectId>();
- nonHeads = new HashSet<ObjectId>();
- txnHeads = new HashSet<ObjectId>();
- tagTargets = new HashSet<ObjectId>();
+ allHeads = new HashSet<>();
+ nonHeads = new HashSet<>();
+ txnHeads = new HashSet<>();
+ tagTargets = new HashSet<>();
for (Ref ref : refsBefore) {
if (ref.isSymbolic() || ref.getObjectId() == null)
continue;
@@ -304,8 +304,8 @@ public class DfsGarbageCollector {
private void readPacksBefore() throws IOException {
DfsPackFile[] packs = objdb.getPacks();
- packsBefore = new ArrayList<DfsPackFile>(packs.length);
- expiredGarbagePacks = new ArrayList<DfsPackFile>(packs.length);
+ packsBefore = new ArrayList<>(packs.length);
+ expiredGarbagePacks = new ArrayList<>(packs.length);
long mostRecentGC = mostRecentGC(packs);
long now = SystemReader.getInstance().getCurrentTime();
@@ -437,7 +437,7 @@ public class DfsGarbageCollector {
private List<DfsPackDescription> toPrune() {
int cnt = packsBefore.size();
- List<DfsPackDescription> all = new ArrayList<DfsPackDescription>(cnt);
+ List<DfsPackDescription> all = new ArrayList<>(cnt);
for (DfsPackFile pack : packsBefore) {
all.add(pack.getPackDescription());
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java
index c179e77786..1551ad6150 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java
@@ -274,8 +274,8 @@ public class DfsInserter extends ObjectInserter {
}
private void beginPack() throws IOException {
- objectList = new BlockList<PackedObjectInfo>();
- objectMap = new ObjectIdOwnerMap<PackedObjectInfo>();
+ objectList = new BlockList<>();
+ objectMap = new ObjectIdOwnerMap<>();
cache = DfsBlockCache.getInstance();
rollback = true;
@@ -543,7 +543,7 @@ public class DfsInserter extends ObjectInserter {
if (objectList == null)
return stored;
- Set<ObjectId> r = new HashSet<ObjectId>(stored.size() + 2);
+ Set<ObjectId> r = new HashSet<>(stored.size() + 2);
r.addAll(stored);
for (PackedObjectInfo obj : objectList) {
if (id.prefixCompare(obj) == 0)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
index b68527544a..b1cb72dec9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
@@ -160,7 +160,7 @@ public abstract class DfsObjDatabase extends ObjectDatabase {
protected DfsObjDatabase(DfsRepository repository,
DfsReaderOptions options) {
this.repository = repository;
- this.packList = new AtomicReference<PackList>(NO_PACKS);
+ this.packList = new AtomicReference<>(NO_PACKS);
this.readerOptions = options;
}
@@ -458,7 +458,7 @@ public abstract class DfsObjDatabase extends ObjectDatabase {
List<DfsPackDescription> scanned = listPacks();
Collections.sort(scanned);
- List<DfsPackFile> list = new ArrayList<DfsPackFile>(scanned.size());
+ List<DfsPackFile> list = new ArrayList<>(scanned.size());
boolean foundNew = false;
for (DfsPackDescription dsc : scanned) {
DfsPackFile oldPack = forReuse.remove(dsc);
@@ -483,7 +483,7 @@ public abstract class DfsObjDatabase extends ObjectDatabase {
private static Map<DfsPackDescription, DfsPackFile> reuseMap(PackList old) {
Map<DfsPackDescription, DfsPackFile> forReuse
- = new HashMap<DfsPackDescription, DfsPackFile>();
+ = new HashMap<>();
for (DfsPackFile p : old.packs) {
if (p.invalid()) {
// The pack instance is corrupted, and cannot be safely used
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java
index cc467853bc..0a29ac515f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java
@@ -113,10 +113,10 @@ public class DfsPackCompactor {
public DfsPackCompactor(DfsRepository repository) {
repo = repository;
autoAddSize = 5 * 1024 * 1024; // 5 MiB
- srcPacks = new ArrayList<DfsPackFile>();
- exclude = new ArrayList<ObjectIdSet>(4);
- newPacks = new ArrayList<DfsPackDescription>(1);
- newStats = new ArrayList<PackStatistics>(1);
+ srcPacks = new ArrayList<>();
+ exclude = new ArrayList<>(4);
+ newPacks = new ArrayList<>(1);
+ newStats = new ArrayList<>(1);
}
/**
@@ -280,7 +280,7 @@ public class DfsPackCompactor {
private List<DfsPackDescription> toPrune() {
int cnt = srcPacks.size();
- List<DfsPackDescription> all = new ArrayList<DfsPackDescription>(cnt);
+ List<DfsPackDescription> all = new ArrayList<>(cnt);
for (DfsPackFile pack : srcPacks)
all.add(pack.getPackDescription());
return all;
@@ -302,7 +302,7 @@ public class DfsPackCompactor {
rw = new RevWalk(ctx);
added = rw.newFlag("ADDED"); //$NON-NLS-1$
isBase = rw.newFlag("IS_BASE"); //$NON-NLS-1$
- List<RevObject> baseObjects = new BlockList<RevObject>();
+ List<RevObject> baseObjects = new BlockList<>();
pm.beginTask(JGitText.get().countingObjects, ProgressMonitor.UNKNOWN);
for (DfsPackFile src : srcPacks) {
@@ -346,7 +346,7 @@ public class DfsPackCompactor {
private List<ObjectIdWithOffset> toInclude(DfsPackFile src, DfsReader ctx)
throws IOException {
PackIndex srcIdx = src.getPackIndex(ctx);
- List<ObjectIdWithOffset> want = new BlockList<ObjectIdWithOffset>(
+ List<ObjectIdWithOffset> want = new BlockList<>(
(int) srcIdx.getObjectCount());
SCAN: for (PackIndex.MutableEntry ent : srcIdx) {
ObjectId id = ent.toObjectId();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java
index 358a921382..e825f1a8be 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java
@@ -102,7 +102,7 @@ public class DfsPackDescription implements Comparable<DfsPackDescription> {
this.repoDesc = repoDesc;
int dot = name.lastIndexOf('.');
this.packName = (dot < 0) ? name : name.substring(0, dot);
- this.sizeMap = new HashMap<PackExt, Long>(PackExt.values().length * 2);
+ this.sizeMap = new HashMap<>(PackExt.values().length * 2);
}
/** @return description of the repository. */
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java
index 5b55880583..755b163127 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java
@@ -166,7 +166,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
throws IOException {
if (id.isComplete())
return Collections.singleton(id.toObjectId());
- HashSet<ObjectId> matches = new HashSet<ObjectId>(4);
+ HashSet<ObjectId> matches = new HashSet<>(4);
PackList packList = db.getPackList();
resolveImpl(packList, id, matches);
if (matches.size() < MAX_RESOLVE_MATCHES && packList.dirty()) {
@@ -319,7 +319,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
findAllImpl(db.scanPacks(packList), pending, r);
}
for (T t : pending) {
- r.add(new FoundObject<T>(t));
+ r.add(new FoundObject<>(t));
}
Collections.sort(r, FOUND_OBJECT_SORT);
return r;
@@ -340,7 +340,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
try {
long p = lastPack.findOffset(this, t);
if (0 < p) {
- r.add(new FoundObject<T>(t, lastIdx, lastPack, p));
+ r.add(new FoundObject<>(t, lastIdx, lastPack, p));
it.remove();
continue;
}
@@ -358,7 +358,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
try {
long p = pack.findOffset(this, t);
if (0 < p) {
- r.add(new FoundObject<T>(t, i, pack, p));
+ r.add(new FoundObject<>(t, i, pack, p));
it.remove();
lastIdx = i;
lastPack = pack;
@@ -612,7 +612,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
private List<DfsObjectToPack> findAllFromPack(DfsPackFile pack,
Iterable<ObjectToPack> objects) throws IOException {
- List<DfsObjectToPack> tmp = new BlockList<DfsObjectToPack>();
+ List<DfsObjectToPack> tmp = new BlockList<>();
PackIndex idx = pack.getPackIndex(this);
for (ObjectToPack otp : objects) {
long p = idx.findOffset(otp);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRefDatabase.java
index 4ddcec1673..b41c18b6c2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRefDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRefDatabase.java
@@ -78,7 +78,7 @@ public abstract class DfsRefDatabase extends RefDatabase {
*/
protected DfsRefDatabase(DfsRepository repository) {
this.repository = repository;
- this.cache = new AtomicReference<RefCache>();
+ this.cache = new AtomicReference<>();
}
/** @return the repository the database holds the references of. */
@@ -120,7 +120,7 @@ public abstract class DfsRefDatabase extends RefDatabase {
RefCache curr = read();
RefList<Ref> packed = RefList.emptyList();
RefList<Ref> loose = curr.ids;
- RefList.Builder<Ref> sym = new RefList.Builder<Ref>(curr.sym.size());
+ RefList.Builder<Ref> sym = new RefList.Builder<>(curr.sym.size());
for (int idx = 0; idx < curr.sym.size(); idx++) {
Ref ref = curr.sym.get(idx);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java
index a31a47e115..527e46b733 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java
@@ -107,7 +107,7 @@ public class InMemoryRepository extends DfsRepository {
}
private class MemObjDatabase extends DfsObjDatabase {
- private List<DfsPackDescription> packs = new ArrayList<DfsPackDescription>();
+ private List<DfsPackDescription> packs = new ArrayList<>();
MemObjDatabase(DfsRepository repo) {
super(repo, new DfsReaderOptions());
@@ -132,7 +132,7 @@ public class InMemoryRepository extends DfsRepository {
Collection<DfsPackDescription> desc,
Collection<DfsPackDescription> replace) {
List<DfsPackDescription> n;
- n = new ArrayList<DfsPackDescription>(desc.size() + packs.size());
+ n = new ArrayList<>(desc.size() + packs.size());
n.addAll(desc);
n.addAll(packs);
if (replace != null)
@@ -170,7 +170,7 @@ public class InMemoryRepository extends DfsRepository {
private static class MemPack extends DfsPackDescription {
final Map<PackExt, byte[]>
- fileMap = new HashMap<PackExt, byte[]>();
+ fileMap = new HashMap<>();
MemPack(String name, DfsRepositoryDescription repoDesc) {
super(repoDesc, name);
@@ -278,7 +278,7 @@ public class InMemoryRepository extends DfsRepository {
* subclasses of InMemoryRepository.
*/
protected class MemRefDatabase extends DfsRefDatabase {
- private final ConcurrentMap<String, Ref> refs = new ConcurrentHashMap<String, Ref>();
+ private final ConcurrentMap<String, Ref> refs = new ConcurrentHashMap<>();
private final ReadWriteLock lock = new ReentrantReadWriteLock(true /* fair */);
/**
@@ -315,8 +315,8 @@ public class InMemoryRepository extends DfsRepository {
@Override
protected RefCache scanAllRefs() throws IOException {
- RefList.Builder<Ref> ids = new RefList.Builder<Ref>();
- RefList.Builder<Ref> sym = new RefList.Builder<Ref>();
+ RefList.Builder<Ref> ids = new RefList.Builder<>();
+ RefList.Builder<Ref> sym = new RefList.Builder<>();
try {
lock.readLock().lock();
for (Ref ref : refs.values()) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java
index 7855a460cd..88eef4ce86 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java
@@ -442,10 +442,10 @@ public class BitmapIndexImpl implements BitmapIndex {
private static final class MutableBitmapIndex {
private final ObjectIdOwnerMap<MutableEntry>
- revMap = new ObjectIdOwnerMap<MutableEntry>();
+ revMap = new ObjectIdOwnerMap<>();
private final BlockList<MutableEntry>
- revList = new BlockList<MutableEntry>();
+ revList = new BlockList<>();
int findPosition(AnyObjectId objectId) {
MutableEntry entry = revMap.get(objectId);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java
index a81d8ec0e9..d47b304688 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java
@@ -90,7 +90,7 @@ class CachedObjectDirectory extends FileObjectDatabase {
}
private ObjectIdOwnerMap<UnpackedObjectId> scanLoose() {
- ObjectIdOwnerMap<UnpackedObjectId> m = new ObjectIdOwnerMap<UnpackedObjectId>();
+ ObjectIdOwnerMap<UnpackedObjectId> m = new ObjectIdOwnerMap<>();
File objects = wrapped.getDirectory();
String[] fanout = objects.list();
if (fanout == null)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java
index a95dea74b6..b3979894e4 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java
@@ -69,7 +69,7 @@ class DeltaBaseCache {
private int openByteCount;
static {
- DEAD = new SoftReference<Entry>(null);
+ DEAD = new SoftReference<>(null);
reconfigure(new WindowCacheConfig());
}
@@ -115,7 +115,7 @@ class DeltaBaseCache {
e.provider = pack;
e.position = position;
e.sz = data.length;
- e.data = new SoftReference<Entry>(new Entry(data, objectType));
+ e.data = new SoftReference<>(new Entry(data, objectType));
moveToHead(e);
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
index 16315a5b55..ba52251a4c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
@@ -490,7 +490,7 @@ public class FileRepository extends Repository {
*/
@Override
public Set<ObjectId> getAdditionalHaves() {
- HashSet<ObjectId> r = new HashSet<ObjectId>();
+ HashSet<ObjectId> r = new HashSet<>();
for (AlternateHandle d : objectDatabase.myAlternates()) {
if (d instanceof AlternateRepository) {
Repository repo;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
index 353024c9da..c68e5f7f3d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
@@ -453,7 +453,7 @@ public class GC {
// Collect all loose objects which are old enough, not referenced from
// the index and not in objectsToKeep
- Map<ObjectId, File> deletionCandidates = new HashMap<ObjectId, File>();
+ Map<ObjectId, File> deletionCandidates = new HashMap<>();
Set<ObjectId> indexObjects = null;
File objects = repo.getObjectsDirectory();
String[] fanout = objects.list();
@@ -694,7 +694,7 @@ public class GC {
*/
public void packRefs() throws IOException {
Collection<Ref> refs = repo.getRefDatabase().getRefs(Constants.R_REFS).values();
- List<String> refsToBePacked = new ArrayList<String>(refs.size());
+ List<String> refsToBePacked = new ArrayList<>(refs.size());
pm.beginTask(JGitText.get().packRefs, refs.size());
try {
for (Ref ref : refs) {
@@ -729,10 +729,10 @@ public class GC {
long time = System.currentTimeMillis();
Collection<Ref> refsBefore = getAllRefs();
- Set<ObjectId> allHeads = new HashSet<ObjectId>();
- Set<ObjectId> nonHeads = new HashSet<ObjectId>();
- Set<ObjectId> txnHeads = new HashSet<ObjectId>();
- Set<ObjectId> tagTargets = new HashSet<ObjectId>();
+ Set<ObjectId> allHeads = new HashSet<>();
+ Set<ObjectId> nonHeads = new HashSet<>();
+ Set<ObjectId> txnHeads = new HashSet<>();
+ Set<ObjectId> tagTargets = new HashSet<>();
Set<ObjectId> indexObjects = listNonHEADIndexObjects();
RefDatabase refdb = repo.getRefDatabase();
@@ -751,7 +751,7 @@ public class GC {
tagTargets.add(ref.getPeeledObjectId());
}
- List<ObjectIdSet> excluded = new LinkedList<ObjectIdSet>();
+ List<ObjectIdSet> excluded = new LinkedList<>();
for (final PackFile f : repo.getObjectDatabase().getPacks()) {
checkCancelled();
if (f.shouldBeKept())
@@ -761,7 +761,7 @@ public class GC {
tagTargets.addAll(allHeads);
nonHeads.addAll(indexObjects);
- List<PackFile> ret = new ArrayList<PackFile>(2);
+ List<PackFile> ret = new ArrayList<>(2);
PackFile heads = null;
if (!allHeads.isEmpty()) {
heads = writePack(allHeads, Collections.<ObjectId> emptySet(),
@@ -863,7 +863,7 @@ public class GC {
.getReverseEntries();
if (rlEntries == null || rlEntries.isEmpty())
return Collections.<ObjectId> emptySet();
- Set<ObjectId> ret = new HashSet<ObjectId>();
+ Set<ObjectId> ret = new HashSet<>();
for (ReflogEntry e : rlEntries) {
if (e.getWho().getWhen().getTime() < minTime)
break;
@@ -932,7 +932,7 @@ public class GC {
treeWalk.setFilter(TreeFilter.ANY_DIFF);
treeWalk.setRecursive(true);
- Set<ObjectId> ret = new HashSet<ObjectId>();
+ Set<ObjectId> ret = new HashSet<>();
while (treeWalk.next()) {
checkCancelled();
@@ -965,7 +965,7 @@ public class GC {
List<ObjectIdSet> excludeObjects) throws IOException {
checkCancelled();
File tmpPack = null;
- Map<PackExt, File> tmpExts = new TreeMap<PackExt, File>(
+ Map<PackExt, File> tmpExts = new TreeMap<>(
new Comparator<PackExt>() {
@Override
public int compare(PackExt o1, PackExt o2) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java
index 2f4d2d633c..1aa71e5a59 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java
@@ -169,12 +169,12 @@ public class ObjectDirectory extends FileObjectDatabase {
packDirectory = new File(objects, "pack"); //$NON-NLS-1$
preservedDirectory = new File(packDirectory, "preserved"); //$NON-NLS-1$
alternatesFile = new File(infoDirectory, "alternates"); //$NON-NLS-1$
- packList = new AtomicReference<PackList>(NO_PACKS);
+ packList = new AtomicReference<>(NO_PACKS);
unpackedObjectCache = new UnpackedObjectCache();
this.fs = fs;
this.shallowFile = shallowFile;
- alternates = new AtomicReference<AlternateHandle[]>();
+ alternates = new AtomicReference<>();
if (alternatePaths != null) {
AlternateHandle[] alt;
@@ -700,7 +700,7 @@ public class ObjectDirectory extends FileObjectDatabase {
if (shallowFileSnapshot == null
|| shallowFileSnapshot.isModified(shallowFile)) {
- shallowCommitsIds = new HashSet<ObjectId>();
+ shallowCommitsIds = new HashSet<>();
final BufferedReader reader = open(shallowFile);
try {
@@ -797,7 +797,7 @@ public class ObjectDirectory extends FileObjectDatabase {
final Map<String, PackFile> forReuse = reuseMap(old);
final FileSnapshot snapshot = FileSnapshot.save(packDirectory);
final Set<String> names = listPackDirectory();
- final List<PackFile> list = new ArrayList<PackFile>(names.size() >> 2);
+ final List<PackFile> list = new ArrayList<>(names.size() >> 2);
boolean foundNew = false;
for (final String indexName : names) {
// Must match "pack-[0-9a-f]{40}.idx" to be an index.
@@ -855,7 +855,7 @@ public class ObjectDirectory extends FileObjectDatabase {
}
private static Map<String, PackFile> reuseMap(final PackList old) {
- final Map<String, PackFile> forReuse = new HashMap<String, PackFile>();
+ final Map<String, PackFile> forReuse = new HashMap<>();
for (final PackFile p : old.packs) {
if (p.invalid()) {
// The pack instance is corrupted, and cannot be safely used
@@ -884,7 +884,7 @@ public class ObjectDirectory extends FileObjectDatabase {
final String[] nameList = packDirectory.list();
if (nameList == null)
return Collections.emptySet();
- final Set<String> nameSet = new HashSet<String>(nameList.length << 1);
+ final Set<String> nameSet = new HashSet<>(nameList.length << 1);
for (final String name : nameList) {
if (name.startsWith("pack-")) //$NON-NLS-1$
nameSet.add(name);
@@ -911,7 +911,7 @@ public class ObjectDirectory extends FileObjectDatabase {
}
private AlternateHandle[] loadAlternates() throws IOException {
- final List<AlternateHandle> l = new ArrayList<AlternateHandle>(4);
+ final List<AlternateHandle> l = new ArrayList<>(4);
final BufferedReader br = open(alternatesFile);
try {
String line;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
index d80abaa9c3..bfd60fc535 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
@@ -75,9 +75,9 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex {
private final EWAHCompressedBitmap tags;
private final BlockList<PositionEntry> byOffset;
final BlockList<StoredBitmap>
- byAddOrder = new BlockList<StoredBitmap>();
+ byAddOrder = new BlockList<>();
final ObjectIdOwnerMap<PositionEntry>
- positionEntries = new ObjectIdOwnerMap<PositionEntry>();
+ positionEntries = new ObjectIdOwnerMap<>();
/**
* Creates a PackBitmapIndex used for building the contents of an index
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java
index 6b5b8826ea..9a8c2752dd 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java
@@ -107,7 +107,7 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex
BasePackBitmapIndex oldPackIndex, PackBitmapIndex newPackIndex) {
this.oldPackIndex = oldPackIndex;
this.newPackIndex = newPackIndex;
- convertedBitmaps = new ObjectIdOwnerMap<StoredBitmap>();
+ convertedBitmaps = new ObjectIdOwnerMap<>();
inflated = new BitSet(newPackIndex.getObjectCount());
prevToNewMapping = new int[oldPackIndex.getObjectCount()];
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
index 542570a2db..24d51a5ea6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
@@ -153,10 +153,10 @@ public class RefDirectory extends RefDatabase {
* converted into resolved references during a get operation, ensuring the
* live value is always returned.
*/
- private final AtomicReference<RefList<LooseRef>> looseRefs = new AtomicReference<RefList<LooseRef>>();
+ private final AtomicReference<RefList<LooseRef>> looseRefs = new AtomicReference<>();
/** Immutable sorted list of packed references. */
- final AtomicReference<PackedRefList> packedRefs = new AtomicReference<PackedRefList>();
+ final AtomicReference<PackedRefList> packedRefs = new AtomicReference<>();
/**
* Number of modifications made to this database.
@@ -352,7 +352,7 @@ public class RefDirectory extends RefDatabase {
@Override
public List<Ref> getAdditionalRefs() throws IOException {
- List<Ref> ret = new LinkedList<Ref>();
+ List<Ref> ret = new LinkedList<>();
for (String name : additionalRefsNames) {
Ref r = getRef(name);
if (r != null)
@@ -371,7 +371,7 @@ public class RefDirectory extends RefDatabase {
private int curIdx;
- final RefList.Builder<Ref> symbolic = new RefList.Builder<Ref>(4);
+ final RefList.Builder<Ref> symbolic = new RefList.Builder<>(4);
RefList.Builder<LooseRef> newLoose;
@@ -819,7 +819,7 @@ public class RefDirectory extends RefDatabase {
private RefList<Ref> parsePackedRefs(final BufferedReader br)
throws IOException {
- RefList.Builder<Ref> all = new RefList.Builder<Ref>();
+ RefList.Builder<Ref> all = new RefList.Builder<>();
Ref last = null;
boolean peeled = false;
boolean needSort = false;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java
index 490da46952..c3702fecab 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java
@@ -132,7 +132,7 @@ class ReflogReaderImpl implements ReflogReader {
}
int rs = RawParseUtils.prevLF(log, log.length);
- List<ReflogEntry> ret = new ArrayList<ReflogEntry>();
+ List<ReflogEntry> ret = new ArrayList<>();
while (rs >= 0 && max-- > 0) {
rs = RawParseUtils.prevLF(log, rs);
ReflogEntry entry = new ReflogEntryImpl(log, rs < 0 ? 0 : rs + 2);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObjectCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObjectCache.java
index ce67ae07ad..967754a627 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObjectCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObjectCache.java
@@ -100,7 +100,7 @@ class UnpackedObjectCache {
final int bits;
Table(int bits) {
- this.ids = new AtomicReferenceArray<ObjectId>(1 << bits);
+ this.ids = new AtomicReferenceArray<>(1 << bits);
this.shift = 32 - bits;
this.bits = bits;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java
index e1b7606df2..a525c85116 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java
@@ -235,9 +235,9 @@ public class WindowCache {
if (lockCount < 1)
throw new IllegalArgumentException(JGitText.get().lockCountMustBeGreaterOrEqual1);
- queue = new ReferenceQueue<ByteWindow>();
+ queue = new ReferenceQueue<>();
clock = new AtomicLong(1);
- table = new AtomicReferenceArray<Entry>(tableSize);
+ table = new AtomicReferenceArray<>(tableSize);
locks = new Lock[lockCount];
for (int i = 0; i < locks.length; i++)
locks[i] = new Lock();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java
index 27215502ba..83b236ed96 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java
@@ -142,7 +142,7 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs {
throws IOException {
if (id.isComplete())
return Collections.singleton(id.toObjectId());
- HashSet<ObjectId> matches = new HashSet<ObjectId>(4);
+ HashSet<ObjectId> matches = new HashSet<>(4);
db.resolve(matches, id);
return matches;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BaseSearch.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BaseSearch.java
index b6af0b03f5..d231ccb997 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BaseSearch.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BaseSearch.java
@@ -96,7 +96,7 @@ class BaseSearch {
edgeObjects = edges;
alreadyProcessed = new IntSet();
- treeCache = new ObjectIdOwnerMap<TreeWithData>();
+ treeCache = new ObjectIdOwnerMap<>();
parser = new CanonicalTreeParser();
idBuf = new MutableObjectId();
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaCache.java
index 91917b2812..973dd1de37 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaCache.java
@@ -60,7 +60,7 @@ class DeltaCache {
DeltaCache(PackConfig pc) {
size = pc.getDeltaCacheSize();
entryLimit = pc.getDeltaCacheLimit();
- queue = new ReferenceQueue<byte[]>();
+ queue = new ReferenceQueue<>();
}
boolean canCache(int length, ObjectToPack src, ObjectToPack res) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java
index 635cb8d8d7..0c4e4448d8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java
@@ -78,7 +78,7 @@ final class DeltaTask implements Callable<Object> {
Block(int threads, PackConfig config, ObjectReader reader,
DeltaCache dc, ThreadSafeProgressMonitor pm,
ObjectToPack[] list, int begin, int end) {
- this.tasks = new ArrayList<DeltaTask>(threads);
+ this.tasks = new ArrayList<>(threads);
this.threads = threads;
this.config = config;
this.templateReader = reader;
@@ -176,7 +176,7 @@ final class DeltaTask implements Callable<Object> {
}
private ArrayList<WeightedPath> computeTopPaths() {
- ArrayList<WeightedPath> topPaths = new ArrayList<WeightedPath>(
+ ArrayList<WeightedPath> topPaths = new ArrayList<>(
threads);
int cp = beginIndex;
int ch = list[cp].getPathHash();
@@ -277,7 +277,7 @@ final class DeltaTask implements Callable<Object> {
DeltaTask(Block b) {
this.block = b;
- this.slices = new LinkedList<Slice>();
+ this.slices = new LinkedList<>();
}
void add(Slice s) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
index 37354d3e61..93dbee3e79 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
@@ -167,7 +167,7 @@ public class PackWriter implements AutoCloseable {
public static final Set<ObjectId> NONE = Collections.emptySet();
private static final Map<WeakReference<PackWriter>, Boolean> instances =
- new ConcurrentHashMap<WeakReference<PackWriter>, Boolean>();
+ new ConcurrentHashMap<>();
private static final Iterable<PackWriter> instancesIterable = new Iterable<PackWriter>() {
@Override
@@ -217,21 +217,21 @@ public class PackWriter implements AutoCloseable {
@SuppressWarnings("unchecked")
BlockList<ObjectToPack> objectsLists[] = new BlockList[OBJ_TAG + 1];
{
- objectsLists[OBJ_COMMIT] = new BlockList<ObjectToPack>();
- objectsLists[OBJ_TREE] = new BlockList<ObjectToPack>();
- objectsLists[OBJ_BLOB] = new BlockList<ObjectToPack>();
- objectsLists[OBJ_TAG] = new BlockList<ObjectToPack>();
+ objectsLists[OBJ_COMMIT] = new BlockList<>();
+ objectsLists[OBJ_TREE] = new BlockList<>();
+ objectsLists[OBJ_BLOB] = new BlockList<>();
+ objectsLists[OBJ_TAG] = new BlockList<>();
}
- private ObjectIdOwnerMap<ObjectToPack> objectsMap = new ObjectIdOwnerMap<ObjectToPack>();
+ private ObjectIdOwnerMap<ObjectToPack> objectsMap = new ObjectIdOwnerMap<>();
// edge objects for thin packs
- private List<ObjectToPack> edgeObjects = new BlockList<ObjectToPack>();
+ private List<ObjectToPack> edgeObjects = new BlockList<>();
// Objects the client is known to have already.
private BitmapBuilder haveObjects;
- private List<CachedPack> cachedPacks = new ArrayList<CachedPack>(2);
+ private List<CachedPack> cachedPacks = new ArrayList<>(2);
private Set<ObjectId> tagTargets = Collections.emptySet();
@@ -359,7 +359,7 @@ public class PackWriter implements AutoCloseable {
reuseValidate = true; // be paranoid by default
stats = new PackStatistics.Accumulator();
state = new MutableState();
- selfRef = new WeakReference<PackWriter>(this);
+ selfRef = new WeakReference<>(this);
instances.put(selfRef, Boolean.TRUE);
}
@@ -387,7 +387,7 @@ public class PackWriter implements AutoCloseable {
*/
public void setClientShallowCommits(Set<ObjectId> clientShallowCommits) {
stats.clientShallowCommits = Collections
- .unmodifiableSet(new HashSet<ObjectId>(clientShallowCommits));
+ .unmodifiableSet(new HashSet<>(clientShallowCommits));
}
/**
@@ -918,7 +918,7 @@ public class PackWriter implements AutoCloseable {
cnt += objectsLists[OBJ_BLOB].size();
cnt += objectsLists[OBJ_TAG].size();
- sortedByName = new BlockList<ObjectToPack>(cnt);
+ sortedByName = new BlockList<>(cnt);
sortedByName.addAll(objectsLists[OBJ_COMMIT]);
sortedByName.addAll(objectsLists[OBJ_TREE]);
sortedByName.addAll(objectsLists[OBJ_BLOB]);
@@ -1112,7 +1112,7 @@ public class PackWriter implements AutoCloseable {
beginPhase(PackingPhase.FINDING_SOURCES, monitor, cnt);
if (cnt <= 4096) {
// For small object counts, do everything as one list.
- BlockList<ObjectToPack> tmp = new BlockList<ObjectToPack>((int) cnt);
+ BlockList<ObjectToPack> tmp = new BlockList<>((int) cnt);
tmp.addAll(objectsLists[OBJ_TAG]);
tmp.addAll(objectsLists[OBJ_COMMIT]);
tmp.addAll(objectsLists[OBJ_TREE]);
@@ -1447,7 +1447,7 @@ public class PackWriter implements AutoCloseable {
private static void runTasks(ExecutorService pool,
ThreadSafeProgressMonitor pm,
DeltaTask.Block tb, List<Throwable> errors) throws IOException {
- List<Future<?>> futures = new ArrayList<Future<?>>(tb.tasks.size());
+ List<Future<?>> futures = new ArrayList<>(tb.tasks.size());
for (DeltaTask task : tb.tasks)
futures.add(pool.submit(task));
@@ -1676,7 +1676,7 @@ public class PackWriter implements AutoCloseable {
}
}
- List<ObjectId> all = new ArrayList<ObjectId>(want.size() + have.size());
+ List<ObjectId> all = new ArrayList<>(want.size() + have.size());
all.addAll(want);
all.addAll(have);
@@ -1694,9 +1694,9 @@ public class PackWriter implements AutoCloseable {
walker.sort(RevSort.BOUNDARY, true);
}
- List<RevObject> wantObjs = new ArrayList<RevObject>(want.size());
- List<RevObject> haveObjs = new ArrayList<RevObject>(haveEst);
- List<RevTag> wantTags = new ArrayList<RevTag>(want.size());
+ List<RevObject> wantObjs = new ArrayList<>(want.size());
+ List<RevObject> haveObjs = new ArrayList<>(haveEst);
+ List<RevTag> wantTags = new ArrayList<>(want.size());
// Retrieve the RevWalk's versions of "want" and "have" objects to
// maintain any state previously set in the RevWalk.
@@ -1727,7 +1727,7 @@ public class PackWriter implements AutoCloseable {
}
if (!wantTags.isEmpty()) {
- all = new ArrayList<ObjectId>(wantTags.size());
+ all = new ArrayList<>(wantTags.size());
for (RevTag tag : wantTags)
all.add(tag.getObject());
q = walker.parseAny(all, true);
@@ -1770,8 +1770,8 @@ public class PackWriter implements AutoCloseable {
walker.markUninteresting(obj);
final int maxBases = config.getDeltaSearchWindowSize();
- Set<RevTree> baseTrees = new HashSet<RevTree>();
- BlockList<RevCommit> commits = new BlockList<RevCommit>();
+ Set<RevTree> baseTrees = new HashSet<>();
+ BlockList<RevCommit> commits = new BlockList<>();
Set<ObjectId> roots = new HashSet<>();
RevCommit c;
while ((c = walker.next()) != null) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java
index 2c2c80eb84..07a03b4040 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java
@@ -168,7 +168,7 @@ class PackWriterBitmapPreparer {
pm.endTask();
int totCommits = selectionHelper.getCommitCount();
- BlockList<BitmapCommit> selections = new BlockList<BitmapCommit>(
+ BlockList<BitmapCommit> selections = new BlockList<>(
totCommits / recentCommitSpan + 1);
for (BitmapCommit reuse : selectionHelper.reusedCommits) {
selections.add(reuse);
@@ -195,7 +195,7 @@ class PackWriterBitmapPreparer {
// better compression/on the run-length encoding of the XORs between
// them.
List<List<BitmapCommit>> chains =
- new ArrayList<List<BitmapCommit>>();
+ new ArrayList<>();
// Mark the current branch as inactive if its tip commit isn't
// recent and there are an excessive number of branches, to
@@ -287,7 +287,7 @@ class PackWriterBitmapPreparer {
}
if (longestAncestorChain == null) {
- longestAncestorChain = new ArrayList<BitmapCommit>();
+ longestAncestorChain = new ArrayList<>();
chains.add(longestAncestorChain);
}
longestAncestorChain.add(new BitmapCommit(
@@ -376,7 +376,7 @@ class PackWriterBitmapPreparer {
int expectedCommitCount) throws IncorrectObjectTypeException,
IOException, MissingObjectException {
BitmapBuilder reuse = commitBitmapIndex.newBitmapBuilder();
- List<BitmapCommit> reuseCommits = new ArrayList<BitmapCommit>();
+ List<BitmapCommit> reuseCommits = new ArrayList<>();
for (PackBitmapIndexRemapper.Entry entry : bitmapRemapper) {
// More recent commits did not have the reuse flag set, so skip them
if ((entry.getFlags() & FLAG_REUSE) != FLAG_REUSE) {
@@ -398,9 +398,9 @@ class PackWriterBitmapPreparer {
// Add branch tips that are not represented in old bitmap indices. Set
// up the RevWalk to walk the new commits not in the old packs.
- List<BitmapBuilderEntry> tipCommitBitmaps = new ArrayList<BitmapBuilderEntry>(
+ List<BitmapBuilderEntry> tipCommitBitmaps = new ArrayList<>(
want.size());
- Set<RevCommit> peeledWant = new HashSet<RevCommit>(want.size());
+ Set<RevCommit> peeledWant = new HashSet<>(want.size());
for (AnyObjectId objectId : want) {
RevObject ro = rw.peel(rw.parseAny(objectId));
if (!(ro instanceof RevCommit) || reuse.contains(ro)) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
index 670f9a9e14..de1003bdde 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
@@ -218,7 +218,7 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
public B addAlternateObjectDirectory(File other) {
if (other != null) {
if (alternateObjectDirectories == null)
- alternateObjectDirectories = new LinkedList<File>();
+ alternateObjectDirectories = new LinkedList<>();
alternateObjectDirectories.add(other);
}
return self();
@@ -429,7 +429,7 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
public B addCeilingDirectory(File root) {
if (root != null) {
if (ceilingDirectories == null)
- ceilingDirectories = new LinkedList<File>();
+ ceilingDirectories = new LinkedList<>();
ceilingDirectories.add(root);
}
return self();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
index 653c9f66b6..3f6995de83 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
@@ -120,7 +120,7 @@ public class BatchRefUpdate {
*/
protected BatchRefUpdate(RefDatabase refdb) {
this.refdb = refdb;
- this.commands = new ArrayList<ReceiveCommand>();
+ this.commands = new ArrayList<>();
this.atomic = refdb.performsAtomicTransactions();
}
@@ -400,7 +400,7 @@ public class BatchRefUpdate {
}
monitor.beginTask(JGitText.get().updatingReferences, commands.size());
- List<ReceiveCommand> commands2 = new ArrayList<ReceiveCommand>(
+ List<ReceiveCommand> commands2 = new ArrayList<>(
commands.size());
// First delete refs. This may free the name space for some of the
// updates.
@@ -431,7 +431,7 @@ public class BatchRefUpdate {
}
if (!commands2.isEmpty()) {
// What part of the name space is already taken
- Collection<String> takenNames = new HashSet<String>(refdb.getRefs(
+ Collection<String> takenNames = new HashSet<>(refdb.getRefs(
RefDatabase.ALL).keySet());
Collection<String> takenPrefixes = getTakenPrefixes(takenNames);
@@ -525,7 +525,7 @@ public class BatchRefUpdate {
private static Collection<String> getTakenPrefixes(
final Collection<String> names) {
- Collection<String> ref = new HashSet<String>();
+ Collection<String> ref = new HashSet<>();
for (String name : names)
ref.addAll(getPrefixes(name));
return ref;
@@ -539,7 +539,7 @@ public class BatchRefUpdate {
}
static Collection<String> getPrefixes(String s) {
- Collection<String> ret = new HashSet<String>();
+ Collection<String> ret = new HashSet<>();
int p1 = s.indexOf('/');
while (p1 > 0) {
ret.add(s.substring(0, p1));
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
index ec771a24f0..f45c71cf95 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
@@ -122,7 +122,7 @@ public class Config {
*/
public Config(Config defaultConfig) {
baseConfig = defaultConfig;
- state = new AtomicReference<ConfigSnapshot>(newState());
+ state = new AtomicReference<>(newState());
}
/**
@@ -960,7 +960,7 @@ public class Config {
final String section,
final String subsection) {
final int max = srcState.entryList.size();
- final ArrayList<ConfigLine> r = new ArrayList<ConfigLine>(max);
+ final ArrayList<ConfigLine> r = new ArrayList<>(max);
boolean lastWasMatch = false;
for (ConfigLine e : srcState.entryList) {
@@ -1075,7 +1075,7 @@ public class Config {
// for a new section header. Assume that and allocate the space.
//
final int max = src.entryList.size() + values.size() + 1;
- final ArrayList<ConfigLine> r = new ArrayList<ConfigLine>(max);
+ final ArrayList<ConfigLine> r = new ArrayList<>(max);
r.addAll(src.entryList);
return r;
}
@@ -1163,7 +1163,7 @@ public class Config {
throw new ConfigInvalidException(
JGitText.get().tooManyIncludeRecursions);
}
- final List<ConfigLine> newEntries = new ArrayList<ConfigLine>();
+ final List<ConfigLine> newEntries = new ArrayList<>();
final StringReader in = new StringReader(text);
ConfigLine last = null;
ConfigLine e = new ConfigLine();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java
index 90c42ea168..f5ada13a38 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java
@@ -78,7 +78,7 @@ class ConfigSnapshot {
ConfigSnapshot(List<ConfigLine> entries, ConfigSnapshot base) {
entryList = entries;
- cache = new ConcurrentHashMap<Object, Object>(16, 0.75f, 1);
+ cache = new ConcurrentHashMap<>(16, 0.75f, 1);
baseState = base;
}
@@ -112,7 +112,7 @@ class ConfigSnapshot {
if (idx < 0)
idx = -(idx + 1);
- Map<String, String> m = new LinkedHashMap<String, String>();
+ Map<String, String> m = new LinkedHashMap<>();
while (idx < s.size()) {
ConfigLine e = s.get(idx++);
if (!e.match(section, subsection))
@@ -187,7 +187,7 @@ class ConfigSnapshot {
}
private static List<ConfigLine> sort(List<ConfigLine> in) {
- List<ConfigLine> sorted = new ArrayList<ConfigLine>(in.size());
+ List<ConfigLine> sorted = new ArrayList<>(in.size());
for (ConfigLine line : in) {
if (line.section != null && line.name != null)
sorted.add(line);
@@ -237,8 +237,8 @@ class ConfigSnapshot {
final Map<String, Set<String>> subsections;
SectionNames(ConfigSnapshot cfg) {
- Map<String, String> sec = new LinkedHashMap<String, String>();
- Map<String, Set<String>> sub = new HashMap<String, Set<String>>();
+ Map<String, String> sec = new LinkedHashMap<>();
+ Map<String, Set<String>> sub = new HashMap<>();
while (cfg != null) {
for (ConfigLine e : cfg.entryList) {
if (e.section == null)
@@ -253,7 +253,7 @@ class ConfigSnapshot {
Set<String> m = sub.get(l1);
if (m == null) {
- m = new LinkedHashSet<String>();
+ m = new LinkedHashSet<>();
sub.put(l1, m);
}
m.add(e.subsection);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
index b845fad03f..e544b72a85 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
@@ -253,19 +253,19 @@ public class IndexDiff {
private final WorkingTreeIterator initialWorkingTreeIterator;
- private Set<String> added = new HashSet<String>();
+ private Set<String> added = new HashSet<>();
- private Set<String> changed = new HashSet<String>();
+ private Set<String> changed = new HashSet<>();
- private Set<String> removed = new HashSet<String>();
+ private Set<String> removed = new HashSet<>();
- private Set<String> missing = new HashSet<String>();
+ private Set<String> missing = new HashSet<>();
- private Set<String> modified = new HashSet<String>();
+ private Set<String> modified = new HashSet<>();
- private Set<String> untracked = new HashSet<String>();
+ private Set<String> untracked = new HashSet<>();
- private Map<String, StageState> conflicts = new HashMap<String, StageState>();
+ private Map<String, StageState> conflicts = new HashMap<>();
private Set<String> ignored;
@@ -275,11 +275,11 @@ public class IndexDiff {
private IndexDiffFilter indexDiffFilter;
- private Map<String, IndexDiff> submoduleIndexDiffs = new HashMap<String, IndexDiff>();
+ private Map<String, IndexDiff> submoduleIndexDiffs = new HashMap<>();
private IgnoreSubmoduleMode ignoreSubmoduleMode = null;
- private Map<FileMode, Set<String>> fileModes = new HashMap<FileMode, Set<String>>();
+ private Map<FileMode, Set<String>> fileModes = new HashMap<>();
/**
* Construct an IndexDiff
@@ -417,7 +417,7 @@ public class IndexDiff {
treeWalk.addTree(new DirCacheIterator(dirCache));
treeWalk.addTree(initialWorkingTreeIterator);
initialWorkingTreeIterator.setDirCacheIterator(treeWalk, 1);
- Collection<TreeFilter> filters = new ArrayList<TreeFilter>(4);
+ Collection<TreeFilter> filters = new ArrayList<>(4);
if (monitor != null) {
// Get the maximum size of the work tree and index
@@ -518,7 +518,7 @@ public class IndexDiff {
String path = treeWalk.getPathString();
if (path != null) {
if (values == null)
- values = new HashSet<String>();
+ values = new HashSet<>();
values.add(path);
fileModes.put(treeWalk.getFileMode(i), values);
}
@@ -687,7 +687,7 @@ public class IndexDiff {
*/
public Set<String> getAssumeUnchanged() {
if (assumeUnchanged == null) {
- HashSet<String> unchanged = new HashSet<String>();
+ HashSet<String> unchanged = new HashSet<>();
for (int i = 0; i < dirCache.getEntryCount(); i++)
if (dirCache.getEntry(i).isAssumeValid())
unchanged.add(dirCache.getEntry(i).getPathString());
@@ -701,7 +701,7 @@ public class IndexDiff {
*/
public Set<String> getUntrackedFolders() {
return ((indexDiffFilter == null) ? Collections.<String> emptySet()
- : new HashSet<String>(indexDiffFilter.getUntrackedFolders()));
+ : new HashSet<>(indexDiffFilter.getUntrackedFolders()));
}
/**
@@ -727,7 +727,7 @@ public class IndexDiff {
public Set<String> getPathsWithIndexMode(final FileMode mode) {
Set<String> paths = fileModes.get(mode);
if (paths == null)
- paths = new HashSet<String>();
+ paths = new HashSet<>();
return paths;
}
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
index feecbd81c0..9d3aee1508 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
@@ -611,7 +611,7 @@ public class ObjectChecker {
int ptr = 0;
int lastNameB = 0, lastNameE = 0, lastMode = 0;
Set<String> normalized = windows || macosx
- ? new HashSet<String>()
+ ? new HashSet<>()
: null;
while (ptr < sz) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
index b79a02c64d..f39f291899 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
@@ -134,7 +134,7 @@ public abstract class ObjectReader implements AutoCloseable {
Collection<ObjectId> matches = resolve(abbrev);
while (1 < matches.size() && len < Constants.OBJECT_ID_STRING_LENGTH) {
abbrev = objectId.abbreviate(++len);
- List<ObjectId> n = new ArrayList<ObjectId>(8);
+ List<ObjectId> n = new ArrayList<>(8);
for (ObjectId candidate : matches) {
if (abbrev.prefixCompare(candidate) == 0)
n.add(candidate);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java
index 75a3592213..1047a6df99 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java
@@ -89,7 +89,7 @@ public class RebaseTodoFile {
byte[] buf = IO.readFully(new File(repo.getDirectory(), path));
int ptr = 0;
int tokenBegin = 0;
- List<RebaseTodoLine> r = new LinkedList<RebaseTodoLine>();
+ List<RebaseTodoLine> r = new LinkedList<>();
while (ptr < buf.length) {
tokenBegin = ptr;
ptr = RawParseUtils.nextLF(buf, ptr);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java
index 91b0319f4f..95e338685a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java
@@ -73,7 +73,7 @@ public class RefComparator implements Comparator<Ref> {
* @return sorted collection of refs
*/
public static Collection<Ref> sort(final Collection<Ref> refs) {
- final List<Ref> r = new ArrayList<Ref>(refs);
+ final List<Ref> r = new ArrayList<>(refs);
Collections.sort(r, INSTANCE);
return r;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
index 517c8aa538..59a104b60f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
@@ -150,7 +150,7 @@ public abstract class RefDatabase {
lastSlash = name.lastIndexOf('/', lastSlash - 1);
}
- List<String> conflicting = new ArrayList<String>();
+ List<String> conflicting = new ArrayList<>();
// Cannot be the container of an existing reference.
String prefix = name + '/';
for (String existing : allRefs.keySet())
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
index c59224e3ae..e2f6c3c711 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
@@ -1053,7 +1053,7 @@ public abstract class Repository implements AutoCloseable {
try {
return getRefDatabase().getRefs(RefDatabase.ALL);
} catch (IOException e) {
- return new HashMap<String, Ref>();
+ return new HashMap<>();
}
}
@@ -1067,7 +1067,7 @@ public abstract class Repository implements AutoCloseable {
try {
return getRefDatabase().getRefs(Constants.R_TAGS);
} catch (IOException e) {
- return new HashMap<String, Ref>();
+ return new HashMap<>();
}
}
@@ -1102,7 +1102,7 @@ public abstract class Repository implements AutoCloseable {
@NonNull
public Map<AnyObjectId, Set<Ref>> getAllRefsByPeeledObjectId() {
Map<String, Ref> allRefs = getAllRefs();
- Map<AnyObjectId, Set<Ref>> ret = new HashMap<AnyObjectId, Set<Ref>>(allRefs.size());
+ Map<AnyObjectId, Set<Ref>> ret = new HashMap<>(allRefs.size());
for (Ref ref : allRefs.values()) {
ref = peel(ref);
AnyObjectId target = ref.getPeeledObjectId();
@@ -1114,7 +1114,7 @@ public abstract class Repository implements AutoCloseable {
// that was not the case (rare)
if (oset.size() == 1) {
// Was a read-only singleton, we must copy to a new Set
- oset = new HashSet<Ref>(oset);
+ oset = new HashSet<>(oset);
}
ret.put(target, oset);
oset.add(ref);
@@ -1576,7 +1576,7 @@ public abstract class Repository implements AutoCloseable {
if (raw == null)
return null;
- LinkedList<ObjectId> heads = new LinkedList<ObjectId>();
+ LinkedList<ObjectId> heads = new LinkedList<>();
for (int p = 0; p < raw.length;) {
heads.add(ObjectId.fromString(raw, p));
p = RawParseUtils
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
index 2f1a9e1cda..baa5286862 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
@@ -300,7 +300,7 @@ public class RepositoryCache {
}
private Collection<Key> getKeys() {
- return new ArrayList<Key>(cacheMap.keySet());
+ return new ArrayList<>(cacheMap.keySet());
}
private void clearAllExpired() {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java
index 112550a1de..04c65effb8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java
@@ -98,11 +98,11 @@ public final class MergeAlgorithm {
*/
public <S extends Sequence> MergeResult<S> merge(
SequenceComparator<S> cmp, S base, S ours, S theirs) {
- List<S> sequences = new ArrayList<S>(3);
+ List<S> sequences = new ArrayList<>(3);
sequences.add(base);
sequences.add(ours);
sequences.add(theirs);
- MergeResult<S> result = new MergeResult<S>(sequences);
+ MergeResult<S> result = new MergeResult<>(sequences);
if (ours.size() == 0) {
if (theirs.size() != 0) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java
index ee6095aa71..43876a6227 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java
@@ -105,7 +105,7 @@ public class MergeFormatter {
@SuppressWarnings("unchecked")
public void formatMerge(OutputStream out, MergeResult res, String baseName,
String oursName, String theirsName, String charsetName) throws IOException {
- List<String> names = new ArrayList<String>(3);
+ List<String> names = new ArrayList<>(3);
names.add(baseName);
names.add(oursName);
names.add(theirsName);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
index 82cbf368c7..ca0e18a0ef 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
@@ -71,11 +71,11 @@ public class MergeMessageFormatter {
StringBuilder sb = new StringBuilder();
sb.append("Merge "); //$NON-NLS-1$
- List<String> branches = new ArrayList<String>();
- List<String> remoteBranches = new ArrayList<String>();
- List<String> tags = new ArrayList<String>();
- List<String> commits = new ArrayList<String>();
- List<String> others = new ArrayList<String>();
+ List<String> branches = new ArrayList<>();
+ List<String> remoteBranches = new ArrayList<>();
+ List<String> tags = new ArrayList<>();
+ List<String> commits = new ArrayList<>();
+ List<String> others = new ArrayList<>();
for (Ref ref : refsToMerge) {
if (ref.getName().startsWith(Constants.R_HEADS)) {
branches.add("'" + Repository.shortenRefName(ref.getName()) //$NON-NLS-1$
@@ -95,7 +95,7 @@ public class MergeMessageFormatter {
}
}
- List<String> listings = new ArrayList<String>();
+ List<String> listings = new ArrayList<>();
if (!branches.isEmpty())
listings.add(joinNames(branches, "branch", "branches")); //$NON-NLS-1$//$NON-NLS-2$
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java
index c5e615ed87..656480e468 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java
@@ -80,7 +80,7 @@ public abstract class MergeStrategy {
*/
public static final ThreeWayMergeStrategy RECURSIVE = new StrategyRecursive();
- private static final HashMap<String, MergeStrategy> STRATEGIES = new HashMap<String, MergeStrategy>();
+ private static final HashMap<String, MergeStrategy> STRATEGIES = new HashMap<>();
static {
register(OURS);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java
index e0556447ce..f8e1998ed7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java
@@ -147,7 +147,7 @@ public class RecursiveMerger extends ResolveMerger {
*/
protected RevCommit getBaseCommit(RevCommit a, RevCommit b, int callDepth)
throws IOException {
- ArrayList<RevCommit> baseCommits = new ArrayList<RevCommit>();
+ ArrayList<RevCommit> baseCommits = new ArrayList<>();
walk.reset();
walk.setRevFilter(RevFilter.MERGE_BASE);
walk.markStart(a);
@@ -181,7 +181,7 @@ public class RecursiveMerger extends ResolveMerger {
dircache = DirCache.read(reader, currentBase.getTree());
inCore = true;
- List<RevCommit> parents = new ArrayList<RevCommit>();
+ List<RevCommit> parents = new ArrayList<>();
parents.add(currentBase);
for (int commitIdx = 1; commitIdx < baseCommits.size(); commitIdx++) {
RevCommit nextBase = baseCommits.get(commitIdx);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
index fd5e7ef7ba..f667af278a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
@@ -180,14 +180,14 @@ public class ResolveMerger extends ThreeWayMerger {
*
* @since 3.4
*/
- protected List<String> unmergedPaths = new ArrayList<String>();
+ protected List<String> unmergedPaths = new ArrayList<>();
/**
* Files modified during this merge operation.
*
* @since 3.4
*/
- protected List<String> modifiedFiles = new LinkedList<String>();
+ protected List<String> modifiedFiles = new LinkedList<>();
/**
* If the merger has nothing to do for a file but check it out at the end of
@@ -195,7 +195,7 @@ public class ResolveMerger extends ThreeWayMerger {
*
* @since 3.4
*/
- protected Map<String, DirCacheEntry> toBeCheckedOut = new HashMap<String, DirCacheEntry>();
+ protected Map<String, DirCacheEntry> toBeCheckedOut = new HashMap<>();
/**
* Paths in this list will be deleted from the local copy at the end of the
@@ -203,7 +203,7 @@ public class ResolveMerger extends ThreeWayMerger {
*
* @since 3.4
*/
- protected List<String> toBeDeleted = new ArrayList<String>();
+ protected List<String> toBeDeleted = new ArrayList<>();
/**
* Low-level textual merge results. Will be passed on to the callers in case
@@ -211,14 +211,14 @@ public class ResolveMerger extends ThreeWayMerger {
*
* @since 3.4
*/
- protected Map<String, MergeResult<? extends Sequence>> mergeResults = new HashMap<String, MergeResult<? extends Sequence>>();
+ protected Map<String, MergeResult<? extends Sequence>> mergeResults = new HashMap<>();
/**
* Paths for which the merge failed altogether.
*
* @since 3.4
*/
- protected Map<String, MergeFailureReason> failingPaths = new HashMap<String, MergeFailureReason>();
+ protected Map<String, MergeFailureReason> failingPaths = new HashMap<>();
/**
* Updated as we merge entries of the tree walk. Tells us whether we should
@@ -518,7 +518,7 @@ public class ResolveMerger extends ThreeWayMerger {
unmergedPaths.add(tw.getPathString());
mergeResults.put(
tw.getPathString(),
- new MergeResult<RawText>(Collections
+ new MergeResult<>(Collections
.<RawText> emptyList()));
}
return true;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java
index d880d9b616..fd425abf35 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java
@@ -65,7 +65,7 @@ import org.eclipse.jgit.errors.TranslationStringMissingException;
*/
class GlobalBundleCache {
private static final Map<Locale, Map<Class, TranslationBundle>> cachedBundles
- = new HashMap<Locale, Map<Class, TranslationBundle>>();
+ = new HashMap<>();
/**
* Looks up for a translation bundle in the global cache. If found returns
@@ -87,7 +87,7 @@ class GlobalBundleCache {
try {
Map<Class, TranslationBundle> bundles = cachedBundles.get(locale);
if (bundles == null) {
- bundles = new HashMap<Class, TranslationBundle>();
+ bundles = new HashMap<>();
cachedBundles.put(locale, bundles);
}
TranslationBundle bundle = bundles.get(type);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java b/org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java
index 396ad7884d..5e7beed1e5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java
@@ -120,7 +120,7 @@ public class NLS {
}
final private Locale locale;
- final private ConcurrentHashMap<Class, TranslationBundle> map = new ConcurrentHashMap<Class, TranslationBundle>();
+ final private ConcurrentHashMap<Class, TranslationBundle> map = new ConcurrentHashMap<>();
private NLS(Locale locale) {
this.locale = locale;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java
index b104a49842..2c8f34e7cd 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java
@@ -183,7 +183,7 @@ public class CombinedFileHeader extends FileHeader {
protected void parseIndexLine(int ptr, final int eol) {
// "index $asha1,$bsha1..$csha1"
//
- final List<AbbreviatedObjectId> ids = new ArrayList<AbbreviatedObjectId>();
+ final List<AbbreviatedObjectId> ids = new ArrayList<>();
while (ptr < eol) {
final int comma = nextLF(buf, ptr, ',');
if (eol <= comma)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java
index 534c827314..eb28a0e2a3 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java
@@ -305,7 +305,7 @@ public class FileHeader extends DiffEntry {
if (h.getFileHeader() != this)
throw new IllegalArgumentException(JGitText.get().hunkBelongsToAnotherFile);
if (hunks == null)
- hunks = new ArrayList<HunkHeader>();
+ hunks = new ArrayList<>();
hunks.add(h);
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java
index 40ea77e8ec..10ac449d12 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java
@@ -83,8 +83,8 @@ public class Patch {
/** Create an empty patch. */
public Patch() {
- files = new ArrayList<FileHeader>();
- errors = new ArrayList<FormatError>(0);
+ files = new ArrayList<>();
+ errors = new ArrayList<>(0);
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
index 6102a81482..a8eb86e232 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
@@ -74,12 +74,12 @@ public class PlotCommitList<L extends PlotLane> extends
private int positionsAllocated;
- private final TreeSet<Integer> freePositions = new TreeSet<Integer>();
+ private final TreeSet<Integer> freePositions = new TreeSet<>();
- private final HashSet<PlotLane> activeLanes = new HashSet<PlotLane>(32);
+ private final HashSet<PlotLane> activeLanes = new HashSet<>(32);
/** number of (child) commits on a lane */
- private final HashMap<PlotLane, Integer> laneLength = new HashMap<PlotLane, Integer>(
+ private final HashMap<PlotLane, Integer> laneLength = new HashMap<>(
32);
@Override
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java
index bdeb01c3aa..be1f07a38c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java
@@ -107,7 +107,7 @@ public class PlotWalk extends RevWalk {
if (set == null)
set = Collections.singleton(ref);
else {
- set = new HashSet<Ref>(set);
+ set = new HashSet<>(set);
set.add(ref);
}
reverseRefMap.put(ref.getObjectId(), set);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java
index 3609d46e30..5d7e72dd29 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java
@@ -87,7 +87,7 @@ class MergeBaseGenerator extends Generator {
private int recarryMask;
private int mergeBaseAncestor = -1;
- private LinkedList<RevCommit> ret = new LinkedList<RevCommit>();
+ private LinkedList<RevCommit> ret = new LinkedList<>();
MergeBaseGenerator(final RevWalk w) {
walker = w;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java
index f98a7d637e..58689981b5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java
@@ -133,7 +133,7 @@ public class ObjectWalk extends RevWalk {
public ObjectWalk(ObjectReader or) {
super(or);
setRetainBody(false);
- rootObjects = new ArrayList<RevObject>();
+ rootObjects = new ArrayList<>();
pendingObjects = new BlockObjQueue();
objectFilter = ObjectFilter.ALL;
pathBuf = new byte[256];
@@ -682,7 +682,7 @@ public class ObjectWalk extends RevWalk {
for (RevObject obj : rootObjects)
obj.flags &= ~IN_PENDING;
- rootObjects = new ArrayList<RevObject>();
+ rootObjects = new ArrayList<>();
pendingObjects = new BlockObjQueue();
currVisit = null;
freeVisit = null;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java
index 1e91006d47..c641a13311 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java
@@ -565,7 +565,7 @@ public class RevCommit extends RevObject {
ptr--;
final int msgB = RawParseUtils.commitMessage(raw, 0);
- final ArrayList<FooterLine> r = new ArrayList<FooterLine>(4);
+ final ArrayList<FooterLine> r = new ArrayList<>(4);
final Charset enc = guessEncoding();
for (;;) {
ptr = RawParseUtils.prevLF(raw, ptr);
@@ -628,7 +628,7 @@ public class RevCommit extends RevObject {
final List<FooterLine> src = getFooterLines();
if (src.isEmpty())
return Collections.emptyList();
- final ArrayList<String> r = new ArrayList<String>(src.size());
+ final ArrayList<String> r = new ArrayList<>(src.size());
for (final FooterLine f : src) {
if (f.matches(keyName))
r.add(f.getValue());
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java
index 1afdeb610f..bb699e08c4 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java
@@ -61,7 +61,7 @@ public class RevFlagSet extends AbstractSet<RevFlag> {
/** Create an empty set of flags. */
public RevFlagSet() {
- active = new ArrayList<RevFlag>();
+ active = new ArrayList<>();
}
/**
@@ -72,7 +72,7 @@ public class RevFlagSet extends AbstractSet<RevFlag> {
*/
public RevFlagSet(final RevFlagSet s) {
mask = s.mask;
- active = new ArrayList<RevFlag>(s.active);
+ active = new ArrayList<>(s.active);
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java
index 572ebcd2ec..320f05f440 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java
@@ -226,8 +226,8 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable {
private RevWalk(ObjectReader or, boolean closeReader) {
reader = or;
idBuffer = new MutableObjectId();
- objects = new ObjectIdOwnerMap<RevObject>();
- roots = new ArrayList<RevCommit>();
+ objects = new ObjectIdOwnerMap<>();
+ roots = new ArrayList<>();
queue = new DateRevQueue();
pending = new StartGenerator(this);
sorting = EnumSet.of(RevSort.NONE);
@@ -931,8 +931,8 @@ public class RevWalk implements Iterable<RevCommit>, AutoCloseable {
*/
public <T extends ObjectId> AsyncRevObjectQueue parseAny(
Iterable<T> objectIds, boolean reportMissing) {
- List<T> need = new ArrayList<T>();
- List<RevObject> have = new ArrayList<RevObject>();
+ List<T> need = new ArrayList<>();
+ List<RevObject> have = new ArrayList<>();
for (T id : objectIds) {
RevObject r = objects.get(id);
if (r != null && (r.flags & PARSED) != 0)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java
index 11fec31e91..e751d7714c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalkUtils.java
@@ -121,7 +121,7 @@ public final class RevWalkUtils {
if (end != null)
walk.markUninteresting(end);
- List<RevCommit> commits = new ArrayList<RevCommit>();
+ List<RevCommit> commits = new ArrayList<>();
for (RevCommit c : walk)
commits.add(c);
return commits;
@@ -155,7 +155,7 @@ public final class RevWalkUtils {
// Make sure commit is from the same RevWalk
commit = revWalk.parseCommit(commit.getId());
revWalk.reset();
- List<Ref> result = new ArrayList<Ref>();
+ List<Ref> result = new ArrayList<>();
final int SKEW = 24*3600; // one day clock skew
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
index 1aebaddacd..64cb4ddba8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
@@ -120,7 +120,7 @@ public class AmazonS3 {
private static final String X_AMZ_META = "x-amz-meta-"; //$NON-NLS-1$
static {
- SIGNED_HEADERS = new HashSet<String>();
+ SIGNED_HEADERS = new HashSet<>();
SIGNED_HEADERS.add("content-type"); //$NON-NLS-1$
SIGNED_HEADERS.add("content-md5"); //$NON-NLS-1$
SIGNED_HEADERS.add("date"); //$NON-NLS-1$
@@ -606,7 +606,7 @@ public class AmazonS3 {
void authorize(final HttpURLConnection c) throws IOException {
final Map<String, List<String>> reqHdr = c.getRequestProperties();
- final SortedMap<String, String> sigHdr = new TreeMap<String, String>();
+ final SortedMap<String, String> sigHdr = new TreeMap<>();
for (final Map.Entry<String, List<String>> entry : reqHdr.entrySet()) {
final String hdr = entry.getKey();
if (isSignedHeader(hdr))
@@ -664,7 +664,7 @@ public class AmazonS3 {
}
private final class ListParser extends DefaultHandler {
- final List<String> entries = new ArrayList<String>();
+ final List<String> entries = new ArrayList<>();
private final String bucket;
@@ -680,7 +680,7 @@ public class AmazonS3 {
}
void list() throws IOException {
- final Map<String, String> args = new TreeMap<String, String>();
+ final Map<String, String> args = new TreeMap<>();
if (prefix.length() > 0)
args.put("prefix", prefix); //$NON-NLS-1$
if (!entries.isEmpty())
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java
index aa36aeb1be..c69544930d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java
@@ -117,10 +117,10 @@ abstract class BasePackConnection extends BaseConnection {
protected boolean statelessRPC;
/** Capability tokens advertised by the remote side. */
- private final Set<String> remoteCapablities = new HashSet<String>();
+ private final Set<String> remoteCapablities = new HashSet<>();
/** Extra objects the remote has, but which aren't offered as refs. */
- protected final Set<ObjectId> additionalHaves = new HashSet<ObjectId>();
+ protected final Set<ObjectId> additionalHaves = new HashSet<>();
BasePackConnection(final PackTransport packTransport) {
transport = (Transport) packTransport;
@@ -191,7 +191,7 @@ abstract class BasePackConnection extends BaseConnection {
}
private void readAdvertisedRefsImpl() throws IOException {
- final LinkedHashMap<String, Ref> avail = new LinkedHashMap<String, Ref>();
+ final LinkedHashMap<String, Ref> avail = new LinkedHashMap<>();
for (;;) {
String line;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
index 128ec4e28f..e8d18812f6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
@@ -260,7 +260,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection
if (local != null) {
walk = new RevWalk(local);
- reachableCommits = new RevCommitList<RevCommit>();
+ reachableCommits = new RevCommitList<>();
REACHABLE = walk.newFlag("REACHABLE"); //$NON-NLS-1$
COMMON = walk.newFlag("COMMON"); //$NON-NLS-1$
STATE = walk.newFlag("STATE"); //$NON-NLS-1$
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
index bb5922d217..679ea0c8fd 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
@@ -328,8 +328,8 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen
private void writePack(final Map<String, RemoteRefUpdate> refUpdates,
final ProgressMonitor monitor) throws IOException {
- Set<ObjectId> remoteObjects = new HashSet<ObjectId>();
- Set<ObjectId> newObjects = new HashSet<ObjectId>();
+ Set<ObjectId> remoteObjects = new HashSet<>();
+ Set<ObjectId> newObjects = new HashSet<>();
try (final PackWriter writer = new PackWriter(transport.getPackConfig(),
local.newObjectReader())) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
index a7e72f1dea..6f94dbbfec 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
@@ -124,7 +124,7 @@ public abstract class BaseReceivePack {
* line from the client.
*/
public FirstLine(String line) {
- final HashSet<String> caps = new HashSet<String>();
+ final HashSet<String> caps = new HashSet<>();
final int nul = line.indexOf('\0');
if (nul >= 0) {
for (String c : line.substring(nul + 1).split(" ")) //$NON-NLS-1$
@@ -325,8 +325,8 @@ public abstract class BaseReceivePack {
maxDiscardBytes = rc.maxDiscardBytes;
advertiseRefsHook = AdvertiseRefsHook.DEFAULT;
refFilter = RefFilter.DEFAULT;
- advertisedHaves = new HashSet<ObjectId>();
- clientShallowCommits = new HashSet<ObjectId>();
+ advertisedHaves = new HashSet<>();
+ clientShallowCommits = new HashSet<>();
signedPushConfig = rc.signedPush;
}
@@ -1062,8 +1062,8 @@ public abstract class BaseReceivePack {
pckOut = new PacketLineOut(rawOut);
pckOut.setFlushOnEnd(false);
- enabledCapabilities = new HashSet<String>();
- commands = new ArrayList<ReceiveCommand>();
+ enabledCapabilities = new HashSet<>();
+ commands = new ArrayList<>();
}
/** @return advertised refs, or the default if not explicitly advertised. */
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java
index 559c40394c..f37ba01034 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java
@@ -92,7 +92,7 @@ class BundleFetchConnection extends BaseFetchConnection {
InputStream bin;
- final Map<ObjectId, String> prereqs = new HashMap<ObjectId, String>();
+ final Map<ObjectId, String> prereqs = new HashMap<>();
private String lockMessage;
@@ -130,7 +130,7 @@ class BundleFetchConnection extends BaseFetchConnection {
private void readBundleV2() throws IOException {
final byte[] hdrbuf = new byte[1024];
- final LinkedHashMap<String, Ref> avail = new LinkedHashMap<String, Ref>();
+ final LinkedHashMap<String, Ref> avail = new LinkedHashMap<>();
for (;;) {
String line = readLine(hdrbuf);
if (line.length() == 0)
@@ -228,8 +228,8 @@ class BundleFetchConnection extends BaseFetchConnection {
final RevFlag PREREQ = rw.newFlag("PREREQ"); //$NON-NLS-1$
final RevFlag SEEN = rw.newFlag("SEEN"); //$NON-NLS-1$
- final Map<ObjectId, String> missing = new HashMap<ObjectId, String>();
- final List<RevObject> commits = new ArrayList<RevObject>();
+ final Map<ObjectId, String> missing = new HashMap<>();
+ final List<RevObject> commits = new ArrayList<>();
for (final Map.Entry<ObjectId, String> e : prereqs.entrySet()) {
ObjectId p = e.getKey();
try {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java
index ca624c03d5..37d70e3a14 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java
@@ -102,9 +102,9 @@ public class BundleWriter {
*/
public BundleWriter(final Repository repo) {
db = repo;
- include = new TreeMap<String, ObjectId>();
- assume = new HashSet<RevCommit>();
- tagTargets = new HashSet<ObjectId>();
+ include = new TreeMap<>();
+ assume = new HashSet<>();
+ tagTargets = new HashSet<>();
}
/**
@@ -202,8 +202,8 @@ public class BundleWriter {
try (PackWriter packWriter = new PackWriter(pc, db.newObjectReader())) {
packWriter.setObjectCountCallback(callback);
- final HashSet<ObjectId> inc = new HashSet<ObjectId>();
- final HashSet<ObjectId> exc = new HashSet<ObjectId>();
+ final HashSet<ObjectId> inc = new HashSet<>();
+ final HashSet<ObjectId> exc = new HashSet<>();
inc.addAll(include.values());
for (final RevCommit r : assume)
exc.add(r.getId());
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java
index 739ddccc73..8cb3d604cf 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ChainingCredentialsProvider.java
@@ -68,7 +68,7 @@ public class ChainingCredentialsProvider extends CredentialsProvider {
* here
*/
public ChainingCredentialsProvider(CredentialsProvider... providers) {
- this.credentialProviders = new ArrayList<CredentialsProvider>(
+ this.credentialProviders = new ArrayList<>(
Arrays.asList(providers));
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java
index 843f6cc0e5..83586350be 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java
@@ -141,7 +141,7 @@ public class CredentialsProviderUserInfo implements UserInfo,
for (int i = 0; i < prompt.length; i++)
v[i] = new CredentialItem.StringType(prompt[i], !echo[i]);
- List<CredentialItem> items = new ArrayList<CredentialItem>();
+ List<CredentialItem> items = new ArrayList<>();
if (instruction != null && instruction.length() > 0)
items.add(new CredentialItem.InformationalMessage(instruction));
items.addAll(Arrays.asList(v));
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
index 8cb36c7918..280e6d4df7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
@@ -88,18 +88,18 @@ class FetchProcess {
private final Collection<RefSpec> toFetch;
/** Set of refs we will actually wind up asking to obtain. */
- private final HashMap<ObjectId, Ref> askFor = new HashMap<ObjectId, Ref>();
+ private final HashMap<ObjectId, Ref> askFor = new HashMap<>();
/** Objects we know we have locally. */
- private final HashSet<ObjectId> have = new HashSet<ObjectId>();
+ private final HashSet<ObjectId> have = new HashSet<>();
/** Updates to local tracking branches (if any). */
- private final ArrayList<TrackingRefUpdate> localUpdates = new ArrayList<TrackingRefUpdate>();
+ private final ArrayList<TrackingRefUpdate> localUpdates = new ArrayList<>();
/** Records to be recorded into FETCH_HEAD. */
- private final ArrayList<FetchHeadRecord> fetchHeadUpdates = new ArrayList<FetchHeadRecord>();
+ private final ArrayList<FetchHeadRecord> fetchHeadUpdates = new ArrayList<>();
- private final ArrayList<PackLock> packLocks = new ArrayList<PackLock>();
+ private final ArrayList<PackLock> packLocks = new ArrayList<>();
private FetchConnection conn;
@@ -137,7 +137,7 @@ class FetchProcess {
try {
result.setAdvertisedRefs(transport.getURI(), conn.getRefsMap());
result.peerUserAgent = conn.getPeerUserAgent();
- final Set<Ref> matched = new HashSet<Ref>();
+ final Set<Ref> matched = new HashSet<>();
for (final RefSpec spec : toFetch) {
if (spec.getSource() == null)
throw new TransportException(MessageFormat.format(
@@ -275,11 +275,11 @@ class FetchProcess {
// We rebuild our askFor list using only the refs that the
// new connection has offered to us.
//
- final HashMap<ObjectId, Ref> avail = new HashMap<ObjectId, Ref>();
+ final HashMap<ObjectId, Ref> avail = new HashMap<>();
for (final Ref r : conn.getRefs())
avail.put(r.getObjectId(), r);
- final Collection<Ref> wants = new ArrayList<Ref>(askFor.values());
+ final Collection<Ref> wants = new ArrayList<>(askFor.values());
askFor.clear();
for (final Ref want : wants) {
final Ref newRef = avail.get(want.getObjectId());
@@ -369,7 +369,7 @@ class FetchProcess {
}
private Collection<Ref> expandAutoFollowTags() throws TransportException {
- final Collection<Ref> additionalTags = new ArrayList<Ref>();
+ final Collection<Ref> additionalTags = new ArrayList<>();
final Map<String, Ref> haveRefs = localRefs();
for (final Ref r : conn.getRefs()) {
if (!isTag(r))
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java
index 3d95eddc9b..7df997c1e2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java
@@ -59,7 +59,7 @@ public class FetchResult extends OperationResult {
private final List<FetchHeadRecord> forMerge;
FetchResult() {
- forMerge = new ArrayList<FetchHeadRecord>();
+ forMerge = new ArrayList<>();
}
void add(final FetchHeadRecord r) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
index 4256fe47db..c97daa958f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
@@ -348,7 +348,7 @@ abstract class HttpAuthMethod {
@SuppressWarnings("boxing")
@Override
void configureRequest(final HttpConnection conn) throws IOException {
- final Map<String, String> r = new LinkedHashMap<String, String>();
+ final Map<String, String> r = new LinkedHashMap<>();
final String realm = params.get("realm"); //$NON-NLS-1$
final String nonce = params.get("nonce"); //$NON-NLS-1$
@@ -467,7 +467,7 @@ abstract class HttpAuthMethod {
}
private static Map<String, String> parse(String auth) {
- Map<String, String> p = new HashMap<String, String>();
+ Map<String, String> p = new HashMap<>();
int next = 0;
while (next < auth.length()) {
if (next < auth.length() && auth.charAt(next) == ',') {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
index d1cbd8d268..ce14183a56 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
@@ -80,7 +80,7 @@ import com.jcraft.jsch.UserInfo;
* to supply appropriate {@link UserInfo} to the session.
*/
public abstract class JschConfigSessionFactory extends SshSessionFactory {
- private final Map<String, JSch> byIdentityFile = new HashMap<String, JSch>();
+ private final Map<String, JSch> byIdentityFile = new HashMap<>();
private JSch defaultJSch;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/LongMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/LongMap.java
index 88b4b074a3..4d60202a6f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/LongMap.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/LongMap.java
@@ -106,7 +106,7 @@ final class LongMap<V> {
if (++size == growAt)
grow();
- insert(new Node<V>(key, value));
+ insert(new Node<>(key, value));
return null;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/NetRC.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/NetRC.java
index 8855f96567..bab5bf0354 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/NetRC.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/NetRC.java
@@ -125,7 +125,7 @@ public class NetRC {
private long lastModified;
- private Map<String, NetRCEntry> hosts = new HashMap<String, NetRCEntry>();
+ private Map<String, NetRCEntry> hosts = new HashMap<>();
private static final TreeMap<String, State> STATE = new TreeMap<String, NetRC.State>() {
private static final long serialVersionUID = -4285910831814853334L;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java
index 6051f39c01..8b7b60da37 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java
@@ -175,9 +175,9 @@ public class OpenSshConfig {
}
private Map<String, Host> parse(final InputStream in) throws IOException {
- final Map<String, Host> m = new LinkedHashMap<String, Host>();
+ final Map<String, Host> m = new LinkedHashMap<>();
final BufferedReader br = new BufferedReader(new InputStreamReader(in));
- final List<Host> current = new ArrayList<Host>(4);
+ final List<Host> current = new ArrayList<>(4);
String line;
while ((line = br.readLine()) != null) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java
index ad51f3e70c..42317984fe 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java
@@ -64,7 +64,7 @@ public abstract class OperationResult {
URIish uri;
- final SortedMap<String, TrackingRefUpdate> updates = new TreeMap<String, TrackingRefUpdate>();
+ final SortedMap<String, TrackingRefUpdate> updates = new TreeMap<>();
StringBuilder messageBuffer;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java
index 4bbe3f8813..93e7952bdd 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java
@@ -275,7 +275,7 @@ public abstract class PackParser {
*/
public void setNeedNewObjectIds(boolean b) {
if (b)
- newObjectIds = new ObjectIdSubclassMap<ObjectId>();
+ newObjectIds = new ObjectIdSubclassMap<>();
else
newObjectIds = null;
}
@@ -333,14 +333,14 @@ public abstract class PackParser {
public ObjectIdSubclassMap<ObjectId> getNewObjectIds() {
if (newObjectIds != null)
return newObjectIds;
- return new ObjectIdSubclassMap<ObjectId>();
+ return new ObjectIdSubclassMap<>();
}
/** @return set of objects the incoming pack assumed for delta purposes */
public ObjectIdSubclassMap<ObjectId> getBaseObjectIds() {
if (baseObjectIds != null)
return baseObjectIds;
- return new ObjectIdSubclassMap<ObjectId>();
+ return new ObjectIdSubclassMap<>();
}
/**
@@ -527,9 +527,9 @@ public abstract class PackParser {
readPackHeader();
entries = new PackedObjectInfo[(int) objectCount];
- baseById = new ObjectIdOwnerMap<DeltaChain>();
- baseByPos = new LongMap<UnresolvedDelta>();
- deferredCheckBlobs = new BlockList<PackedObjectInfo>();
+ baseById = new ObjectIdOwnerMap<>();
+ baseByPos = new LongMap<>();
+ deferredCheckBlobs = new BlockList<>();
receiving.beginTask(JGitText.get().receivingObjects,
(int) objectCount);
@@ -826,9 +826,9 @@ public abstract class PackParser {
growEntries(baseById.size());
if (needBaseObjectIds)
- baseObjectIds = new ObjectIdSubclassMap<ObjectId>();
+ baseObjectIds = new ObjectIdSubclassMap<>();
- final List<DeltaChain> missing = new ArrayList<DeltaChain>(64);
+ final List<DeltaChain> missing = new ArrayList<>(64);
for (final DeltaChain baseId : baseById) {
if (baseId.head == null)
continue;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java
index 5590c2d256..3201732a98 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java
@@ -124,7 +124,7 @@ class PushProcess {
throws TransportException {
this.walker = new RevWalk(transport.local);
this.transport = transport;
- this.toPush = new HashMap<String, RemoteRefUpdate>();
+ this.toPush = new HashMap<>();
this.out = out;
this.pushOptions = transport.getPushOptions();
for (final RemoteRefUpdate rru : toPush) {
@@ -190,7 +190,7 @@ class PushProcess {
private Map<String, RemoteRefUpdate> prepareRemoteUpdates()
throws TransportException {
boolean atomic = transport.isPushAtomic();
- final Map<String, RemoteRefUpdate> result = new HashMap<String, RemoteRefUpdate>();
+ final Map<String, RemoteRefUpdate> result = new HashMap<>();
for (final RemoteRefUpdate rru : toPush.values()) {
final Ref advertisedRef = connection.getRef(rru.getRemoteName());
ObjectId advertisedOld = null;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
index 0cd720c29d..745e813c41 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
@@ -163,9 +163,9 @@ public abstract class RefAdvertiser {
private final char[] tmpId = new char[Constants.OBJECT_ID_STRING_LENGTH];
- final Set<String> capablities = new LinkedHashSet<String>();
+ final Set<String> capablities = new LinkedHashSet<>();
- private final Set<ObjectId> sent = new HashSet<ObjectId>();
+ private final Set<ObjectId> sent = new HashSet<>();
private Repository repository;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java
index ba0931b9ba..d91684e2f5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java
@@ -114,11 +114,11 @@ public class RemoteConfig implements Serializable {
*/
public static List<RemoteConfig> getAllRemoteConfigs(final Config rc)
throws URISyntaxException {
- final List<String> names = new ArrayList<String>(rc
+ final List<String> names = new ArrayList<>(rc
.getSubsections(SECTION));
Collections.sort(names);
- final List<RemoteConfig> result = new ArrayList<RemoteConfig>(names
+ final List<RemoteConfig> result = new ArrayList<>(names
.size());
for (final String name : names)
result.add(new RemoteConfig(rc, name));
@@ -169,24 +169,24 @@ public class RemoteConfig implements Serializable {
vlst = rc.getStringList(SECTION, name, KEY_URL);
Map<String, String> insteadOf = getReplacements(rc, KEY_INSTEADOF);
- uris = new ArrayList<URIish>(vlst.length);
+ uris = new ArrayList<>(vlst.length);
for (final String s : vlst)
uris.add(new URIish(replaceUri(s, insteadOf)));
Map<String, String> pushInsteadOf = getReplacements(rc,
KEY_PUSHINSTEADOF);
vlst = rc.getStringList(SECTION, name, KEY_PUSHURL);
- pushURIs = new ArrayList<URIish>(vlst.length);
+ pushURIs = new ArrayList<>(vlst.length);
for (final String s : vlst)
pushURIs.add(new URIish(replaceUri(s, pushInsteadOf)));
vlst = rc.getStringList(SECTION, name, KEY_FETCH);
- fetch = new ArrayList<RefSpec>(vlst.length);
+ fetch = new ArrayList<>(vlst.length);
for (final String s : vlst)
fetch.add(new RefSpec(s));
vlst = rc.getStringList(SECTION, name, KEY_PUSH);
- push = new ArrayList<RefSpec>(vlst.length);
+ push = new ArrayList<>(vlst.length);
for (final String s : vlst)
push.add(new RefSpec(s));
@@ -213,7 +213,7 @@ public class RemoteConfig implements Serializable {
* the configuration file to store ourselves into.
*/
public void update(final Config rc) {
- final List<String> vlst = new ArrayList<String>();
+ final List<String> vlst = new ArrayList<>();
vlst.clear();
for (final URIish u : getURIs())
@@ -272,7 +272,7 @@ public class RemoteConfig implements Serializable {
private Map<String, String> getReplacements(final Config config,
final String keyName) {
- final Map<String, String> replacements = new HashMap<String, String>();
+ final Map<String, String> replacements = new HashMap<>();
for (String url : config.getSubsections(KEY_URL))
for (String insteadOf : config.getStringList(KEY_URL, url, keyName))
replacements.put(insteadOf, url);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TestProtocol.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TestProtocol.java
index 5fd2f84b7e..8a28e3a7d7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TestProtocol.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TestProtocol.java
@@ -103,7 +103,7 @@ public class TestProtocol<C> extends TransportProtocol {
ReceivePackFactory<C> receivePackFactory) {
this.uploadPackFactory = uploadPackFactory;
this.receivePackFactory = receivePackFactory;
- this.handles = new HashMap<URIish, Handle>();
+ this.handles = new HashMap<>();
}
@Override
@@ -174,7 +174,7 @@ public class TestProtocol<C> extends TransportProtocol {
public FetchConnection openFetch() throws NotSupportedException,
TransportException {
handle.remote.incrementOpen();
- return new InternalFetchConnection<C>(
+ return new InternalFetchConnection<>(
this, uploadPackFactory, handle.req, handle.remote);
}
@@ -182,7 +182,7 @@ public class TestProtocol<C> extends TransportProtocol {
public PushConnection openPush() throws NotSupportedException,
TransportException {
handle.remote.incrementOpen();
- return new InternalPushConnection<C>(
+ return new InternalPushConnection<>(
this, receivePackFactory, handle.req, handle.remote);
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java
index 5507e9b057..2198b50f0d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java
@@ -210,7 +210,7 @@ public class TransferConfig {
return new RefFilter() {
@Override
public Map<String, Ref> filter(Map<String, Ref> refs) {
- Map<String, Ref> result = new HashMap<String, Ref>();
+ Map<String, Ref> result = new HashMap<>();
for (Map.Entry<String, Ref> e : refs.entrySet()) {
boolean add = true;
for (String hide : hideRefs) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
index 269d11644b..649e840626 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
@@ -109,7 +109,7 @@ public abstract class Transport implements AutoCloseable {
}
private static final List<WeakReference<TransportProtocol>> protocols =
- new CopyOnWriteArrayList<WeakReference<TransportProtocol>>();
+ new CopyOnWriteArrayList<>();
static {
// Registration goes backwards in order of priority.
@@ -226,7 +226,7 @@ public abstract class Transport implements AutoCloseable {
* the protocol definition. Must not be null.
*/
public static void register(TransportProtocol proto) {
- protocols.add(0, new WeakReference<TransportProtocol>(proto));
+ protocols.add(0, new WeakReference<>(proto));
}
/**
@@ -256,7 +256,7 @@ public abstract class Transport implements AutoCloseable {
*/
public static List<TransportProtocol> getTransportProtocols() {
int cnt = protocols.size();
- List<TransportProtocol> res = new ArrayList<TransportProtocol>(cnt);
+ List<TransportProtocol> res = new ArrayList<>(cnt);
for (WeakReference<TransportProtocol> ref : protocols) {
TransportProtocol proto = ref.get();
if (proto != null)
@@ -380,7 +380,7 @@ public abstract class Transport implements AutoCloseable {
TransportException {
final RemoteConfig cfg = new RemoteConfig(local.getConfig(), remote);
if (doesNotExist(cfg)) {
- final ArrayList<Transport> transports = new ArrayList<Transport>(1);
+ final ArrayList<Transport> transports = new ArrayList<>(1);
transports.add(open(local, new URIish(remote), null));
return transports;
}
@@ -490,7 +490,7 @@ public abstract class Transport implements AutoCloseable {
final RemoteConfig cfg, final Operation op)
throws NotSupportedException, TransportException {
final List<URIish> uris = getURIs(cfg, op);
- final List<Transport> transports = new ArrayList<Transport>(uris.size());
+ final List<Transport> transports = new ArrayList<>(uris.size());
for (final URIish uri : uris) {
final Transport tn = open(local, uri, cfg.getName());
tn.applyConfig(cfg);
@@ -629,7 +629,7 @@ public abstract class Transport implements AutoCloseable {
Collection<RefSpec> fetchSpecs) throws IOException {
if (fetchSpecs == null)
fetchSpecs = Collections.emptyList();
- final List<RemoteRefUpdate> result = new LinkedList<RemoteRefUpdate>();
+ final List<RemoteRefUpdate> result = new LinkedList<>();
final Collection<RefSpec> procRefs = expandPushWildcardsFor(db, specs);
for (final RefSpec spec : procRefs) {
@@ -698,7 +698,7 @@ public abstract class Transport implements AutoCloseable {
final Repository db, final Collection<RefSpec> specs)
throws IOException {
final Map<String, Ref> localRefs = db.getRefDatabase().getRefs(ALL);
- final Collection<RefSpec> procRefs = new HashSet<RefSpec>();
+ final Collection<RefSpec> procRefs = new HashSet<>();
for (final RefSpec spec : specs) {
if (spec.isWildcard()) {
@@ -1217,7 +1217,7 @@ public abstract class Transport implements AutoCloseable {
// the local tracking branches without incurring additional
// object transfer overheads.
//
- final Collection<RefSpec> tmp = new ArrayList<RefSpec>(toFetch);
+ final Collection<RefSpec> tmp = new ArrayList<>(toFetch);
for (final RefSpec requested : toFetch) {
final String reqSrc = requested.getSource();
for (final RefSpec configured : fetch) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java
index 74d9e7ff45..6cd119bd2f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java
@@ -270,10 +270,10 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
@Override
Collection<String> getPackNames() throws IOException {
- final HashSet<String> have = new HashSet<String>();
+ final HashSet<String> have = new HashSet<>();
have.addAll(s3.list(bucket, resolveKey("pack"))); //$NON-NLS-1$
- final Collection<String> packs = new ArrayList<String>();
+ final Collection<String> packs = new ArrayList<>();
for (final String n : have) {
if (!n.startsWith("pack-") || !n.endsWith(".pack")) //$NON-NLS-1$ //$NON-NLS-2$
continue;
@@ -312,7 +312,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport {
}
Map<String, Ref> readAdvertisedRefs() throws TransportException {
- final TreeMap<String, Ref> avail = new TreeMap<String, Ref>();
+ final TreeMap<String, Ref> avail = new TreeMap<>();
readPackedRefs(avail);
readLooseRefs(avail);
readRef(avail, Constants.HEAD);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java
index 31d7909d1b..f2ddc0d0d1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java
@@ -66,7 +66,7 @@ class TransportBundleFile extends Transport implements TransportBundle {
private final String[] schemeNames = { "bundle", "file" }; //$NON-NLS-1$ //$NON-NLS-2$
private final Set<String> schemeSet = Collections
- .unmodifiableSet(new LinkedHashSet<String>(Arrays
+ .unmodifiableSet(new LinkedHashSet<>(Arrays
.asList(schemeNames)));
@Override
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
index 49a2042d9b..9a40f47cb7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
@@ -87,7 +87,7 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
private final String[] schemeNames = { "ssh", "ssh+git", "git+ssh" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
private final Set<String> schemeSet = Collections
- .unmodifiableSet(new LinkedHashSet<String>(Arrays
+ .unmodifiableSet(new LinkedHashSet<>(Arrays
.asList(schemeNames)));
@Override
@@ -227,7 +227,7 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
String ssh = SystemReader.getInstance().getenv("GIT_SSH"); //$NON-NLS-1$
boolean putty = ssh.toLowerCase(Locale.ROOT).contains("plink"); //$NON-NLS-1$
- List<String> args = new ArrayList<String>();
+ List<String> args = new ArrayList<>();
args.add(ssh);
if (putty
&& !ssh.toLowerCase(Locale.ROOT).contains("tortoiseplink")) //$NON-NLS-1$
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
index 7c5289293c..26a254d946 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
@@ -154,7 +154,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
private final String[] schemeNames = { "http", "https" }; //$NON-NLS-1$ //$NON-NLS-2$
private final Set<String> schemeSet = Collections
- .unmodifiableSet(new LinkedHashSet<String>(Arrays
+ .unmodifiableSet(new LinkedHashSet<>(Arrays
.asList(schemeNames)));
@Override
@@ -551,7 +551,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
} catch (IOException e) {
if (authMethod.getType() != HttpAuthMethod.Type.NONE) {
if (ignoreTypes == null) {
- ignoreTypes = new HashSet<Type>();
+ ignoreTypes = new HashSet<>();
}
ignoreTypes.add(authMethod.getType());
@@ -726,7 +726,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
@Override
Collection<String> getPackNames() throws IOException {
- final Collection<String> packs = new ArrayList<String>();
+ final Collection<String> packs = new ArrayList<>();
try {
final BufferedReader br = openReader(INFO_PACKS);
try {
@@ -779,7 +779,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
Map<String, Ref> readAdvertisedImpl(final BufferedReader br)
throws IOException, PackProtocolException {
- final TreeMap<String, Ref> avail = new TreeMap<String, Ref>();
+ final TreeMap<String, Ref> avail = new TreeMap<>();
for (;;) {
String line = br.readLine();
if (line == null)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java
index 32582ec48a..f483ec7f9f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java
@@ -191,7 +191,7 @@ class TransportLocal extends Transport implements PackTransport {
return createUploadPack(db);
}
};
- return new InternalFetchConnection<Void>(this, upf, null, openRepo());
+ return new InternalFetchConnection<>(this, upf, null, openRepo());
}
@Override
@@ -207,7 +207,7 @@ class TransportLocal extends Transport implements PackTransport {
return createReceivePack(db);
}
};
- return new InternalPushConnection<Void>(this, rpf, null, openRepo());
+ return new InternalPushConnection<>(this, rpf, null, openRepo());
}
@Override
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
index b99378dc91..c46f94b7da 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
@@ -231,15 +231,15 @@ public class TransportSftp extends SshTransport implements WalkTransport {
@Override
Collection<String> getPackNames() throws IOException {
- final List<String> packs = new ArrayList<String>();
+ final List<String> packs = new ArrayList<>();
try {
@SuppressWarnings("unchecked")
final Collection<ChannelSftp.LsEntry> list = ftp.ls("pack"); //$NON-NLS-1$
final HashMap<String, ChannelSftp.LsEntry> files;
final HashMap<String, Integer> mtimes;
- files = new HashMap<String, ChannelSftp.LsEntry>();
- mtimes = new HashMap<String, Integer>();
+ files = new HashMap<>();
+ mtimes = new HashMap<>();
for (final ChannelSftp.LsEntry ent : list)
files.put(ent.getFilename(), ent);
@@ -388,7 +388,7 @@ public class TransportSftp extends SshTransport implements WalkTransport {
}
Map<String, Ref> readAdvertisedRefs() throws TransportException {
- final TreeMap<String, Ref> avail = new TreeMap<String, Ref>();
+ final TreeMap<String, Ref> avail = new TreeMap<>();
readPackedRefs(avail);
readRef(avail, ROOT_DIR + Constants.HEAD, Constants.HEAD);
readLooseRefs(avail, ROOT_DIR + "refs", "refs/"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
index 3177b32e61..58fdd25745 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
@@ -177,7 +177,7 @@ public class UploadPack {
*/
public FirstLine(String line) {
if (line.length() > 45) {
- final HashSet<String> opts = new HashSet<String>();
+ final HashSet<String> opts = new HashSet<>();
String opt = line.substring(45);
if (opt.startsWith(" ")) //$NON-NLS-1$
opt = opt.substring(1);
@@ -263,19 +263,19 @@ public class UploadPack {
String userAgent;
/** Raw ObjectIds the client has asked for, before validating them. */
- private final Set<ObjectId> wantIds = new HashSet<ObjectId>();
+ private final Set<ObjectId> wantIds = new HashSet<>();
/** Objects the client wants to obtain. */
- private final Set<RevObject> wantAll = new HashSet<RevObject>();
+ private final Set<RevObject> wantAll = new HashSet<>();
/** Objects on both sides, these don't have to be sent. */
- private final Set<RevObject> commonBase = new HashSet<RevObject>();
+ private final Set<RevObject> commonBase = new HashSet<>();
/** Shallow commits the client already has. */
- private final Set<ObjectId> clientShallowCommits = new HashSet<ObjectId>();
+ private final Set<ObjectId> clientShallowCommits = new HashSet<>();
/** Shallow commits on the client which are now becoming unshallow */
- private final List<ObjectId> unshallowCommits = new ArrayList<ObjectId>();
+ private final List<ObjectId> unshallowCommits = new ArrayList<>();
/** Desired depth from the client on a shallow request. */
private int depth;
@@ -776,7 +776,7 @@ public class UploadPack {
}
private static Set<ObjectId> refIdSet(Collection<Ref> refs) {
- Set<ObjectId> ids = new HashSet<ObjectId>(refs.size());
+ Set<ObjectId> ids = new HashSet<>(refs.size());
for (Ref ref : refs) {
ObjectId id = ref.getObjectId();
if (id != null) {
@@ -1018,7 +1018,7 @@ public class UploadPack {
okToGiveUp = Boolean.FALSE;
ObjectId last = ObjectId.zeroId();
- List<ObjectId> peerHas = new ArrayList<ObjectId>(64);
+ List<ObjectId> peerHas = new ArrayList<>(64);
for (;;) {
String line;
try {
@@ -1172,7 +1172,7 @@ public class UploadPack {
for (ObjectId obj : wantIds) {
if (!advertised.contains(obj)) {
if (notAdvertisedWants == null)
- notAdvertisedWants = new ArrayList<ObjectId>();
+ notAdvertisedWants = new ArrayList<>();
notAdvertisedWants.add(obj);
}
}
@@ -1488,7 +1488,7 @@ public class UploadPack {
pw.setReuseValidatingObjects(false);
if (commonBase.isEmpty() && refs != null) {
- Set<ObjectId> tagTargets = new HashSet<ObjectId>();
+ Set<ObjectId> tagTargets = new HashSet<>();
for (Ref ref : refs.values()) {
if (ref.getPeeledObjectId() != null)
tagTargets.add(ref.getPeeledObjectId());
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
index 0319d93865..3d60aedcca 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
@@ -197,20 +197,20 @@ class WalkFetchConnection extends BaseFetchConnection {
inserter = local.newObjectInserter();
reader = inserter.newReader();
- remotes = new ArrayList<WalkRemoteObjectDatabase>();
+ remotes = new ArrayList<>();
remotes.add(w);
- unfetchedPacks = new LinkedList<RemotePack>();
- packsConsidered = new HashSet<String>();
+ unfetchedPacks = new LinkedList<>();
+ packsConsidered = new HashSet<>();
- noPacksYet = new LinkedList<WalkRemoteObjectDatabase>();
+ noPacksYet = new LinkedList<>();
noPacksYet.add(w);
- noAlternatesYet = new LinkedList<WalkRemoteObjectDatabase>();
+ noAlternatesYet = new LinkedList<>();
noAlternatesYet.add(w);
- fetchErrors = new HashMap<ObjectId, List<Throwable>>();
- packLocks = new ArrayList<PackLock>(4);
+ fetchErrors = new HashMap<>();
+ packLocks = new ArrayList<>(4);
revWalk = new RevWalk(reader);
revWalk.setRetainBody(false);
@@ -220,7 +220,7 @@ class WalkFetchConnection extends BaseFetchConnection {
LOCALLY_SEEN = revWalk.newFlag("LOCALLY_SEEN"); //$NON-NLS-1$
localCommitQueue = new DateRevQueue();
- workQueue = new LinkedList<ObjectId>();
+ workQueue = new LinkedList<>();
}
@Override
@@ -273,7 +273,7 @@ class WalkFetchConnection extends BaseFetchConnection {
private void queueWants(final Collection<Ref> want)
throws TransportException {
- final HashSet<ObjectId> inWorkQueue = new HashSet<ObjectId>();
+ final HashSet<ObjectId> inWorkQueue = new HashSet<>();
for (final Ref r : want) {
final ObjectId id = r.getObjectId();
if (id == null) {
@@ -597,7 +597,7 @@ class WalkFetchConnection extends BaseFetchConnection {
private Iterator<ObjectId> swapFetchQueue() {
final Iterator<ObjectId> r = workQueue.iterator();
- workQueue = new LinkedList<ObjectId>();
+ workQueue = new LinkedList<>();
return r;
}
@@ -794,7 +794,7 @@ class WalkFetchConnection extends BaseFetchConnection {
final ObjectId objId = id.copy();
List<Throwable> errors = fetchErrors.get(objId);
if (errors == null) {
- errors = new ArrayList<Throwable>(2);
+ errors = new ArrayList<>(2);
fetchErrors.put(objId, errors);
}
errors.add(what);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
index 39f11f96e3..5c4e14ca31 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
@@ -147,14 +147,14 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
throws TransportException {
markStartedOperation();
packNames = null;
- newRefs = new TreeMap<String, Ref>(getRefsMap());
- packedRefUpdates = new ArrayList<RemoteRefUpdate>(refUpdates.size());
+ newRefs = new TreeMap<>(getRefsMap());
+ packedRefUpdates = new ArrayList<>(refUpdates.size());
// Filter the commands and issue all deletes first. This way we
// can correctly handle a directory being cleared out and a new
// ref using the directory name being created.
//
- final List<RemoteRefUpdate> updates = new ArrayList<RemoteRefUpdate>();
+ final List<RemoteRefUpdate> updates = new ArrayList<>();
for (final RemoteRefUpdate u : refUpdates.values()) {
final String n = u.getRemoteName();
if (!n.startsWith("refs/") || !Repository.isValidRefName(n)) { //$NON-NLS-1$
@@ -225,8 +225,8 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
try (final PackWriter writer = new PackWriter(transport.getPackConfig(),
local.newObjectReader())) {
- final Set<ObjectId> need = new HashSet<ObjectId>();
- final Set<ObjectId> have = new HashSet<ObjectId>();
+ final Set<ObjectId> need = new HashSet<>();
+ final Set<ObjectId> have = new HashSet<>();
for (final RemoteRefUpdate r : updates)
need.add(r.getNewObjectId());
for (final Ref r : getRefs()) {
@@ -243,7 +243,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
if (writer.getObjectCount() == 0)
return;
- packNames = new LinkedHashMap<String, String>();
+ packNames = new LinkedHashMap<>();
for (final String n : dest.getPackNames())
packNames.put(n, n);
@@ -279,7 +279,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
// way clients are likely to consult the newest pack first,
// and discover the most recent objects there.
//
- final ArrayList<String> infoPacks = new ArrayList<String>();
+ final ArrayList<String> infoPacks = new ArrayList<>();
infoPacks.add(packName);
infoPacks.addAll(packNames.keySet());
dest.writeInfoPacks(infoPacks);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java
index 24f30ed206..17f8c3ec19 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java
@@ -396,7 +396,7 @@ abstract class WalkRemoteObjectDatabase {
throws IOException {
final BufferedReader br = openReader(listPath);
try {
- final Collection<WalkRemoteObjectDatabase> alts = new ArrayList<WalkRemoteObjectDatabase>();
+ final Collection<WalkRemoteObjectDatabase> alts = new ArrayList<>();
for (;;) {
String line = br.readLine();
if (line == null)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/FileResolver.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/FileResolver.java
index 44d90aba00..7654d462eb 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/FileResolver.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/FileResolver.java
@@ -72,8 +72,8 @@ public class FileResolver<C> implements RepositoryResolver<C> {
/** Initialize an empty file based resolver. */
public FileResolver() {
- exports = new ConcurrentHashMap<String, Repository>();
- exportBase = new CopyOnWriteArrayList<File>();
+ exports = new ConcurrentHashMap<>();
+ exportBase = new CopyOnWriteArrayList<>();
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
index 01156c338d..1ed9468159 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
@@ -128,7 +128,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider {
* The filter command as defined in gitattributes. The keys are
* filterName+"."+filterCommandType. E.g. "lfs.clean"
*/
- private Map<String, String> filterCommandsByNameDotType = new HashMap<String, String>();
+ private Map<String, String> filterCommandsByNameDotType = new HashMap<>();
/**
* @param operationType
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
index 4eb530e981..0d3c788886 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
@@ -1368,7 +1368,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
cmd = state.walk
.getFilterCommand(Constants.ATTR_FILTER_TYPE_CLEAN);
}
- cleanFilterCommandHolder = new Holder<String>(cmd);
+ cleanFilterCommandHolder = new Holder<>(cmd);
}
return cleanFilterCommandHolder.get();
}
@@ -1415,7 +1415,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
break;
}
}
- eolStreamTypeHolder = new Holder<EolStreamType>(type);
+ eolStreamTypeHolder = new Holder<>(type);
}
return eolStreamTypeHolder.get();
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java
index 42725bc767..b821a16471 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java
@@ -86,11 +86,11 @@ public class IndexDiffFilter extends TreeFilter {
private final boolean honorIgnores;
- private final Set<String> ignoredPaths = new HashSet<String>();
+ private final Set<String> ignoredPaths = new HashSet<>();
- private final LinkedList<String> untrackedParentFolders = new LinkedList<String>();
+ private final LinkedList<String> untrackedParentFolders = new LinkedList<>();
- private final LinkedList<String> untrackedFolders = new LinkedList<String>();
+ private final LinkedList<String> untrackedFolders = new LinkedList<>();
/**
* Creates a new instance of this filter. Do not use an instance of this
@@ -292,7 +292,7 @@ public class IndexDiffFilter extends TreeFilter {
* empty list will be returned.
*/
public List<String> getUntrackedFolders() {
- LinkedList<String> ret = new LinkedList<String>(untrackedFolders);
+ LinkedList<String> ret = new LinkedList<>(untrackedFolders);
if (!untrackedParentFolders.isEmpty()) {
String toBeAdded = untrackedParentFolders.getLast();
while (!ret.isEmpty() && ret.getLast().startsWith(toBeAdded))
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java
index 6828185a8a..8677c690fb 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java
@@ -51,7 +51,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
/** Abstract authenticator which remembers prior authentications. */
public abstract class CachedAuthenticator extends Authenticator {
- private static final Collection<CachedAuthentication> cached = new CopyOnWriteArrayList<CachedAuthentication>();
+ private static final Collection<CachedAuthentication> cached = new CopyOnWriteArrayList<>();
/**
* Add a cached authentication for future use.
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
index f189b3586b..68b71309b1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
@@ -375,7 +375,7 @@ public abstract class FS {
public File userHome() {
Holder<File> p = userHome;
if (p == null) {
- p = new Holder<File>(userHomeImpl());
+ p = new Holder<>(userHomeImpl());
userHome = p;
}
return p.value;
@@ -390,7 +390,7 @@ public abstract class FS {
* @return {@code this}.
*/
public FS setUserHome(File path) {
- userHome = new Holder<File>(path);
+ userHome = new Holder<>(path);
return this;
}
@@ -650,7 +650,7 @@ public abstract class FS {
*/
public File getGitSystemConfig() {
if (gitSystemConfig == null) {
- gitSystemConfig = new Holder<File>(discoverGitSystemConfig());
+ gitSystemConfig = new Holder<>(discoverGitSystemConfig());
}
return gitSystemConfig.value;
}
@@ -664,7 +664,7 @@ public abstract class FS {
* @since 4.0
*/
public FS setGitSystemConfig(File configFile) {
- gitSystemConfig = new Holder<File>(configFile);
+ gitSystemConfig = new Holder<>(configFile);
return this;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
index cb4868cc7a..0780d2b560 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
@@ -225,7 +225,7 @@ public class FS_POSIX extends FS {
@Override
public ProcessBuilder runInShell(String cmd, String[] args) {
- List<String> argv = new ArrayList<String>(4 + args.length);
+ List<String> argv = new ArrayList<>(4 + args.length);
argv.add("sh"); //$NON-NLS-1$
argv.add("-c"); //$NON-NLS-1$
argv.add(cmd + " \"$@\""); //$NON-NLS-1$
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java
index dffd665691..060292160e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java
@@ -162,7 +162,7 @@ public class FS_Win32 extends FS {
@Override
public ProcessBuilder runInShell(String cmd, String[] args) {
- List<String> argv = new ArrayList<String>(3 + args.length);
+ List<String> argv = new ArrayList<>(3 + args.length);
argv.add("cmd.exe"); //$NON-NLS-1$
argv.add("/c"); //$NON-NLS-1$
argv.add(cmd);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java
index e62083e9c5..545cc0119e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32_Cygwin.java
@@ -148,7 +148,7 @@ public class FS_Win32_Cygwin extends FS_Win32 {
@Override
public ProcessBuilder runInShell(String cmd, String[] args) {
- List<String> argv = new ArrayList<String>(4 + args.length);
+ List<String> argv = new ArrayList<>(4 + args.length);
argv.add("sh.exe"); //$NON-NLS-1$
argv.add("-c"); //$NON-NLS-1$
argv.add(cmd + " \"$@\""); //$NON-NLS-1$
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java
index 1f1d15b324..1f20e9700d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java
@@ -151,8 +151,8 @@ public class FileUtils {
if ((options & RECURSIVE) != 0 && fs.isDirectory(f)) {
final File[] items = f.listFiles();
if (items != null) {
- List<File> files = new ArrayList<File>();
- List<File> dirs = new ArrayList<File>();
+ List<File> files = new ArrayList<>();
+ List<File> dirs = new ArrayList<>();
for (File c : items)
if (c.isFile())
files.add(c);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java
index 4aafa3a2c4..da78008a0b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java
@@ -77,7 +77,7 @@ public class GitDateParser {
@Override
protected Map<Locale, Map<ParseableSimpleDateFormat, SimpleDateFormat>> initialValue() {
- return new HashMap<Locale, Map<ParseableSimpleDateFormat, SimpleDateFormat>>();
+ return new HashMap<>();
}
};
@@ -91,7 +91,7 @@ public class GitDateParser {
Map<ParseableSimpleDateFormat, SimpleDateFormat> map = cache
.get(locale);
if (map == null) {
- map = new HashMap<ParseableSimpleDateFormat, SimpleDateFormat>();
+ map = new HashMap<>();
cache.put(locale, map);
return getNewSimpleDateFormat(f, locale, map);
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java
index 0d283fde63..6cff76cc21 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java
@@ -344,7 +344,7 @@ public class IO {
* @since 2.0
*/
public static List<String> readLines(final String s) {
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java
index 96c1a89f2b..159781795e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java
@@ -68,7 +68,7 @@ import org.eclipse.jgit.lib.RefComparator;
* the type of reference being stored in the collection.
*/
public class RefList<T extends Ref> implements Iterable<Ref> {
- private static final RefList<Ref> EMPTY = new RefList<Ref>(new Ref[0], 0);
+ private static final RefList<Ref> EMPTY = new RefList<>(new Ref[0], 0);
/**
* @return an empty unmodifiable reference list.
@@ -213,7 +213,7 @@ public class RefList<T extends Ref> implements Iterable<Ref> {
* @return a new builder with the first {@code n} elements already added.
*/
public final Builder<T> copy(int n) {
- Builder<T> r = new Builder<T>(Math.max(16, n));
+ Builder<T> r = new Builder<>(Math.max(16, n));
r.addAll(list, 0, n);
return r;
}
@@ -234,7 +234,7 @@ public class RefList<T extends Ref> implements Iterable<Ref> {
Ref[] newList = new Ref[cnt];
System.arraycopy(list, 0, newList, 0, cnt);
newList[idx] = ref;
- return new RefList<T>(newList, cnt);
+ return new RefList<>(newList, cnt);
}
/**
@@ -261,7 +261,7 @@ public class RefList<T extends Ref> implements Iterable<Ref> {
newList[idx] = ref;
if (idx < cnt)
System.arraycopy(list, idx, newList, idx + 1, cnt - idx);
- return new RefList<T>(newList, cnt + 1);
+ return new RefList<>(newList, cnt + 1);
}
/**
@@ -282,7 +282,7 @@ public class RefList<T extends Ref> implements Iterable<Ref> {
System.arraycopy(list, 0, newList, 0, idx);
if (idx + 1 < cnt)
System.arraycopy(list, idx + 1, newList, idx, cnt - (idx + 1));
- return new RefList<T>(newList, cnt - 1);
+ return new RefList<>(newList, cnt - 1);
}
/**
@@ -431,7 +431,7 @@ public class RefList<T extends Ref> implements Iterable<Ref> {
/** @return an unmodifiable list using this collection's backing array. */
public RefList<T> toRefList() {
- return new RefList<T>(list, size);
+ return new RefList<>(list, size);
}
@Override
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java
index 9509db0db2..e3f1916f43 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java
@@ -325,7 +325,7 @@ public abstract class TemporaryBuffer extends OutputStream {
if (blocks != null)
blocks.clear();
else
- blocks = new ArrayList<Block>(initialBlocks);
+ blocks = new ArrayList<>(initialBlocks);
blocks.add(new Block(Math.min(inCoreLimit, Block.SZ)));
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java
index 0319afd5ad..1c46310ef5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/UnionInputStream.java
@@ -67,7 +67,7 @@ public class UnionInputStream extends InputStream {
}
};
- private final LinkedList<InputStream> streams = new LinkedList<InputStream>();
+ private final LinkedList<InputStream> streams = new LinkedList<>();
/** Create an empty InputStream that is currently at EOF state. */
public UnionInputStream() {