From 6d370d837c5faa7caff2e6e3e4723b887f2fbdca Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 14 May 2018 18:42:02 +0200 Subject: [PATCH] Remove 'final' in parameter lists Change-Id: Id924f79c8b2c720297ebc49bf9c5d4ddd6d52547 Signed-off-by: Han-Wen Nienhuys --- .../http/apache/HttpClientConnection.java | 2 +- .../eclipse/jgit/http/server/FileSender.java | 2 +- .../eclipse/jgit/http/server/GitServlet.java | 2 +- .../jgit/http/server/InfoPacksServlet.java | 2 +- .../jgit/http/server/InfoRefsServlet.java | 2 +- .../jgit/http/server/IsLocalFilter.java | 2 +- .../jgit/http/server/ObjectFileServlet.java | 2 +- .../jgit/http/server/RepositoryFilter.java | 4 +- .../jgit/http/server/ServletUtils.java | 8 +-- .../jgit/http/server/TextFileServlet.java | 2 +- .../jgit/http/server/glue/ErrorServlet.java | 2 +- .../http/server/glue/RegexGroupFilter.java | 4 +- .../resolver/DefaultReceivePackFactory.java | 2 +- .../resolver/DefaultUploadPackFactory.java | 2 +- .../jgit/http/test/HttpClientTests.java | 6 +- .../eclipse/jgit/junit/http/AccessEvent.java | 4 +- .../jgit/junit/http/RecordingLogger.java | 2 +- .../jgit/junit/http/SimpleHttpServer.java | 4 +- .../org/eclipse/jgit/junit/JGitTestUtil.java | 10 ++-- .../junit/LocalDiskRepositoryTestCase.java | 10 ++-- .../eclipse/jgit/junit/MockSystemReader.java | 4 +- .../jgit/junit/RepositoryTestCase.java | 16 +++--- .../eclipse/jgit/junit/TestRepository.java | 28 +++++----- .../src/org/eclipse/jgit/junit/TestRng.java | 4 +- .../jgit/lfs/server/fs/FileLfsRepository.java | 2 +- .../jgit/lfs/lib/AbbreviatedLongObjectId.java | 14 ++--- .../eclipse/jgit/lfs/lib/AnyLongObjectId.java | 36 ++++++------ .../eclipse/jgit/lfs/lib/LongObjectId.java | 20 +++---- .../jgit/lfs/lib/MutableLongObjectId.java | 14 ++--- .../jgit/lib/CLIRepositoryTestCase.java | 6 +- .../tst/org/eclipse/jgit/pgm/ArchiveTest.java | 2 +- .../jgit/pgm/AbstractFetchCommand.java | 4 +- .../src/org/eclipse/jgit/pgm/Branch.java | 4 +- .../org/eclipse/jgit/pgm/CommandCatalog.java | 10 ++-- .../src/org/eclipse/jgit/pgm/CommandRef.java | 4 +- .../src/org/eclipse/jgit/pgm/Die.java | 6 +- .../src/org/eclipse/jgit/pgm/Diff.java | 2 +- .../src/org/eclipse/jgit/pgm/Glog.java | 4 +- .../src/org/eclipse/jgit/pgm/Log.java | 4 +- .../src/org/eclipse/jgit/pgm/LsRemote.java | 2 +- .../src/org/eclipse/jgit/pgm/Main.java | 8 +-- .../src/org/eclipse/jgit/pgm/Remote.java | 2 +- .../src/org/eclipse/jgit/pgm/RevList.java | 4 +- .../eclipse/jgit/pgm/RevWalkTextBuiltin.java | 4 +- .../src/org/eclipse/jgit/pgm/Show.java | 4 +- .../src/org/eclipse/jgit/pgm/ShowRef.java | 2 +- .../src/org/eclipse/jgit/pgm/TextBuiltin.java | 16 +++--- .../eclipse/jgit/pgm/debug/MakeCacheTree.java | 2 +- .../jgit/pgm/debug/RebuildCommitGraph.java | 2 +- .../eclipse/jgit/pgm/debug/ShowCacheTree.java | 2 +- .../jgit/pgm/debug/TextHashFunctions.java | 2 +- .../pgm/opt/AbstractTreeIteratorHandler.java | 2 +- .../eclipse/jgit/pgm/opt/CmdLineParser.java | 8 +-- .../eclipse/jgit/pgm/opt/ObjectIdHandler.java | 2 +- .../jgit/pgm/opt/PathTreeFilterHandler.java | 2 +- .../eclipse/jgit/pgm/opt/RefSpecHandler.java | 2 +- .../jgit/pgm/opt/RevCommitHandler.java | 4 +- .../eclipse/jgit/pgm/opt/RevTreeHandler.java | 2 +- .../jgit/pgm/opt/SubcommandHandler.java | 2 +- .../jgit/patch/EGitPatchHistoryTest.java | 2 +- .../eclipse/jgit/api/ApplyCommandTest.java | 6 +- .../eclipse/jgit/api/BlameCommandTest.java | 2 +- .../jgit/api/CherryPickCommandTest.java | 2 +- .../eclipse/jgit/api/MergeCommandTest.java | 2 +- .../org/eclipse/jgit/api/PushCommandTest.java | 2 +- .../eclipse/jgit/api/RevertCommandTest.java | 2 +- .../jgit/api/StashCreateCommandTest.java | 8 +-- .../jgit/diff/DiffFormatterReflowTest.java | 8 +-- .../DirCacheCGitCompatabilityTest.java | 2 +- .../jgit/dircache/DirCacheEntryTest.java | 2 +- .../jgit/dircache/DirCacheLargePathTest.java | 4 +- .../storage/file/ConcurrentRepackTest.java | 14 ++--- .../internal/storage/file/PackFileTest.java | 2 +- .../internal/storage/file/PackWriterTest.java | 8 +-- .../internal/storage/file/RefUpdateTest.java | 4 +- .../storage/file/T0003_BasicTest.java | 4 +- .../storage/file/WindowCacheGetTest.java | 2 +- .../storage/reftree/RefTreeDatabaseTest.java | 4 +- .../eclipse/jgit/lib/BranchConfigTest.java | 2 +- .../tst/org/eclipse/jgit/lib/ConfigTest.java | 4 +- .../eclipse/jgit/lib/ObjectCheckerTest.java | 4 +- .../eclipse/jgit/lib/ValidRefNameTest.java | 4 +- .../eclipse/jgit/merge/CherryPickTest.java | 2 +- .../jgit/merge/CrissCrossMergeTest.java | 2 +- .../eclipse/jgit/merge/SimpleMergeTest.java | 2 +- .../org/eclipse/jgit/patch/EditListTest.java | 2 +- .../eclipse/jgit/patch/FileHeaderTest.java | 12 ++-- .../org/eclipse/jgit/patch/GetTextTest.java | 2 +- .../eclipse/jgit/revwalk/FooterLineTest.java | 2 +- .../jgit/revwalk/RevCommitParseTest.java | 4 +- .../eclipse/jgit/revwalk/RevTagParseTest.java | 6 +- .../jgit/revwalk/RevWalkFollowFilterTest.java | 2 +- .../jgit/revwalk/RevWalkPathFilter1Test.java | 2 +- .../revwalk/RevWalkPathFilter6012Test.java | 4 +- .../eclipse/jgit/revwalk/RevWalkTestCase.java | 26 ++++----- .../revwalk/RevWalkUtilsReachableTest.java | 2 +- .../org/eclipse/jgit/transport/NetRCTest.java | 2 +- .../jgit/transport/OpenSshConfigTest.java | 2 +- .../jgit/transport/PacketLineInTest.java | 2 +- .../jgit/transport/PacketLineOutTest.java | 2 +- .../jgit/transport/RemoteConfigTest.java | 4 +- .../transport/SideBandOutputStreamTest.java | 2 +- .../treewalk/CanonicalTreeParserTest.java | 2 +- .../jgit/treewalk/FileTreeIteratorTest.java | 2 +- .../FileTreeIteratorWithTimeControl.java | 2 +- .../jgit/treewalk/PostOrderTreeWalkTest.java | 2 +- .../filter/AlwaysCloneTreeFilter.java | 2 +- .../eclipse/jgit/util/ChangeIdUtilTest.java | 6 +- .../tst/org/eclipse/jgit/util/HookTest.java | 2 +- .../tst/org/eclipse/jgit/util/NBTest.java | 8 +-- .../util/QuotedStringBourneStyleTest.java | 4 +- .../QuotedStringBourneUserPathStyleTest.java | 4 +- .../util/QuotedStringGitPathStyleTest.java | 4 +- .../jgit/util/RawParseUtils_HexParseTest.java | 2 +- .../org/eclipse/jgit/util/RefListTest.java | 2 +- .../eclipse/jgit/awtui/AWTPlotRenderer.java | 4 +- .../eclipse/jgit/awtui/CommitGraphPane.java | 6 +- .../eclipse/jgit/awtui/SwingCommitList.java | 2 +- .../eclipse/jgit/api/CherryPickCommand.java | 2 +- .../org/eclipse/jgit/api/CloneCommand.java | 4 +- .../org/eclipse/jgit/api/ResetCommand.java | 2 +- .../eclipse/jgit/api/StashApplyCommand.java | 4 +- .../eclipse/jgit/api/StashDropCommand.java | 8 +-- .../eclipse/jgit/api/StashListCommand.java | 2 +- .../eclipse/jgit/api/SubmoduleAddCommand.java | 8 +-- .../jgit/api/SubmoduleInitCommand.java | 4 +- .../jgit/api/SubmoduleStatusCommand.java | 4 +- .../jgit/api/SubmoduleSyncCommand.java | 6 +- .../jgit/api/SubmoduleUpdateCommand.java | 6 +- .../eclipse/jgit/api/TransportCommand.java | 6 +- .../api/errors/AbortedByHookException.java | 0 .../errors/StashApplyFailureException.java | 2 +- .../src/org/eclipse/jgit/diff/DiffConfig.java | 2 +- .../org/eclipse/jgit/diff/DiffFormatter.java | 26 ++++----- .../src/org/eclipse/jgit/diff/Edit.java | 6 +- .../eclipse/jgit/diff/HistogramDiffIndex.java | 4 +- .../eclipse/jgit/diff/RawTextComparator.java | 8 +-- .../jgit/dircache/BaseDirCacheEditor.java | 6 +- .../org/eclipse/jgit/dircache/DirCache.java | 30 +++++----- .../jgit/dircache/DirCacheBuildIterator.java | 4 +- .../jgit/dircache/DirCacheBuilder.java | 8 +-- .../eclipse/jgit/dircache/DirCacheEditor.java | 18 +++--- .../eclipse/jgit/dircache/DirCacheEntry.java | 32 +++++------ .../jgit/dircache/DirCacheIterator.java | 4 +- .../eclipse/jgit/dircache/DirCacheTree.java | 14 ++--- .../jgit/errors/CompoundException.java | 4 +- .../jgit/errors/ConfigInvalidException.java | 4 +- .../jgit/errors/EntryExistsException.java | 2 +- .../errors/IllegalTodoFileModification.java | 2 +- .../errors/IncorrectObjectTypeException.java | 4 +- .../jgit/errors/IndexReadException.java | 4 +- .../jgit/errors/IndexWriteException.java | 4 +- .../MissingBundlePrerequisiteException.java | 2 +- .../jgit/errors/MissingObjectException.java | 6 +- .../jgit/errors/NoPackSignatureException.java | 2 +- .../errors/NoRemoteRepositoryException.java | 2 +- .../jgit/errors/NotSupportedException.java | 4 +- .../jgit/errors/ObjectWritingException.java | 4 +- .../jgit/errors/PackInvalidException.java | 4 +- .../jgit/errors/PackMismatchException.java | 2 +- .../jgit/errors/PackProtocolException.java | 6 +- .../errors/RepositoryNotFoundException.java | 8 +-- .../eclipse/jgit/errors/RevWalkException.java | 2 +- .../errors/SymlinksNotSupportedException.java | 2 +- .../jgit/errors/TransportException.java | 6 +- .../jgit/errors/UnmergedPathException.java | 2 +- .../errors/UnsupportedCredentialItem.java | 2 +- .../UnsupportedPackIndexVersionException.java | 2 +- .../UnsupportedPackVersionException.java | 2 +- .../eclipse/jgit/fnmatch/CharacterHead.java | 4 +- .../eclipse/jgit/fnmatch/FileNameMatcher.java | 6 +- .../org/eclipse/jgit/fnmatch/GroupHead.java | 2 +- .../jgit/fnmatch/RestrictedWildCardHead.java | 2 +- .../eclipse/jgit/fnmatch/WildCardHead.java | 2 +- .../org/eclipse/jgit/gitrepo/RepoCommand.java | 6 +- .../jgit/internal/ketch/KetchSystem.java | 2 +- .../jgit/internal/ketch/LocalReplica.java | 2 +- .../jgit/internal/ketch/RemoteGitReplica.java | 2 +- .../internal/storage/dfs/DfsBlockCache.java | 4 +- .../storage/dfs/DfsBlockCacheConfig.java | 6 +- .../internal/storage/dfs/DfsInserter.java | 2 +- .../storage/dfs/DfsReaderOptions.java | 2 +- .../storage/file/ByteArrayWindow.java | 4 +- .../storage/file/ByteBufferWindow.java | 4 +- .../internal/storage/file/ByteWindow.java | 2 +- .../storage/file/CachedObjectDirectory.java | 4 +- .../internal/storage/file/DeltaBaseCache.java | 8 +-- .../internal/storage/file/FileRepository.java | 8 +-- .../internal/storage/file/FileSnapshot.java | 4 +- .../jgit/internal/storage/file/LockFile.java | 20 +++---- .../storage/file/ObjectDirectory.java | 18 +++--- .../storage/file/ObjectDirectoryInserter.java | 2 +- .../file/ObjectDirectoryPackParser.java | 4 +- .../jgit/internal/storage/file/PackFile.java | 8 +-- .../jgit/internal/storage/file/PackIndex.java | 8 +-- .../internal/storage/file/PackIndexV1.java | 8 +-- .../internal/storage/file/PackIndexV2.java | 14 ++--- .../storage/file/PackIndexWriter.java | 4 +- .../internal/storage/file/PackInserter.java | 2 +- .../jgit/internal/storage/file/PackLock.java | 2 +- .../storage/file/PackReverseIndex.java | 8 +-- .../internal/storage/file/RefDirectory.java | 16 +++--- .../storage/file/RefDirectoryUpdate.java | 6 +- .../internal/storage/file/WindowCache.java | 32 +++++------ .../internal/storage/file/WriteConfig.java | 2 +- .../internal/storage/pack/BinaryDelta.java | 6 +- .../storage/pack/DeltaIndexScanner.java | 4 +- .../internal/storage/pack/DeltaWindow.java | 2 +- .../internal/storage/pack/ObjectToPack.java | 2 +- .../storage/pack/PackOutputStream.java | 4 +- .../internal/storage/pack/PackWriter.java | 24 ++++---- .../internal/storage/reftree/RefTree.java | 2 +- .../eclipse/jgit/lib/AbbreviatedObjectId.java | 14 ++--- .../src/org/eclipse/jgit/lib/AnyObjectId.java | 36 ++++++------ .../org/eclipse/jgit/lib/BatchRefUpdate.java | 2 +- .../org/eclipse/jgit/lib/BlobBasedConfig.java | 2 +- .../org/eclipse/jgit/lib/BranchConfig.java | 2 +- .../org/eclipse/jgit/lib/CommitBuilder.java | 2 +- .../src/org/eclipse/jgit/lib/Config.java | 20 +++---- .../src/org/eclipse/jgit/lib/ConfigLine.java | 4 +- .../src/org/eclipse/jgit/lib/Constants.java | 10 ++-- .../src/org/eclipse/jgit/lib/CoreConfig.java | 2 +- .../jgit/lib/DefaultTypedConfigGetter.java | 2 +- .../src/org/eclipse/jgit/lib/FileMode.java | 22 ++++---- .../src/org/eclipse/jgit/lib/IndexDiff.java | 4 +- .../org/eclipse/jgit/lib/InflaterCache.java | 4 +- .../org/eclipse/jgit/lib/MutableObjectId.java | 14 ++--- .../org/eclipse/jgit/lib/ObjectChecker.java | 2 +- .../org/eclipse/jgit/lib/ObjectDatabase.java | 4 +- .../src/org/eclipse/jgit/lib/ObjectId.java | 20 +++---- .../eclipse/jgit/lib/ObjectIdOwnerMap.java | 8 +-- .../eclipse/jgit/lib/ObjectIdSubclassMap.java | 12 ++-- .../org/eclipse/jgit/lib/ObjectInserter.java | 2 +- .../org/eclipse/jgit/lib/ObjectLoader.java | 2 +- .../src/org/eclipse/jgit/lib/PersonIdent.java | 16 +++--- .../src/org/eclipse/jgit/lib/Ref.java | 2 +- .../org/eclipse/jgit/lib/RefComparator.java | 6 +- .../src/org/eclipse/jgit/lib/RefRename.java | 6 +- .../src/org/eclipse/jgit/lib/RefUpdate.java | 18 +++--- .../src/org/eclipse/jgit/lib/Repository.java | 24 ++++---- .../org/eclipse/jgit/lib/RepositoryCache.java | 38 ++++++------- .../src/org/eclipse/jgit/lib/TagBuilder.java | 2 +- .../src/org/eclipse/jgit/lib/UserConfig.java | 2 +- .../org/eclipse/jgit/merge/MergeStrategy.java | 4 +- .../src/org/eclipse/jgit/merge/Merger.java | 8 +-- .../org/eclipse/jgit/merge/ResolveMerger.java | 4 +- .../eclipse/jgit/merge/StrategyOneSided.java | 12 ++-- .../merge/StrategySimpleTwoWayInCore.java | 8 +-- .../eclipse/jgit/merge/ThreeWayMerger.java | 8 +-- .../org/eclipse/jgit/notes/LeafBucket.java | 2 +- .../jgit/patch/CombinedFileHeader.java | 16 +++--- .../jgit/patch/CombinedHunkHeader.java | 2 +- .../org/eclipse/jgit/patch/FileHeader.java | 8 +-- .../src/org/eclipse/jgit/patch/Patch.java | 20 +++---- .../jgit/revplot/AbstractPlotRenderer.java | 8 +-- .../org/eclipse/jgit/revplot/PlotCommit.java | 10 ++-- .../eclipse/jgit/revplot/PlotCommitList.java | 10 ++-- .../org/eclipse/jgit/revplot/PlotWalk.java | 8 +-- .../jgit/revwalk/AbstractRevQueue.java | 6 +- .../eclipse/jgit/revwalk/BlockRevQueue.java | 2 +- .../eclipse/jgit/revwalk/DateRevQueue.java | 6 +- .../eclipse/jgit/revwalk/FIFORevQueue.java | 4 +- .../eclipse/jgit/revwalk/FollowFilter.java | 2 +- .../org/eclipse/jgit/revwalk/FooterKey.java | 2 +- .../org/eclipse/jgit/revwalk/FooterLine.java | 2 +- .../eclipse/jgit/revwalk/LIFORevQueue.java | 2 +- .../jgit/revwalk/MergeBaseGenerator.java | 2 +- .../org/eclipse/jgit/revwalk/ObjectWalk.java | 8 +-- .../src/org/eclipse/jgit/revwalk/RevBlob.java | 2 +- .../org/eclipse/jgit/revwalk/RevCommit.java | 10 ++-- .../eclipse/jgit/revwalk/RevCommitList.java | 16 +++--- .../org/eclipse/jgit/revwalk/RevFlagSet.java | 12 ++-- .../org/eclipse/jgit/revwalk/RevObject.java | 16 +++--- .../eclipse/jgit/revwalk/RevObjectList.java | 2 +- .../src/org/eclipse/jgit/revwalk/RevTag.java | 2 +- .../src/org/eclipse/jgit/revwalk/RevTree.java | 2 +- .../src/org/eclipse/jgit/revwalk/RevWalk.java | 56 +++++++++---------- .../jgit/revwalk/RewriteGenerator.java | 2 +- .../eclipse/jgit/revwalk/TreeRevFilter.java | 4 +- .../jgit/revwalk/filter/AndRevFilter.java | 10 ++-- .../jgit/revwalk/filter/AuthorRevFilter.java | 4 +- .../revwalk/filter/CommitTimeRevFilter.java | 18 +++--- .../revwalk/filter/CommitterRevFilter.java | 4 +- .../jgit/revwalk/filter/MessageRevFilter.java | 4 +- .../jgit/revwalk/filter/NotRevFilter.java | 6 +- .../jgit/revwalk/filter/OrRevFilter.java | 10 ++-- .../revwalk/filter/PatternMatchRevFilter.java | 4 +- .../jgit/revwalk/filter/RevFilter.java | 8 +-- .../jgit/revwalk/filter/RevFlagFilter.java | 14 ++--- .../revwalk/filter/SubStringRevFilter.java | 6 +- .../jgit/storage/file/FileBasedConfig.java | 2 +- .../jgit/storage/file/WindowCacheConfig.java | 14 ++--- .../eclipse/jgit/storage/pack/PackConfig.java | 2 +- .../eclipse/jgit/submodule/SubmoduleWalk.java | 12 ++-- .../org/eclipse/jgit/transport/AmazonS3.java | 18 +++--- .../jgit/transport/BaseConnection.java | 4 +- .../jgit/transport/BasePackConnection.java | 6 +- .../transport/BasePackFetchConnection.java | 18 +++--- .../transport/BasePackPushConnection.java | 4 +- .../jgit/transport/BaseReceivePack.java | 32 +++++------ .../jgit/transport/BundleFetchConnection.java | 6 +- .../eclipse/jgit/transport/BundleWriter.java | 6 +- .../eclipse/jgit/transport/Connection.java | 2 +- .../org/eclipse/jgit/transport/Daemon.java | 4 +- .../eclipse/jgit/transport/DaemonService.java | 8 +-- .../transport/DefaultSshSessionFactory.java | 2 +- .../eclipse/jgit/transport/FetchProcess.java | 22 ++++---- .../transport/JschConfigSessionFactory.java | 8 +-- .../eclipse/jgit/transport/JschSession.java | 2 +- .../eclipse/jgit/transport/OpenSshConfig.java | 12 ++-- .../jgit/transport/OperationResult.java | 4 +- .../eclipse/jgit/transport/PackParser.java | 24 ++++---- .../jgit/transport/PackedObjectInfo.java | 6 +- .../eclipse/jgit/transport/PacketLineOut.java | 4 +- .../jgit/transport/PushCertificateStore.java | 2 +- .../eclipse/jgit/transport/PushResult.java | 2 +- .../jgit/transport/ReceiveCommand.java | 6 +- .../eclipse/jgit/transport/ReceivePack.java | 6 +- .../eclipse/jgit/transport/RefAdvertiser.java | 10 ++-- .../org/eclipse/jgit/transport/RefFilter.java | 2 +- .../org/eclipse/jgit/transport/RefSpec.java | 40 ++++++------- .../eclipse/jgit/transport/RemoteConfig.java | 34 +++++------ .../jgit/transport/RemoteRefUpdate.java | 2 +- .../jgit/transport/SideBandInputStream.java | 8 +-- .../jgit/transport/SideBandOutputStream.java | 6 +- .../jgit/transport/SshSessionFactory.java | 4 +- .../org/eclipse/jgit/transport/TagOpt.java | 4 +- .../org/eclipse/jgit/transport/Transport.java | 36 ++++++------ .../jgit/transport/TransportAmazonS3.java | 6 +- .../eclipse/jgit/transport/TransportHttp.java | 20 +++---- .../jgit/transport/TransportLocal.java | 2 +- .../eclipse/jgit/transport/TransportSftp.java | 4 +- .../org/eclipse/jgit/transport/URIish.java | 24 ++++---- .../eclipse/jgit/transport/UploadPack.java | 16 +++--- .../jgit/transport/WalkFetchConnection.java | 30 +++++----- .../jgit/transport/WalkPushConnection.java | 10 ++-- .../transport/WalkRemoteObjectDatabase.java | 2 +- .../jgit/transport/resolver/FileResolver.java | 10 ++-- .../jgit/treewalk/AbstractTreeIterator.java | 16 +++--- .../jgit/treewalk/CanonicalTreeParser.java | 8 +-- .../jgit/treewalk/EmptyTreeIterator.java | 6 +- .../jgit/treewalk/FileTreeIterator.java | 6 +- .../jgit/treewalk/NameConflictTreeWalk.java | 12 ++-- .../org/eclipse/jgit/treewalk/TreeWalk.java | 36 ++++++------ .../jgit/treewalk/WorkingTreeIterator.java | 20 +++---- .../jgit/treewalk/WorkingTreeOptions.java | 2 +- .../jgit/treewalk/filter/AndTreeFilter.java | 10 ++-- .../jgit/treewalk/filter/ByteArraySet.java | 4 +- .../treewalk/filter/InterIndexDiffFilter.java | 2 +- .../treewalk/filter/NotIgnoredFilter.java | 2 +- .../jgit/treewalk/filter/NotTreeFilter.java | 6 +- .../jgit/treewalk/filter/OrTreeFilter.java | 10 ++-- .../jgit/treewalk/filter/PathFilter.java | 8 +-- .../jgit/treewalk/filter/PathFilterGroup.java | 16 +++--- .../treewalk/filter/PathSuffixFilter.java | 2 +- .../jgit/treewalk/filter/TreeFilter.java | 6 +- .../jgit/util/CachedAuthenticator.java | 2 +- .../src/org/eclipse/jgit/util/FS.java | 6 +- .../src/org/eclipse/jgit/util/FS_Win32.java | 4 +- .../eclipse/jgit/util/FS_Win32_Cygwin.java | 2 +- .../src/org/eclipse/jgit/util/FileUtils.java | 16 +++--- .../org/eclipse/jgit/util/HttpSupport.java | 8 +-- .../src/org/eclipse/jgit/util/IO.java | 10 ++-- .../src/org/eclipse/jgit/util/IntList.java | 10 ++-- .../src/org/eclipse/jgit/util/LongList.java | 12 ++-- .../src/org/eclipse/jgit/util/LongMap.java | 6 +- .../org/eclipse/jgit/util/QuotedString.java | 14 ++--- .../eclipse/jgit/util/RawCharSequence.java | 6 +- .../org/eclipse/jgit/util/RawParseUtils.java | 48 ++++++++-------- .../jgit/util/RawSubStringPattern.java | 8 +-- .../src/org/eclipse/jgit/util/RefMap.java | 4 +- .../org/eclipse/jgit/util/StringUtils.java | 10 ++-- .../eclipse/jgit/util/TemporaryBuffer.java | 22 ++++---- .../jgit/util/io/AutoCRLFInputStream.java | 2 +- .../jgit/util/io/AutoCRLFOutputStream.java | 2 +- .../jgit/util/io/AutoLFInputStream.java | 2 +- .../jgit/util/io/AutoLFOutputStream.java | 2 +- .../eclipse/jgit/util/io/InterruptTimer.java | 4 +- .../jgit/util/io/IsolatedOutputStream.java | 2 +- .../jgit/util/io/StreamCopyThread.java | 2 +- .../eclipse/jgit/util/io/TeeInputStream.java | 2 +- .../jgit/util/io/TimeoutInputStream.java | 2 +- .../jgit/util/io/TimeoutOutputStream.java | 2 +- .../jgit/util/io/UnionInputStream.java | 4 +- 384 files changed, 1357 insertions(+), 1357 deletions(-) mode change 100755 => 100644 org.eclipse.jgit/src/org/eclipse/jgit/api/errors/AbortedByHookException.java mode change 100755 => 100644 org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java 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 2819300473..7f1fecb9bf 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 @@ -421,7 +421,7 @@ public class HttpClientConnection implements HttpConnection { /** {@inheritDoc} */ @Override - public void setHostnameVerifier(final HostnameVerifier hostnameverifier) { + public void setHostnameVerifier(HostnameVerifier hostnameverifier) { this.hostnameverifier = hostnameverifier; } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/FileSender.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/FileSender.java index 0d935fc98b..09f110d9b3 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/FileSender.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/FileSender.java @@ -217,7 +217,7 @@ final class FileSender { return true; } - private static Enumeration getRange(final HttpServletRequest req) { + private static Enumeration getRange(HttpServletRequest req) { return req.getHeaders(HDR_RANGE); } } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java index ee23677caa..d0ea7b6dbc 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java @@ -183,7 +183,7 @@ public class GitServlet extends MetaServlet { /** {@inheritDoc} */ @Override - public void init(final ServletConfig config) throws ServletException { + public void init(ServletConfig config) throws ServletException { gitFilter.init(new FilterConfig() { @Override public String getFilterName() { diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java index 830e0611b7..52aaf51287 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoPacksServlet.java @@ -67,7 +67,7 @@ class InfoPacksServlet extends HttpServlet { sendPlainText(packList(req), req, rsp); } - private static String packList(final HttpServletRequest req) { + private static String packList(HttpServletRequest req) { final StringBuilder out = new StringBuilder(); final ObjectDatabase db = getRepository(req).getObjectDatabase(); if (db instanceof ObjectDirectory) { diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java index 4f70cf7004..d7f6fbf291 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java @@ -79,7 +79,7 @@ class InfoRefsServlet extends HttpServlet { Constants.CHARSET)) { final RefAdvertiser adv = new RefAdvertiser() { @Override - protected void writeOne(final CharSequence line) + protected void writeOne(CharSequence line) throws IOException { // Whoever decided that info/refs should use a different // delimiter than the native git:// protocol shouldn't diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java index b0b831f3d6..b379983138 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/IsLocalFilter.java @@ -88,7 +88,7 @@ class IsLocalFilter implements Filter { ((HttpServletResponse) response).sendError(SC_FORBIDDEN); } - private static boolean isLocal(final Repository db) { + private static boolean isLocal(Repository db) { return db.getObjectDatabase() instanceof ObjectDirectory; } } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java index 50dc68f99f..1c523a0623 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java @@ -170,7 +170,7 @@ abstract class ObjectFileServlet extends HttpServlet { } } - private static File objects(final HttpServletRequest req) { + private static File objects(HttpServletRequest req) { final Repository db = getRepository(req); return ((ObjectDirectory) db.getObjectDatabase()).getDirectory(); } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java index b9e82c27f6..020be4f96f 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java @@ -100,13 +100,13 @@ public class RepositoryFilter implements Filter { * {@link org.eclipse.jgit.lib.Repository} instance for the * current web request. */ - public RepositoryFilter(final RepositoryResolver resolver) { + public RepositoryFilter(RepositoryResolver resolver) { this.resolver = resolver; } /** {@inheritDoc} */ @Override - public void init(final FilterConfig config) throws ServletException { + public void init(FilterConfig config) throws ServletException { context = config.getServletContext(); } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java index 272edc6879..2ff385dbec 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java @@ -90,7 +90,7 @@ public final class ServletUtils { * the filter runs before the servlet. * @see #ATTRIBUTE_REPOSITORY */ - public static Repository getRepository(final ServletRequest req) { + public static Repository getRepository(ServletRequest req) { Repository db = (Repository) req.getAttribute(ATTRIBUTE_REPOSITORY); if (db == null) throw new IllegalStateException(HttpServerText.get().expectedRepositoryAttribute); @@ -110,7 +110,7 @@ public final class ServletUtils { * @throws IOException * if an input or output exception occurred. */ - public static InputStream getInputStream(final HttpServletRequest req) + public static InputStream getInputStream(HttpServletRequest req) throws IOException { InputStream in = req.getInputStream(); final String enc = req.getHeader(HDR_CONTENT_ENCODING); @@ -258,7 +258,7 @@ public final class ServletUtils { return false; } - private static byte[] compress(final byte[] raw) throws IOException { + private static byte[] compress(byte[] raw) throws IOException { final int maxLen = raw.length + 32; final ByteArrayOutputStream out = new ByteArrayOutputStream(maxLen); final GZIPOutputStream gz = new GZIPOutputStream(out); @@ -268,7 +268,7 @@ public final class ServletUtils { return out.toByteArray(); } - private static String etag(final byte[] content) { + private static String etag(byte[] content) { final MessageDigest md = Constants.newMessageDigest(); md.update(content); return ObjectId.fromRaw(md.digest()).getName(); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java index 00851cfbe4..5cac868b9f 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java @@ -80,7 +80,7 @@ class TextFileServlet extends HttpServlet { } } - private byte[] read(final HttpServletRequest req) throws IOException { + private byte[] read(HttpServletRequest req) throws IOException { final File gitdir = getRepository(req).getDirectory(); if (gitdir == null) throw new FileNotFoundException(fileName); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ErrorServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ErrorServlet.java index 57fdddaf39..6f27b287f5 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ErrorServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ErrorServlet.java @@ -64,7 +64,7 @@ public class ErrorServlet extends HttpServlet { * @param status * the HTTP status code to always send. */ - public ErrorServlet(final int status) { + public ErrorServlet(int status) { this.status = status; } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexGroupFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexGroupFilter.java index a3dc6c3702..f26ebc35f6 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexGroupFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexGroupFilter.java @@ -75,7 +75,7 @@ public class RegexGroupFilter implements Filter { * @param groupIdx * capture group number, 1 through the number of groups. */ - public RegexGroupFilter(final int groupIdx) { + public RegexGroupFilter(int groupIdx) { if (groupIdx < 1) throw new IllegalArgumentException(MessageFormat.format( HttpServerText.get().invalidIndex, valueOf(groupIdx))); @@ -108,7 +108,7 @@ public class RegexGroupFilter implements Filter { valueOf(groupIdx + 1))); } - private static WrappedRequest[] groupsFor(final ServletRequest r) { + private static WrappedRequest[] groupsFor(ServletRequest r) { return (WrappedRequest[]) r.getAttribute(MetaFilter.REGEX_GROUPS); } } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java index 95eb8d52d7..fbd155c0dc 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java @@ -82,7 +82,7 @@ public class DefaultReceivePackFactory implements /** {@inheritDoc} */ @Override - public ReceivePack create(final HttpServletRequest req, final Repository db) + public ReceivePack create(HttpServletRequest req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { final ServiceConfig cfg = db.getConfig().get(ServiceConfig::new); String user = req.getRemoteUser(); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java index f5afa1ecd0..e6df77b836 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java @@ -71,7 +71,7 @@ public class DefaultUploadPackFactory implements /** {@inheritDoc} */ @Override - public UploadPack create(final HttpServletRequest req, final Repository db) + public UploadPack create(HttpServletRequest req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { if (db.getConfig().get(ServiceConfig::new).enabled) return new UploadPack(db); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java index 6dbe0e3cdd..035501ffc1 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java @@ -118,7 +118,7 @@ public class HttpClientTests extends HttpTestCase { smartAuthBasicURI = toURIish(sBasic, srcName); } - private ServletContextHandler dumb(final String path) { + private ServletContextHandler dumb(String path) { final File srcGit = remoteRepository.getRepository().getDirectory(); final URI base = srcGit.getParentFile().toURI(); @@ -130,7 +130,7 @@ public class HttpClientTests extends HttpTestCase { return ctx; } - private ServletContextHandler smart(final String path) { + private ServletContextHandler smart(String path) { GitServlet gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { @Override @@ -151,7 +151,7 @@ public class HttpClientTests extends HttpTestCase { return ctx; } - private static String nameOf(final Repository db) { + private static String nameOf(Repository db) { return db.getDirectory().getName(); } 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 01c4360d1e..8d08c038d0 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 @@ -77,7 +77,7 @@ public class AccessEvent { responseHeaders = cloneHeaders(rsp); } - private static Map cloneHeaders(final Request req) { + private static Map cloneHeaders(Request req) { Map r = new TreeMap<>(); Enumeration hn = req.getHeaderNames(); while (hn.hasMoreElements()) { @@ -89,7 +89,7 @@ public class AccessEvent { return Collections.unmodifiableMap(r); } - private static Map cloneHeaders(final Response rsp) { + private static Map cloneHeaders(Response rsp) { Map r = new TreeMap<>(); Enumeration hn = rsp.getHttpFields().getFieldNames(); while (hn.hasMoreElements()) { 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 fed063a8fa..a714eb01d4 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 @@ -107,7 +107,7 @@ public class RecordingLogger implements Logger { * * @param name */ - public RecordingLogger(final String name) { + public RecordingLogger(String name) { this.name = name; } diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java index c5576f91e6..245b510fe1 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java @@ -134,7 +134,7 @@ public class SimpleHttpServer { return secureUri; } - private ServletContextHandler smart(final String path) { + private ServletContextHandler smart(String path) { GitServlet gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { @Override @@ -154,7 +154,7 @@ public class SimpleHttpServer { return ctx; } - private static String nameOf(final Repository db) { + private static String nameOf(Repository db) { return db.getDirectory().getName(); } diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java index 27f745e4e9..a102da1f49 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java @@ -142,7 +142,7 @@ public abstract class JGitTestUtil { * @param fileName * @return the test resource file */ - public static File getTestResourceFile(final String fileName) { + public static File getTestResourceFile(String fileName) { if (fileName == null || fileName.length() <= 0) { return null; } @@ -242,7 +242,7 @@ public abstract class JGitTestUtil { * @throws IOException * the file could not be written. */ - public static void write(final File f, final String body) + public static void write(File f, String body) throws IOException { FileUtils.mkdirs(f.getParentFile(), true); try (Writer w = new OutputStreamWriter(new FileOutputStream(f), @@ -261,7 +261,7 @@ public abstract class JGitTestUtil { * @throws IOException * the file does not exist, or could not be read. */ - public static String read(final File file) throws IOException { + public static String read(File file) throws IOException { final byte[] body = IO.readFully(file); return new String(body, 0, body.length, CHARSET); } @@ -274,7 +274,7 @@ public abstract class JGitTestUtil { * @return the content of the file * @throws IOException */ - public static String read(final Repository db, final String name) + public static String read(Repository db, String name) throws IOException { File file = new File(db.getWorkTree(), name); return read(file); @@ -288,7 +288,7 @@ public abstract class JGitTestUtil { * name of the file * @return {@code true} if the file exists */ - public static boolean check(final Repository db, final String name) { + public static boolean check(Repository db, String name) { File file = new File(db.getWorkTree(), name); return file.exists(); } diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index 3c00bd3df1..6cdd0eb23c 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -225,7 +225,7 @@ public abstract class LocalDiskRepositoryTestCase { * @param dir * the recursively directory to delete, if present. */ - protected void recursiveDelete(final File dir) { + protected void recursiveDelete(File dir) { recursiveDelete(dir, false, true); } @@ -540,7 +540,7 @@ public abstract class LocalDiskRepositoryTestCase { * @throws IOException * the file could not be written. */ - protected File write(final String body) throws IOException { + protected File write(String body) throws IOException { final File f = File.createTempFile("temp", "txt", tmp); try { write(f, body); @@ -571,7 +571,7 @@ public abstract class LocalDiskRepositoryTestCase { * @throws IOException * the file could not be written. */ - protected void write(final File f, final String body) throws IOException { + protected void write(File f, String body) throws IOException { JGitTestUtil.write(f, body); } @@ -583,11 +583,11 @@ public abstract class LocalDiskRepositoryTestCase { * @return the content of the file * @throws IOException */ - protected String read(final File f) throws IOException { + protected String read(File f) throws IOException { return JGitTestUtil.read(f); } - private static String[] toEnvArray(final Map env) { + private static String[] toEnvArray(Map env) { final String[] envp = new String[env.size()]; int i = 0; for (Map.Entry e : env.entrySet()) diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java index 05d15229bc..d3d7d682e8 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java @@ -109,7 +109,7 @@ public class MockSystemReader extends SystemReader { setCurrentPlatform(); } - private void init(final String n) { + private void init(String n) { setProperty(n, n); } @@ -197,7 +197,7 @@ public class MockSystemReader extends SystemReader { * number of seconds to add to the current time. * @since 4.2 */ - public void tick(final int secDelta) { + public void tick(int secDelta) { now += secDelta * 1000L; } diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java index 93fc771cb3..e983e5dfb6 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java @@ -92,7 +92,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @param dst * @throws IOException */ - protected static void copyFile(final File src, final File dst) + protected static void copyFile(File src, File dst) throws IOException { try (FileInputStream fis = new FileInputStream(src); FileOutputStream fos = new FileOutputStream(dst)) { @@ -112,7 +112,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @return the trash file * @throws IOException */ - protected File writeTrashFile(final String name, final String data) + protected File writeTrashFile(String name, String data) throws IOException { return JGitTestUtil.writeTrashFile(db, name, data); } @@ -128,7 +128,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @throws Exception * @since 4.2 */ - protected Path writeLink(final String link, final String target) + protected Path writeLink(String link, String target) throws Exception { return JGitTestUtil.writeLink(db, link, target); } @@ -155,7 +155,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @return the file's content * @throws IOException */ - protected String read(final String name) throws IOException { + protected String read(String name) throws IOException { return JGitTestUtil.read(db, name); } @@ -166,7 +166,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * file name * @return if the file exists */ - protected boolean check(final String name) { + protected boolean check(String name) { return JGitTestUtil.check(db, name); } @@ -177,7 +177,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * file name * @throws IOException */ - protected void deleteTrashFile(final String name) throws IOException { + protected void deleteTrashFile(String name) throws IOException { JGitTestUtil.deleteTrashFile(db, name); } @@ -189,7 +189,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * expected content * @throws IOException */ - protected static void checkFile(File f, final String checkData) + protected static void checkFile(File f, String checkData) throws IOException { try (Reader r = new InputStreamReader(new FileInputStream(f), CHARSET)) { @@ -500,7 +500,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * @param mode * @return the DirCacheEntry */ - protected DirCacheEntry createEntry(final String path, final FileMode mode) { + protected DirCacheEntry createEntry(String path, FileMode mode) { return createEntry(path, mode, DirCacheEntry.STAGE_0, path); } diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java index 89a86d8eea..4891c01945 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java @@ -244,7 +244,7 @@ public class TestRepository { * @param secDelta * number of seconds to add to the current time. */ - public void tick(final int secDelta) { + public void tick(int secDelta) { mockSystemReader.tick(secDelta); } @@ -267,7 +267,7 @@ public class TestRepository { * @return reference to the blob. * @throws Exception */ - public RevBlob blob(final String content) throws Exception { + public RevBlob blob(String content) throws Exception { return blob(content.getBytes(CHARSET)); } @@ -279,7 +279,7 @@ public class TestRepository { * @return reference to the blob. * @throws Exception */ - public RevBlob blob(final byte[] content) throws Exception { + public RevBlob blob(byte[] content) throws Exception { ObjectId id; try (ObjectInserter ins = inserter) { id = ins.insert(Constants.OBJ_BLOB, content); @@ -298,7 +298,7 @@ public class TestRepository { * @return the entry. * @throws Exception */ - public DirCacheEntry file(final String path, final RevBlob blob) + public DirCacheEntry file(String path, RevBlob blob) throws Exception { final DirCacheEntry e = new DirCacheEntry(path); e.setFileMode(FileMode.REGULAR_FILE); @@ -315,7 +315,7 @@ public class TestRepository { * @return reference to the tree specified by the entry list. * @throws Exception */ - public RevTree tree(final DirCacheEntry... entries) throws Exception { + public RevTree tree(DirCacheEntry... entries) throws Exception { final DirCache dc = DirCache.newInCore(); final DirCacheBuilder b = dc.builder(); for (final DirCacheEntry e : entries) @@ -339,7 +339,7 @@ public class TestRepository { * @return the parsed object entry at this path, never null. * @throws Exception */ - public RevObject get(final RevTree tree, final String path) + public RevObject get(RevTree tree, String path) throws Exception { try (TreeWalk tw = new TreeWalk(pool.getObjectReader())) { tw.setFilter(PathFilterGroup.createFromStrings(Collections @@ -370,7 +370,7 @@ public class TestRepository { * @return the new commit. * @throws Exception */ - public RevCommit commit(final RevCommit... parents) throws Exception { + public RevCommit commit(RevCommit... parents) throws Exception { return commit(1, tree(), parents); } @@ -386,7 +386,7 @@ public class TestRepository { * @return the new commit. * @throws Exception */ - public RevCommit commit(final RevTree tree, final RevCommit... parents) + public RevCommit commit(RevTree tree, RevCommit... parents) throws Exception { return commit(1, tree, parents); } @@ -404,7 +404,7 @@ public class TestRepository { * @return the new commit. * @throws Exception */ - public RevCommit commit(final int secDelta, final RevCommit... parents) + public RevCommit commit(int secDelta, RevCommit... parents) throws Exception { return commit(secDelta, tree(), parents); } @@ -470,7 +470,7 @@ public class TestRepository { * @return the annotated tag object. * @throws Exception */ - public RevTag tag(final String name, final RevObject dst) throws Exception { + public RevTag tag(String name, RevObject dst) throws Exception { final TagBuilder t = new TagBuilder(); t.setObjectId(dst); t.setTag(name); @@ -759,7 +759,7 @@ public class TestRepository { final FileRepository fr = (FileRepository) db; RefWriter rw = new RefWriter(fr.getAllRefs().values()) { @Override - protected void writeFile(final String name, final byte[] bin) + protected void writeFile(String name, byte[] bin) throws IOException { File path = new File(fr.getDirectory(), name); TestRepository.this.writeFile(path, bin); @@ -791,7 +791,7 @@ public class TestRepository { * @return {@code object} * @throws Exception */ - public T parseBody(final T object) throws Exception { + public T parseBody(T object) throws Exception { pool.parseBody(object); return object; } @@ -944,7 +944,7 @@ public class TestRepository { return new File(packdir, "pack-" + name.name() + t); } - private void writeFile(final File p, final byte[] bin) throws IOException, + private void writeFile(File p, byte[] bin) throws IOException, ObjectWritingException { final LockFile lck = new LockFile(p); if (!lck.lock()) @@ -1093,7 +1093,7 @@ public class TestRepository { return add(path, blob(content)); } - public CommitBuilder add(String path, final RevBlob id) + public CommitBuilder add(String path, RevBlob id) throws Exception { return edit(new PathEdit(path) { @Override diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRng.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRng.java index 54c81f2d86..f7af36a838 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRng.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRng.java @@ -55,7 +55,7 @@ public class TestRng { * @param seed * seed to bootstrap, usually this is the test method name. */ - public TestRng(final String seed) { + public TestRng(String seed) { next = 0; for (int i = 0; i < seed.length(); i++) next = next * 11 + seed.charAt(i); @@ -68,7 +68,7 @@ public class TestRng { * number of random bytes to produce. * @return array of {@code cnt} randomly generated bytes. */ - public byte[] nextBytes(final int cnt) { + public byte[] nextBytes(int cnt) { final byte[] r = new byte[cnt]; for (int i = 0; i < cnt; i++) r[i] = (byte) nextInt(); diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java index 688aef2af7..55d9093241 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java @@ -170,7 +170,7 @@ public class FileLfsRepository implements LargeFileRepository { private static final char[] hexchar = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; - private static void formatHexChar(final char[] dst, final int p, int b) { + private static void formatHexChar(char[] dst, int p, int b) { int o = p + 1; while (o >= p && b != 0) { dst[o--] = hexchar[b & 0xf]; diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java index 4529a25fc0..d268857914 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java @@ -78,7 +78,7 @@ public final class AbbreviatedLongObjectId implements Serializable { * the string to test. * @return true if the string can converted into an AbbreviatedObjectId. */ - public static final boolean isId(final String id) { + public static final boolean isId(String id) { if (id.length() < 2 || Constants.LONG_OBJECT_ID_STRING_LENGTH < id.length()) return false; @@ -138,7 +138,7 @@ public final class AbbreviatedLongObjectId implements Serializable { * the string to read from. Must be <= 64 characters. * @return the converted object id. */ - public static final AbbreviatedLongObjectId fromString(final String str) { + public static final AbbreviatedLongObjectId fromString(String str) { if (str.length() > Constants.LONG_OBJECT_ID_STRING_LENGTH) throw new IllegalArgumentException( MessageFormat.format(LfsText.get().invalidLongId, str)); @@ -249,7 +249,7 @@ public final class AbbreviatedLongObjectId implements Serializable { * >0 if this abbreviation names an object that is after * other. */ - public final int prefixCompare(final AnyLongObjectId other) { + public final int prefixCompare(AnyLongObjectId other) { int cmp; cmp = NB.compareUInt64(w1, mask(1, other.w1)); @@ -281,7 +281,7 @@ public final class AbbreviatedLongObjectId implements Serializable { * >0 if this abbreviation names an object that is after * other. */ - public final int prefixCompare(final byte[] bs, final int p) { + public final int prefixCompare(byte[] bs, int p) { int cmp; cmp = NB.compareUInt64(w1, mask(1, NB.decodeInt64(bs, p))); @@ -313,7 +313,7 @@ public final class AbbreviatedLongObjectId implements Serializable { * >0 if this abbreviation names an object that is after * other. */ - public final int prefixCompare(final long[] bs, final int p) { + public final int prefixCompare(long[] bs, int p) { int cmp; cmp = NB.compareUInt64(w1, mask(1, bs[p])); @@ -340,7 +340,7 @@ public final class AbbreviatedLongObjectId implements Serializable { return (int) (w1 >>> 56); } - private long mask(final long word, final long v) { + private long mask(long word, long v) { return mask(nibbles, word, v); } @@ -352,7 +352,7 @@ public final class AbbreviatedLongObjectId implements Serializable { /** {@inheritDoc} */ @Override - public boolean equals(final Object o) { + public boolean equals(Object o) { if (o instanceof AbbreviatedLongObjectId) { final AbbreviatedLongObjectId b = (AbbreviatedLongObjectId) o; return nibbles == b.nibbles && w1 == b.w1 && w2 == b.w2 diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java index 96d6938529..cdb297eb1c 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java @@ -170,7 +170,7 @@ public abstract class AnyLongObjectId implements Comparable { * Compare this LongObjectId to another and obtain a sort ordering. */ @Override - public final int compareTo(final AnyLongObjectId other) { + public final int compareTo(AnyLongObjectId other) { if (this == other) return 0; @@ -202,7 +202,7 @@ public abstract class AnyLongObjectId implements Comparable { * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. */ - public final int compareTo(final byte[] bs, final int p) { + public final int compareTo(byte[] bs, int p) { int cmp; cmp = NB.compareUInt64(w1, NB.decodeInt64(bs, p)); @@ -231,7 +231,7 @@ public abstract class AnyLongObjectId implements Comparable { * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. */ - public final int compareTo(final long[] bs, final int p) { + public final int compareTo(long[] bs, int p) { int cmp; cmp = NB.compareUInt64(w1, bs[p]); @@ -257,7 +257,7 @@ public abstract class AnyLongObjectId implements Comparable { * @return true if this LongObjectId begins with the abbreviation; else * false. */ - public boolean startsWith(final AbbreviatedLongObjectId abbr) { + public boolean startsWith(AbbreviatedLongObjectId abbr) { return abbr.prefixCompare(this) == 0; } @@ -274,13 +274,13 @@ public abstract class AnyLongObjectId implements Comparable { * the other id to compare to. May be null. * @return true only if both LongObjectIds have identical bits. */ - public final boolean equals(final AnyLongObjectId other) { + public final boolean equals(AnyLongObjectId other) { return other != null ? equals(this, other) : false; } /** {@inheritDoc} */ @Override - public final boolean equals(final Object o) { + public final boolean equals(Object o) { if (o instanceof AnyLongObjectId) return equals((AnyLongObjectId) o); else @@ -293,7 +293,7 @@ public abstract class AnyLongObjectId implements Comparable { * @param w * the buffer to copy to. Must be in big endian order. */ - public void copyRawTo(final ByteBuffer w) { + public void copyRawTo(ByteBuffer w) { w.putLong(w1); w.putLong(w2); w.putLong(w3); @@ -308,7 +308,7 @@ public abstract class AnyLongObjectId implements Comparable { * @param o * the offset within b to write at. */ - public void copyRawTo(final byte[] b, final int o) { + public void copyRawTo(byte[] b, int o) { NB.encodeInt64(b, o, w1); NB.encodeInt64(b, o + 8, w2); NB.encodeInt64(b, o + 16, w3); @@ -323,7 +323,7 @@ public abstract class AnyLongObjectId implements Comparable { * @param o * the offset within b to write at. */ - public void copyRawTo(final long[] b, final int o) { + public void copyRawTo(long[] b, int o) { b[o] = w1; b[o + 1] = w2; b[o + 2] = w3; @@ -338,14 +338,14 @@ public abstract class AnyLongObjectId implements Comparable { * @throws java.io.IOException * the stream writing failed. */ - public void copyRawTo(final OutputStream w) throws IOException { + public void copyRawTo(OutputStream w) throws IOException { writeRawLong(w, w1); writeRawLong(w, w2); writeRawLong(w, w3); writeRawLong(w, w4); } - private static void writeRawLong(final OutputStream w, long v) + private static void writeRawLong(OutputStream w, long v) throws IOException { w.write((int) (v >>> 56)); w.write((int) (v >>> 48)); @@ -365,7 +365,7 @@ public abstract class AnyLongObjectId implements Comparable { * @throws java.io.IOException * the stream writing failed. */ - public void copyTo(final OutputStream w) throws IOException { + public void copyTo(OutputStream w) throws IOException { w.write(toHexByteArray()); } @@ -406,7 +406,7 @@ public abstract class AnyLongObjectId implements Comparable { private static final byte[] hexbyte = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; - private static void formatHexByte(final byte[] dst, final int p, long w) { + private static void formatHexByte(byte[] dst, int p, long w) { int o = p + 15; while (o >= p && w != 0) { dst[o--] = hexbyte[(int) (w & 0xf)]; @@ -424,7 +424,7 @@ public abstract class AnyLongObjectId implements Comparable { * @throws java.io.IOException * the stream writing failed. */ - public void copyTo(final Writer w) throws IOException { + public void copyTo(Writer w) throws IOException { w.write(toHexCharArray()); } @@ -440,7 +440,7 @@ public abstract class AnyLongObjectId implements Comparable { * @throws java.io.IOException * the stream writing failed. */ - public void copyTo(final char[] tmp, final Writer w) throws IOException { + public void copyTo(char[] tmp, Writer w) throws IOException { toHexCharArray(tmp); w.write(tmp, 0, Constants.LONG_OBJECT_ID_STRING_LENGTH); } @@ -455,7 +455,7 @@ public abstract class AnyLongObjectId implements Comparable { * @param w * the string to append onto. */ - public void copyTo(final char[] tmp, final StringBuilder w) { + public void copyTo(char[] tmp, StringBuilder w) { toHexCharArray(tmp); w.append(tmp, 0, Constants.LONG_OBJECT_ID_STRING_LENGTH); } @@ -466,7 +466,7 @@ public abstract class AnyLongObjectId implements Comparable { return dst; } - private void toHexCharArray(final char[] dst) { + private void toHexCharArray(char[] dst) { formatHexChar(dst, 0, w1); formatHexChar(dst, 16, w2); formatHexChar(dst, 32, w3); @@ -524,7 +524,7 @@ public abstract class AnyLongObjectId implements Comparable { * length of the abbreviated string. * @return SHA-256 abbreviation. */ - public AbbreviatedLongObjectId abbreviate(final int len) { + public AbbreviatedLongObjectId abbreviate(int len) { final long a = AbbreviatedLongObjectId.mask(len, 1, w1); final long b = AbbreviatedLongObjectId.mask(len, 2, w2); final long c = AbbreviatedLongObjectId.mask(len, 3, w3); diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/LongObjectId.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/LongObjectId.java index ec1e1791db..8159576c03 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/LongObjectId.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/LongObjectId.java @@ -90,7 +90,7 @@ public class LongObjectId extends AnyLongObjectId implements Serializable { * the string to test. * @return true if the string can converted into an LongObjectId. */ - public static final boolean isId(final String id) { + public static final boolean isId(String id) { if (id.length() != Constants.LONG_OBJECT_ID_STRING_LENGTH) return false; try { @@ -110,7 +110,7 @@ public class LongObjectId extends AnyLongObjectId implements Serializable { * the id to convert. May be null. * @return the hex string conversion of this id's content. */ - public static final String toString(final LongObjectId i) { + public static final String toString(LongObjectId i) { return i != null ? i.name() : ZEROID_STR; } @@ -173,7 +173,7 @@ public class LongObjectId extends AnyLongObjectId implements Serializable { * available within this byte array. * @return the converted object id. */ - public static final LongObjectId fromRaw(final byte[] bs) { + public static final LongObjectId fromRaw(byte[] bs) { return fromRaw(bs, 0); } @@ -187,7 +187,7 @@ public class LongObjectId extends AnyLongObjectId implements Serializable { * position to read the first byte of data from. * @return the converted object id. */ - public static final LongObjectId fromRaw(final byte[] bs, final int p) { + public static final LongObjectId fromRaw(byte[] bs, int p) { final long a = NB.decodeInt64(bs, p); final long b = NB.decodeInt64(bs, p + 8); final long c = NB.decodeInt64(bs, p + 16); @@ -203,7 +203,7 @@ public class LongObjectId extends AnyLongObjectId implements Serializable { * available within this long array. * @return the converted object id. */ - public static final LongObjectId fromRaw(final long[] is) { + public static final LongObjectId fromRaw(long[] is) { return fromRaw(is, 0); } @@ -217,7 +217,7 @@ public class LongObjectId extends AnyLongObjectId implements Serializable { * position to read the first long of data from. * @return the converted object id. */ - public static final LongObjectId fromRaw(final long[] is, final int p) { + public static final LongObjectId fromRaw(long[] is, int p) { return new LongObjectId(is[p], is[p + 1], is[p + 2], is[p + 3]); } @@ -231,7 +231,7 @@ public class LongObjectId extends AnyLongObjectId implements Serializable { * position to read the first character from. * @return the converted object id. */ - public static final LongObjectId fromString(final byte[] buf, final int offset) { + public static final LongObjectId fromString(byte[] buf, int offset) { return fromHexString(buf, offset); } @@ -242,14 +242,14 @@ public class LongObjectId extends AnyLongObjectId implements Serializable { * the string to read from. Must be 64 characters long. * @return the converted object id. */ - public static LongObjectId fromString(final String str) { + public static LongObjectId fromString(String str) { if (str.length() != Constants.LONG_OBJECT_ID_STRING_LENGTH) throw new InvalidLongObjectIdException(str); return fromHexString(org.eclipse.jgit.lib.Constants.encodeASCII(str), 0); } - private static final LongObjectId fromHexString(final byte[] bs, int p) { + private static final LongObjectId fromHexString(byte[] bs, int p) { try { final long a = RawParseUtils.parseHexInt64(bs, p); final long b = RawParseUtils.parseHexInt64(bs, p + 16); @@ -280,7 +280,7 @@ public class LongObjectId extends AnyLongObjectId implements Serializable { * @param src * another already parsed LongObjectId to copy the value out of. */ - protected LongObjectId(final AnyLongObjectId src) { + protected LongObjectId(AnyLongObjectId src) { w1 = src.w1; w2 = src.w2; w3 = src.w3; diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/MutableLongObjectId.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/MutableLongObjectId.java index 7b0c49444a..3d62490bfe 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/MutableLongObjectId.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/MutableLongObjectId.java @@ -167,7 +167,7 @@ public class MutableLongObjectId extends AnyLongObjectId { * the raw byte buffer to read from. At least 32 bytes must be * available within this byte array. */ - public void fromRaw(final byte[] bs) { + public void fromRaw(byte[] bs) { fromRaw(bs, 0); } @@ -180,7 +180,7 @@ public class MutableLongObjectId extends AnyLongObjectId { * @param p * position to read the first byte of data from. */ - public void fromRaw(final byte[] bs, final int p) { + public void fromRaw(byte[] bs, int p) { w1 = NB.decodeInt64(bs, p); w2 = NB.decodeInt64(bs, p + 8); w3 = NB.decodeInt64(bs, p + 16); @@ -194,7 +194,7 @@ public class MutableLongObjectId extends AnyLongObjectId { * the raw long buffer to read from. At least 4 longs must be * available within this longs array. */ - public void fromRaw(final long[] longs) { + public void fromRaw(long[] longs) { fromRaw(longs, 0); } @@ -207,7 +207,7 @@ public class MutableLongObjectId extends AnyLongObjectId { * @param p * position to read the first integer of data from. */ - public void fromRaw(final long[] longs, final int p) { + public void fromRaw(long[] longs, int p) { w1 = longs[p]; w2 = longs[p + 1]; w3 = longs[p + 2]; @@ -223,7 +223,7 @@ public class MutableLongObjectId extends AnyLongObjectId { * @param offset * position to read the first character from. */ - public void fromString(final byte[] buf, final int offset) { + public void fromString(byte[] buf, int offset) { fromHexString(buf, offset); } @@ -233,14 +233,14 @@ public class MutableLongObjectId extends AnyLongObjectId { * @param str * the string to read from. Must be 64 characters long. */ - public void fromString(final String str) { + public void fromString(String str) { if (str.length() != Constants.LONG_OBJECT_ID_STRING_LENGTH) throw new IllegalArgumentException( MessageFormat.format(LfsText.get().invalidLongId, str)); fromHexString(org.eclipse.jgit.lib.Constants.encodeASCII(str), 0); } - private void fromHexString(final byte[] bs, int p) { + private void fromHexString(byte[] bs, int p) { try { w1 = RawParseUtils.parseHexInt64(bs, p); w2 = RawParseUtils.parseHexInt64(bs, p + 16); 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 0eeababc5d..0d1894b644 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 @@ -122,17 +122,17 @@ public class CLIRepositoryTestCase extends LocalDiskRepositoryTestCase { return JGitTestUtil.writeLink(db, link, target); } - protected File writeTrashFile(final String name, final String data) + protected File writeTrashFile(String name, String data) throws IOException { return JGitTestUtil.writeTrashFile(db, name, data); } @Override - protected String read(final File file) throws IOException { + protected String read(File file) throws IOException { return JGitTestUtil.read(file); } - protected void deleteTrashFile(final String name) throws IOException { + protected void deleteTrashFile(String name) throws IOException { JGitTestUtil.deleteTrashFile(db, name); } 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 e992ddfb5b..afeb5ef6e4 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 @@ -700,7 +700,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { return l.toArray(new String[l.size()]); } - private static Future writeAsync(final OutputStream stream, final byte[] data) { + private static Future writeAsync(OutputStream stream, byte[] data) { ExecutorService executor = Executors.newSingleThreadExecutor(); return executor.submit(new Callable() { diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java index f0754b192c..2b6ea2a0e9 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java @@ -74,7 +74,7 @@ abstract class AbstractFetchCommand extends TextBuiltin { * @throws java.io.IOException * if any. */ - protected void showFetchResult(final FetchResult r) throws IOException { + protected void showFetchResult(FetchResult r) throws IOException { try (ObjectReader reader = db.newObjectReader()) { boolean shownURI = false; for (final TrackingRefUpdate u : r.getTrackingRefUpdates()) { @@ -181,7 +181,7 @@ abstract class AbstractFetchCommand extends TextBuiltin { } } - private static char shortTypeOf(final RefUpdate.Result r) { + private static char shortTypeOf(RefUpdate.Result r) { if (r == RefUpdate.Result.LOCK_FAILURE) return '!'; if (r == RefUpdate.Result.IO_FAILURE) 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 e6685c2f65..65d60bce5a 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 @@ -302,7 +302,7 @@ class Branch extends TextBuiltin { } } - private void addRefs(final Collection refs, final String prefix) { + private void addRefs(Collection refs, String prefix) { for (final Ref ref : RefComparator.sort(refs)) { final String name = ref.getName(); if (name.startsWith(prefix)) @@ -310,7 +310,7 @@ class Branch extends TextBuiltin { } } - private void addRef(final String name, final Ref ref) { + private void addRef(String name, Ref ref) { printRefs.put(name, ref); maxNameLength = Math.max(maxNameLength, name.length()); } 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 510daecd3d..e699326a0b 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 @@ -87,7 +87,7 @@ public class CommandCatalog { * was derived from the DashLowerCaseForm class name. * @return the command instance; null if no command exists by that name. */ - public static CommandRef get(final String name) { + public static CommandRef get(String name) { return INSTANCE.commands.get(name); } @@ -113,11 +113,11 @@ public class CommandCatalog { return toSortedArray(common); } - private static CommandRef[] toSortedArray(final Collection c) { + private static CommandRef[] toSortedArray(Collection c) { final CommandRef[] r = c.toArray(new CommandRef[c.size()]); Arrays.sort(r, new Comparator() { @Override - public int compare(final CommandRef o1, final CommandRef o2) { + public int compare(CommandRef o1, CommandRef o2) { return o1.getName().compareTo(o2.getName()); } }); @@ -146,7 +146,7 @@ public class CommandCatalog { } } - private void scan(final URL cUrl) { + private void scan(URL cUrl) { try (BufferedReader cIn = new BufferedReader( new InputStreamReader(cUrl.openStream(), CHARSET))) { String line; @@ -159,7 +159,7 @@ public class CommandCatalog { } } - private void load(final String cn) { + private void load(String cn) { final Class clazz; try { clazz = Class.forName(cn, false, ldr).asSubclass(TextBuiltin.class); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandRef.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandRef.java index 2c9bc0dc75..4df446fe8f 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandRef.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandRef.java @@ -76,13 +76,13 @@ public class CommandRef { common = cmd.common(); } - private CommandRef(final Class clazz, final String cn) { + private CommandRef(Class clazz, String cn) { impl = clazz; name = cn; usage = ""; //$NON-NLS-1$ } - private static String guessName(final Class clazz) { + private static String guessName(Class clazz) { final StringBuilder s = new StringBuilder(); if (clazz.getName().startsWith("org.eclipse.jgit.pgm.debug.")) //$NON-NLS-1$ s.append("debug-"); //$NON-NLS-1$ diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java index 59de80c963..4ec5f04bb6 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java @@ -63,7 +63,7 @@ public class Die extends RuntimeException { * @param why * the message to show to the end-user. */ - public Die(final String why) { + public Die(String why) { super(why); } @@ -75,7 +75,7 @@ public class Die extends RuntimeException { * @param cause * why the command has failed. */ - public Die(final String why, final Throwable cause) { + public Die(String why, Throwable cause) { super(why, cause); } @@ -100,7 +100,7 @@ public class Die extends RuntimeException { * can be null * @since 4.2 */ - public Die(boolean aborted, final Throwable cause) { + public Die(boolean aborted, Throwable cause) { super(cause != null ? cause.getMessage() : null, cause); this.aborted = aborted; } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java index ed6f7b426b..97e3df38d6 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java @@ -170,7 +170,7 @@ class Diff extends TextBuiltin { /** {@inheritDoc} */ @Override - protected void init(final Repository repository, final String gitDir) { + protected void init(Repository repository, String gitDir) { super.init(repository, gitDir); diffFmt = new DiffFormatter(new BufferedOutputStream(outs)); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java index a081b7813f..2b5af5d7b7 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java @@ -75,7 +75,7 @@ class Glog extends RevWalkTextBuiltin { frame = new JFrame(); frame.addWindowListener(new WindowAdapter() { @Override - public void windowClosing(final WindowEvent e) { + public void windowClosing(WindowEvent e) { frame.dispose(); } }); @@ -116,7 +116,7 @@ class Glog extends RevWalkTextBuiltin { /** {@inheritDoc} */ @Override - protected void show(final RevCommit c) throws Exception { + protected void show(RevCommit c) throws Exception { throw new UnsupportedOperationException(); } 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 75542d4454..0d8b7ec005 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 @@ -186,7 +186,7 @@ class Log extends RevWalkTextBuiltin { /** {@inheritDoc} */ @Override - protected void init(final Repository repository, final String gitDir) { + protected void init(Repository repository, String gitDir) { super.init(repository, gitDir); diffFmt = new DiffFormatter(new BufferedOutputStream(outs)); } @@ -241,7 +241,7 @@ class Log extends RevWalkTextBuiltin { /** {@inheritDoc} */ @Override - protected void show(final RevCommit c) throws Exception { + protected void show(RevCommit c) throws Exception { outw.print(CLIText.get().commitLabel); outw.print(" "); //$NON-NLS-1$ c.getId().copyTo(outbuffer, outw); 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 9013ff6cfe..9079233587 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 @@ -96,7 +96,7 @@ class LsRemote extends TextBuiltin { return false; } - private void show(final AnyObjectId id, final String name) + private void show(AnyObjectId id, String name) throws IOException { outw.print(id.name()); outw.print('\t'); 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 33c5475d10..e303f385a8 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 @@ -141,7 +141,7 @@ public class Main { * arguments. * @throws java.lang.Exception */ - public static void main(final String[] argv) throws Exception { + public static void main(String[] argv) throws Exception { // make sure built-in filters are registered BuiltinLFS.register(); @@ -165,7 +165,7 @@ public class Main { * arguments. * @throws java.lang.Exception */ - protected void run(final String[] argv) throws Exception { + protected void run(String[] argv) throws Exception { writer = createErrorWriter(); try { if (!installConsole()) { @@ -230,7 +230,7 @@ public class Main { return new PrintWriter(new OutputStreamWriter(System.err, CHARSET)); } - private void execute(final String[] argv) throws Exception { + private void execute(String[] argv) throws Exception { final CmdLineParser clp = new SubcommandLineParser(this); try { @@ -360,7 +360,7 @@ public class Main { } } - private static void install(final String name) + private static void install(String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException { try { diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java index 948cbc554c..3308e18f24 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java @@ -146,7 +146,7 @@ class Remote extends TextBuiltin { /** {@inheritDoc} */ @Override - public void printUsage(final String message, final CmdLineParser clp) + public void printUsage(String message, CmdLineParser clp) throws IOException { errw.println(message); errw.println("jgit remote [--verbose (-v)] [--help (-h)]"); //$NON-NLS-1$ diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevList.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevList.java index 8c88a5cdc7..101fbb27d6 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevList.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevList.java @@ -53,7 +53,7 @@ import org.eclipse.jgit.revwalk.RevTree; class RevList extends RevWalkTextBuiltin { /** {@inheritDoc} */ @Override - protected void show(final RevCommit c) throws Exception { + protected void show(RevCommit c) throws Exception { if (c.has(RevFlag.UNINTERESTING)) outw.print('-'); c.getId().copyTo(outbuffer, outw); @@ -67,7 +67,7 @@ class RevList extends RevWalkTextBuiltin { /** {@inheritDoc} */ @Override - protected void show(final ObjectWalk ow, final RevObject obj) + protected void show(ObjectWalk ow, RevObject obj) throws Exception { if (obj.has(RevFlag.UNINTERESTING)) outw.print('-'); 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 80161b4829..1178f88017 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 @@ -91,7 +91,7 @@ abstract class RevWalkTextBuiltin extends TextBuiltin { private final EnumSet sorting = EnumSet.noneOf(RevSort.class); - private void enableRevSort(final RevSort type, final boolean on) { + private void enableRevSort(RevSort type, boolean on) { if (on) sorting.add(type); else @@ -260,7 +260,7 @@ abstract class RevWalkTextBuiltin extends TextBuiltin { * The current {@link org.eclipse.jgit.revwalk.RevCommit} * @throws java.lang.Exception */ - protected abstract void show(final RevCommit c) throws Exception; + protected abstract void show(RevCommit c) throws Exception; /** * "Show" the current RevCommit when called from the main processing loop. diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java index de04045e42..fb1e6d0a50 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java @@ -167,7 +167,7 @@ class Show extends TextBuiltin { /** {@inheritDoc} */ @Override - protected void init(final Repository repository, final String gitDir) { + protected void init(Repository repository, String gitDir) { super.init(repository, gitDir); diffFmt = new DiffFormatter(new BufferedOutputStream(outs)); } @@ -273,7 +273,7 @@ class Show extends TextBuiltin { } } - private void show(RevWalk rw, final RevCommit c) throws Exception { + private void show(RevWalk rw, RevCommit c) throws Exception { char[] outbuffer = new char[Constants.OBJECT_ID_LENGTH * 2]; outw.print(CLIText.get().commitLabel); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java index 9ce8347d91..0cc5dbc47e 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java @@ -71,7 +71,7 @@ class ShowRef extends TextBuiltin { return RefComparator.sort(all); } - private void show(final AnyObjectId id, final String name) + private void show(AnyObjectId id, String name) throws IOException { outw.print(id.name()); outw.print('\t'); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java index bc3755d349..7b3854212e 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java @@ -176,7 +176,7 @@ public abstract class TextBuiltin { * value of the {@code --git-dir} command line option, if * {@code repository} is null. */ - protected void init(final Repository repository, final String gitDir) { + protected void init(Repository repository, String gitDir) { try { final String outputEncoding = repository != null ? repository .getConfig().getString("i18n", null, "logOutputEncoding") : null; //$NON-NLS-1$ //$NON-NLS-2$ @@ -239,7 +239,7 @@ public abstract class TextBuiltin { * the arguments supplied on the command line, if any. * @throws java.io.IOException */ - protected void parseArguments(final String[] args) throws IOException { + protected void parseArguments(String[] args) throws IOException { final CmdLineParser clp = new CmdLineParser(this); help = containsHelp(args); try { @@ -267,7 +267,7 @@ public abstract class TextBuiltin { * a {@link org.eclipse.jgit.pgm.opt.CmdLineParser} object. * @throws java.io.IOException */ - public void printUsageAndExit(final CmdLineParser clp) throws IOException { + public void printUsageAndExit(CmdLineParser clp) throws IOException { printUsageAndExit("", clp); //$NON-NLS-1$ } @@ -280,7 +280,7 @@ public abstract class TextBuiltin { * a {@link org.eclipse.jgit.pgm.opt.CmdLineParser} object. * @throws java.io.IOException */ - public void printUsageAndExit(final String message, final CmdLineParser clp) throws IOException { + public void printUsageAndExit(String message, CmdLineParser clp) throws IOException { printUsage(message, clp); throw die(true); } @@ -295,7 +295,7 @@ public abstract class TextBuiltin { * @throws java.io.IOException * @since 4.2 */ - protected void printUsage(final String message, final CmdLineParser clp) + protected void printUsage(String message, CmdLineParser clp) throws IOException { errw.println(message); errw.print("jgit "); //$NON-NLS-1$ @@ -375,7 +375,7 @@ public abstract class TextBuiltin { * textual explanation * @return a runtime exception the caller is expected to throw */ - protected static Die die(final String why) { + protected static Die die(String why) { return new Die(why); } @@ -388,7 +388,7 @@ public abstract class TextBuiltin { * why the command has failed. * @return a runtime exception the caller is expected to throw */ - protected static Die die(final String why, final Throwable cause) { + protected static Die die(String why, Throwable cause) { return new Die(why, cause); } @@ -416,7 +416,7 @@ public abstract class TextBuiltin { * @return a runtime exception the caller is expected to throw * @since 4.2 */ - protected static Die die(boolean aborted, final Throwable cause) { + protected static Die die(boolean aborted, Throwable cause) { return new Die(aborted, cause); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java index 127e541741..2a1326d4b8 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java @@ -65,7 +65,7 @@ class MakeCacheTree extends TextBuiltin { show(tree); } - private void show(final DirCacheTree tree) throws IOException { + private void show(DirCacheTree tree) throws IOException { outw.println(MessageFormat.format(CLIText.get().cacheTreePathInfo, tree.getPathString(), valueOf(tree.getEntrySpan()), valueOf(tree.getChildCount()))); 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 42dea219f7..a133b05379 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 @@ -258,7 +258,7 @@ class RebuildCommitGraph extends TextBuiltin { final Map refs = computeNewRefs(); new RefWriter(refs.values()) { @Override - protected void writeFile(final String name, final byte[] content) + protected void writeFile(String name, byte[] content) throws IOException { final File file = new File(db.getDirectory(), name); final LockFile lck = new LockFile(file); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java index 20fa4a3fe5..6b97e08e44 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java @@ -67,7 +67,7 @@ class ShowCacheTree extends TextBuiltin { show(tree); } - private void show(final DirCacheTree tree) throws IOException { + private void show(DirCacheTree tree) throws IOException { outw.println(MessageFormat.format(CLIText.get().cacheTreePathInfo, tree.getPathString(), valueOf(tree.getEntrySpan()), valueOf(tree.getChildCount()))); 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 6378e8d220..bb51b50487 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 @@ -499,7 +499,7 @@ class TextHashFunctions extends TextBuiltin { } } - private static int tableBits(final int sz) { + private static int tableBits(int sz) { int bits = 31 - Integer.numberOfLeadingZeros(sz); if (bits == 0) bits = 1; diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java index 6fe7927166..a14f6514fe 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java @@ -98,7 +98,7 @@ public class AbstractTreeIteratorHandler extends /** {@inheritDoc} */ @Override - public int parseArguments(final Parameters params) throws CmdLineException { + public int parseArguments(Parameters params) throws CmdLineException { final String name = params.getParameter(0); if (new File(name).isDirectory()) { 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 e071bdf839..5cc98ca8ac 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 @@ -111,7 +111,7 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser { * if the option bean class is using args4j annotations * incorrectly. */ - public CmdLineParser(final Object bean) { + public CmdLineParser(Object bean) { this(bean, null); } @@ -130,7 +130,7 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser { * if the option bean class is using args4j annotations * incorrectly. */ - public CmdLineParser(final Object bean, Repository repo) { + public CmdLineParser(Object bean, Repository repo) { super(bean); if (bean instanceof TextBuiltin) { cmd = (TextBuiltin) bean; @@ -143,7 +143,7 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser { /** {@inheritDoc} */ @Override - public void parseArgument(final String... args) throws CmdLineException { + public void parseArgument(String... args) throws CmdLineException { final ArrayList tmp = new ArrayList<>(args.length); for (int argi = 0; argi < args.length; argi++) { final String str = args[argi]; @@ -232,7 +232,7 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser { * @return true if the given array contains help option * @since 4.2 */ - protected boolean containsHelp(final String... args) { + protected boolean containsHelp(String... args) { return TextBuiltin.containsHelp(args); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java index 0e5b0f5b16..5f7e81ec78 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/ObjectIdHandler.java @@ -84,7 +84,7 @@ public class ObjectIdHandler extends OptionHandler { /** {@inheritDoc} */ @Override - public int parseArguments(final Parameters params) throws CmdLineException { + public int parseArguments(Parameters params) throws CmdLineException { final String name = params.getParameter(0); final ObjectId id; try { 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 33d669ca66..d99f88e35b 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 @@ -84,7 +84,7 @@ public class PathTreeFilterHandler extends OptionHandler { /** {@inheritDoc} */ @Override - public int parseArguments(final Parameters params) throws CmdLineException { + public int parseArguments(Parameters params) throws CmdLineException { final List filters = new ArrayList<>(); for (int idx = 0;; idx++) { final String path; diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RefSpecHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RefSpecHandler.java index dd8520af74..29577ed025 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RefSpecHandler.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RefSpecHandler.java @@ -78,7 +78,7 @@ public class RefSpecHandler extends OptionHandler { /** {@inheritDoc} */ @Override - public int parseArguments(final Parameters params) throws CmdLineException { + public int parseArguments(Parameters params) throws CmdLineException { setter.addValue(new RefSpec(params.getParameter(0))); return 1; } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java index d2fa764326..b925e31f85 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java @@ -88,7 +88,7 @@ public class RevCommitHandler extends OptionHandler { /** {@inheritDoc} */ @Override - public int parseArguments(final Parameters params) throws CmdLineException { + public int parseArguments(Parameters params) throws CmdLineException { String name = params.getParameter(0); boolean interesting = true; @@ -115,7 +115,7 @@ public class RevCommitHandler extends OptionHandler { return 1; } - private void addOne(final String name, final boolean interesting) + private void addOne(String name, boolean interesting) throws CmdLineException { final ObjectId id; try { diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java index 9444363be0..85922a27ba 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevTreeHandler.java @@ -87,7 +87,7 @@ public class RevTreeHandler extends OptionHandler { /** {@inheritDoc} */ @Override - public int parseArguments(final Parameters params) throws CmdLineException { + public int parseArguments(Parameters params) throws CmdLineException { final String name = params.getParameter(0); final ObjectId id; try { diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java index d60071f178..92eebf47f9 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/SubcommandHandler.java @@ -84,7 +84,7 @@ public class SubcommandHandler extends OptionHandler { /** {@inheritDoc} */ @Override - public int parseArguments(final Parameters params) throws CmdLineException { + public int parseArguments(Parameters params) throws CmdLineException { final String name = params.getParameter(0); final CommandRef cr = CommandCatalog.get(name); if (cr == null) 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 3f9ef12507..f26952ea76 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 @@ -147,7 +147,7 @@ public class EGitPatchHistoryTest { assertTrue("Missed files in " + cid, files.isEmpty()); } - private static void dump(final byte[] buf) { + private static void dump(byte[] buf) { String str; try { str = new String(buf, 0, buf.length - 1, "ISO-8859-1"); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java index 172807c43d..1dd329a9e7 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java @@ -64,7 +64,7 @@ public class ApplyCommandTest extends RepositoryTestCase { private RawText b; - private ApplyResult init(final String name) throws Exception { + private ApplyResult init(String name) throws Exception { return init(name, true, true); } @@ -273,7 +273,7 @@ public class ApplyCommandTest extends RepositoryTestCase { assertFalse(new File(db.getWorkTree(), "NonASCIIDel").exists()); } - private static byte[] readFile(final String patchFile) throws IOException { + private static byte[] readFile(String patchFile) throws IOException { final InputStream in = getTestResource(patchFile); if (in == null) { fail("No " + patchFile + " test vector"); @@ -291,7 +291,7 @@ public class ApplyCommandTest extends RepositoryTestCase { } } - private static InputStream getTestResource(final String patchFile) { + private static InputStream getTestResource(String patchFile) { return ApplyCommandTest.class.getClassLoader() .getResourceAsStream("org/eclipse/jgit/diff/" + patchFile); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BlameCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BlameCommandTest.java index f37aa13d6d..7a1d222ca0 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BlameCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BlameCommandTest.java @@ -136,7 +136,7 @@ public class BlameCommandTest extends RepositoryTestCase { testRename("subdir/file1.txt", "otherdir/file1.txt"); } - private void testRename(final String sourcePath, final String destPath) + private void testRename(String sourcePath, String destPath) throws Exception { try (Git git = new Git(db)) { String[] content1 = new String[] { "a", "b", "c" }; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java index 354b9c6a6f..fbc2cf67e1 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java @@ -338,7 +338,7 @@ public class CherryPickCommandTest extends RepositoryTestCase { } } - private RevCommit prepareCherryPick(final Git git) throws Exception { + private RevCommit prepareCherryPick(Git git) throws Exception { // create, add and commit file a writeTrashFile("a", "a"); git.add().addFilepattern("a").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 6f7df4bd84..9af003d424 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 @@ -1699,7 +1699,7 @@ public class MergeCommandTest extends RepositoryTestCase { .getWorkTree(), path)); } - private static RevCommit addAllAndCommit(final Git git) throws Exception { + private static RevCommit addAllAndCommit(Git git) throws Exception { git.add().addFilepattern(".").call(); return git.commit().setMessage("message").call(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java index e0c1499030..1af37e25f5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java @@ -152,7 +152,7 @@ public class PushCommandTest extends RepositoryTestCase { } } - private File writeHookFile(final String name, final String data) + private File writeHookFile(String name, String data) throws IOException { File path = new File(db.getWorkTree() + "/.git/hooks/", name); JGitTestUtil.write(path, data); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java index ea631045cc..d77c4e131e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java @@ -379,7 +379,7 @@ public class RevertCommandTest extends RepositoryTestCase { } } - private RevCommit prepareRevert(final Git git) throws Exception { + private RevCommit prepareRevert(Git git) throws Exception { // create, add and commit file a writeTrashFile("a", "a"); git.add().addFilepattern("a").call(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java index b9f9f5b499..3b582d714d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java @@ -94,7 +94,7 @@ public class StashCreateCommandTest extends RepositoryTestCase { untrackedFile = writeTrashFile("untracked.txt", "content"); } - private void validateStashedCommit(final RevCommit commit) + private void validateStashedCommit(RevCommit commit) throws IOException { validateStashedCommit(commit, 2); } @@ -140,7 +140,7 @@ public class StashCreateCommandTest extends RepositoryTestCase { return walk; } - private List diffWorkingAgainstHead(final RevCommit commit) + private List diffWorkingAgainstHead(RevCommit commit) throws IOException { try (TreeWalk walk = createTreeWalk()) { walk.addTree(commit.getParent(0).getTree()); @@ -149,7 +149,7 @@ public class StashCreateCommandTest extends RepositoryTestCase { } } - private List diffIndexAgainstHead(final RevCommit commit) + private List diffIndexAgainstHead(RevCommit commit) throws IOException { try (TreeWalk walk = createTreeWalk()) { walk.addTree(commit.getParent(0).getTree()); @@ -158,7 +158,7 @@ public class StashCreateCommandTest extends RepositoryTestCase { } } - private List diffIndexAgainstWorking(final RevCommit commit) + private List diffIndexAgainstWorking(RevCommit commit) throws IOException { try (TreeWalk walk = createTreeWalk()) { walk.addTree(commit.getParent(1).getTree()); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterReflowTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterReflowTest.java index 49e5d1b3d4..0e344f5f28 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterReflowTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterReflowTest.java @@ -146,7 +146,7 @@ public class DiffFormatterReflowTest { assertFormatted("Z.patch"); } - private void init(final String name) throws IOException { + private void init(String name) throws IOException { a = new RawText(readFile(name + "_PreImage")); b = new RawText(readFile(name + "_PostImage")); file = parseTestPatchFile(name + ".patch").getFiles().get(0); @@ -156,13 +156,13 @@ public class DiffFormatterReflowTest { assertFormatted(JGitTestUtil.getName() + ".out"); } - private void assertFormatted(final String name) throws IOException { + private void assertFormatted(String name) throws IOException { fmt.format(file, a, b); final String exp = RawParseUtils.decode(readFile(name)); assertEquals(exp, RawParseUtils.decode(out.toByteArray())); } - private byte[] readFile(final String patchFile) throws IOException { + private byte[] readFile(String patchFile) throws IOException { final InputStream in = getClass().getResourceAsStream(patchFile); if (in == null) { fail("No " + patchFile + " test vector"); @@ -180,7 +180,7 @@ public class DiffFormatterReflowTest { } } - private Patch parseTestPatchFile(final String patchFile) throws IOException { + private Patch parseTestPatchFile(String patchFile) throws IOException { try (InputStream in = getClass().getResourceAsStream(patchFile)) { if (in == null) { fail("No " + patchFile + " test vector"); 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 80d4329858..0b261840c2 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 @@ -229,7 +229,7 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { assertEquals(intentToAdd, entry.isIntentToAdd()); } - private static File pathOf(final String name) { + private static File pathOf(String name) { return JGitTestUtil.getTestResourceFile(name); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java index 05fa007904..86e2852872 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java @@ -183,7 +183,7 @@ public class DirCacheEntryTest { copyMetaDataHelper(true); } - private static void copyMetaDataHelper(final boolean keepStage) { + private static void copyMetaDataHelper(boolean keepStage) { DirCacheEntry e = new DirCacheEntry("some/path", DirCacheEntry.STAGE_2); e.setAssumeValid(false); e.setCreationTime(2L); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java index ef3e61144d..dfc136ce26 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java @@ -81,7 +81,7 @@ public class DirCacheLargePathTest extends RepositoryTestCase { testLongPath(16384); } - private void testLongPath(final int len) throws CorruptObjectException, + private void testLongPath(int len) throws CorruptObjectException, IOException { final String longPath = makeLongPath(len); final String shortPath = "~~~ shorter-path"; @@ -119,7 +119,7 @@ public class DirCacheLargePathTest extends RepositoryTestCase { } } - private static String makeLongPath(final int len) { + private static String makeLongPath(int len) { final StringBuilder r = new StringBuilder(len); for (int i = 0; i < len; i++) r.append('a' + (i % 26)); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java index 4813d28017..2895b30263 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java @@ -210,14 +210,14 @@ public class ConcurrentRepackTest extends RepositoryTestCase { config.install(); } - private RevObject parse(final AnyObjectId id) + private RevObject parse(AnyObjectId id) throws MissingObjectException, IOException { try (RevWalk rw = new RevWalk(db)) { return rw.parseAny(id); } } - private File[] pack(final Repository src, final RevObject... list) + private File[] pack(Repository src, RevObject... list) throws IOException { try (PackWriter pw = new PackWriter(src)) { for (final RevObject o : list) { @@ -233,7 +233,7 @@ public class ConcurrentRepackTest extends RepositoryTestCase { } } - private static void write(final File[] files, final PackWriter pw) + private static void write(File[] files, PackWriter pw) throws IOException { final long begin = files[0].getParentFile().lastModified(); NullProgressMonitor m = NullProgressMonitor.INSTANCE; @@ -251,7 +251,7 @@ public class ConcurrentRepackTest extends RepositoryTestCase { touch(begin, files[0].getParentFile()); } - private static void delete(final File[] list) throws IOException { + private static void delete(File[] list) throws IOException { final long begin = list[0].getParentFile().lastModified(); for (final File f : list) { FileUtils.delete(f); @@ -260,7 +260,7 @@ public class ConcurrentRepackTest extends RepositoryTestCase { touch(begin, list[0].getParentFile()); } - private static void touch(final long begin, final File dir) { + private static void touch(long begin, File dir) { while (begin >= dir.lastModified()) { try { Thread.sleep(25); @@ -271,12 +271,12 @@ public class ConcurrentRepackTest extends RepositoryTestCase { } } - private File fullPackFileName(final ObjectId name, final String suffix) { + private File fullPackFileName(ObjectId name, String suffix) { final File packdir = db.getObjectDatabase().getPackDirectory(); return new File(packdir, "pack-" + name.name() + suffix); } - private RevObject writeBlob(final Repository repo, final String data) + private RevObject writeBlob(Repository repo, String data) throws IOException { final byte[] bytes = Constants.encode(data); final ObjectId id; 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 128c1edde1..04fccf3561 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 @@ -367,7 +367,7 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { pack.write(buf, 0, n); } - private static void deflate(TemporaryBuffer.Heap pack, final byte[] content) + private static void deflate(TemporaryBuffer.Heap pack, byte[] content) throws IOException { final Deflater deflater = new Deflater(); final byte[] buf = new byte[128]; 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 3711f83656..ed427d8895 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 @@ -835,7 +835,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { verifyOpenPack(thin); } - private void createVerifyOpenPack(final List objectSource) + private void createVerifyOpenPack(List objectSource) throws MissingObjectException, IOException { NullProgressMonitor m = NullProgressMonitor.INSTANCE; writer = new PackWriter(config, db.newObjectReader()); @@ -846,7 +846,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { verifyOpenPack(false); } - private void verifyOpenPack(final boolean thin) throws IOException { + private void verifyOpenPack(boolean thin) throws IOException { final byte[] packData = os.toByteArray(); if (thin) { @@ -868,13 +868,13 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { assertNotNull("have PackFile after parsing", pack); } - private PackParser index(final byte[] packData) throws IOException { + private PackParser index(byte[] packData) throws IOException { if (inserter == null) inserter = dst.newObjectInserter(); return inserter.newPackParser(new ByteArrayInputStream(packData)); } - private void verifyObjectsOrder(final ObjectId objectsOrder[]) { + private void verifyObjectsOrder(ObjectId objectsOrder[]) { final List entries = new ArrayList<>(); for (MutableEntry me : pack) { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java index 592d0c8671..757ebb2987 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java @@ -93,13 +93,13 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase { } } - private RefUpdate updateRef(final String name) throws IOException { + private RefUpdate updateRef(String name) throws IOException { final RefUpdate ref = db.updateRef(name); ref.setNewObjectId(db.resolve(Constants.HEAD)); return ref; } - private void delete(final RefUpdate ref, final Result expected) + private void delete(RefUpdate ref, Result expected) throws IOException { delete(ref, expected, true, true); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java index 91255007ef..a549d32df9 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java @@ -747,7 +747,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase { } } - private ObjectId insertCommit(final CommitBuilder builder) + private ObjectId insertCommit(CommitBuilder builder) throws IOException, UnsupportedEncodingException { try (ObjectInserter oi = db.newObjectInserter()) { ObjectId id = oi.insert(builder); @@ -764,7 +764,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase { } } - private ObjectId insertTag(final TagBuilder tag) throws IOException, + private ObjectId insertTag(TagBuilder tag) throws IOException, UnsupportedEncodingException { try (ObjectInserter oi = db.newObjectInserter()) { ObjectId id = oi.insert(tag); 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 9ac794ed8e..bee11cd71a 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 @@ -124,7 +124,7 @@ public class WindowCacheGetTest extends SampleDataRepositoryTestCase { checkLimits(cfg); } - private static void checkLimits(final WindowCacheConfig cfg) { + private static void checkLimits(WindowCacheConfig cfg) { final WindowCache cache = WindowCache.getInstance(); assertTrue(cache.getOpenFiles() <= cfg.getPackedGitOpenFiles()); assertTrue(cache.getOpenBytes() <= cfg.getPackedGitLimit()); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java index 1684afa4e1..ae52ad5917 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java @@ -631,7 +631,7 @@ public class RefTreeDatabaseTest { name); } - private void symref(final String name, final String dst) + private void symref(String name, String dst) throws IOException { commit(new Function() { @Override @@ -648,7 +648,7 @@ public class RefTreeDatabaseTest { }); } - private void update(final String name, final ObjectId id) + private void update(String name, ObjectId id) throws IOException { commit(new Function() { @Override diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchConfigTest.java index 87bb082485..1ecdf21d45 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchConfigTest.java @@ -160,7 +160,7 @@ public class BranchConfigTest { assertTrue(new BranchConfig(c, "true").isRebase()); } - private static Config parse(final String content) { + private static Config parse(String content) { final Config c = new Config(null); try { c.fromText(content); 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 7862005ebc..c4c4da8165 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 @@ -914,12 +914,12 @@ public class ConfigTest { assertEquals(exp, c.getLong("s", null, "a", 0L)); } - private static Config parse(final String content) + private static Config parse(String content) throws ConfigInvalidException { return parse(content, null); } - private static Config parse(final String content, Config baseConfig) + private static Config parse(String content, Config baseConfig) throws ConfigInvalidException { final Config c = new Config(baseConfig); c.fromText(content); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java index 22c66cec16..b8e8a12d53 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java @@ -1607,7 +1607,7 @@ public class ObjectCheckerTest { checker.checkTree(encodeASCII(b.toString())); } - private static void entry(StringBuilder b, final String modeName) { + private static void entry(StringBuilder b, String modeName) { b.append(modeName); b.append('\0'); for (int i = 0; i < OBJECT_ID_LENGTH; i++) @@ -1647,7 +1647,7 @@ public class ObjectCheckerTest { checker.setSkipList(null); } - private static ObjectIdSet set(final ObjectId... ids) { + private static ObjectIdSet set(ObjectId... ids) { return new ObjectIdSet() { @Override public boolean contains(AnyObjectId objectId) { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java index d431a8910b..87e901fcfe 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java @@ -51,7 +51,7 @@ import org.eclipse.jgit.util.SystemReader; import org.junit.Test; public class ValidRefNameTest { - private static void assertValid(final boolean exp, final String name) { + private static void assertValid(boolean exp, String name) { SystemReader instance = SystemReader.getInstance(); try { setUnixSystemReader(); @@ -81,7 +81,7 @@ public class ValidRefNameTest { }); } - private static void assertInvalidOnWindows(final String name) { + private static void assertInvalidOnWindows(String name) { SystemReader instance = SystemReader.getInstance(); try { setUnixSystemReader(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java index 4948b373d0..19f6dcbc59 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java @@ -183,7 +183,7 @@ public class CherryPickTest extends RepositoryTestCase { assertFalse(tw.next()); } - private static void assertCorrectId(final DirCache treeT, final TreeWalk tw) { + private static void assertCorrectId(DirCache treeT, TreeWalk tw) { assertEquals(treeT.getEntry(tw.getPathString()).getObjectId(), tw .getObjectId(0)); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CrissCrossMergeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CrissCrossMergeTest.java index ee99aa1379..aaa08a9e31 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CrissCrossMergeTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CrissCrossMergeTest.java @@ -783,7 +783,7 @@ public class CrissCrossMergeTest extends RepositoryTestCase { } } - private void setIndex(final ObjectId id, String path) + private void setIndex(ObjectId id, String path) throws MissingObjectException, IOException { DirCache lockedDircache; DirCacheEditor dcedit; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java index 951568e7bb..dd2c2e84b6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java @@ -403,7 +403,7 @@ public class SimpleMergeTest extends SampleDataRepositoryTestCase { assertFalse(merge); } - private static void assertCorrectId(final DirCache treeT, final TreeWalk tw) { + private static void assertCorrectId(DirCache treeT, TreeWalk tw) { assertEquals(treeT.getEntry(tw.getPathString()).getObjectId(), tw .getObjectId(0)); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/EditListTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/EditListTest.java index 6027aff716..6c107f983d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/EditListTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/EditListTest.java @@ -89,7 +89,7 @@ public class EditListTest { assertEquals(new Edit(23 - 1, 25 - 1, 22 - 1, 28 - 1), e.get(2)); } - private Patch parseTestPatchFile(final String patchFile) throws IOException { + private Patch parseTestPatchFile(String patchFile) throws IOException { try (InputStream in = getClass().getResourceAsStream(patchFile)) { if (in == null) { fail("No " + patchFile + " test vector"); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/FileHeaderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/FileHeaderTest.java index 7b4e014449..24fbda1adb 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/FileHeaderTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/FileHeaderTest.java @@ -433,30 +433,30 @@ public class FileHeaderTest { assertTrue(ObjectId.fromString(nid).startsWith(fh.getNewId())); } - private static void assertParse(final FileHeader fh) { + private static void assertParse(FileHeader fh) { int ptr = fh.parseGitFileName(0, fh.buf.length); assertTrue(ptr > 0); ptr = fh.parseGitHeaders(ptr, fh.buf.length); assertTrue(ptr > 0); } - private static FileHeader data(final String in) { + private static FileHeader data(String in) { return new FileHeader(Constants.encodeASCII(in), 0); } - private static FileHeader header(final String path) { + private static FileHeader header(String path) { return data(gitLine(path) + "--- " + path + "\n"); } - private static String gitLine(final String path) { + private static String gitLine(String path) { return "a/" + path + " b/" + path + "\n"; } - private static FileHeader dqHeader(final String path) { + private static FileHeader dqHeader(String path) { return data(dqGitLine(path) + "--- " + path + "\n"); } - private static String dqGitLine(final String path) { + private static String dqGitLine(String path) { return "\"a/" + path + "\" \"b/" + path + "\"\n"; } } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java index 8da199f7c6..7b5868a393 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/GetTextTest.java @@ -134,7 +134,7 @@ public class GetTextTest { } } - private String readTestPatchFile(final Charset cs) throws IOException { + private String readTestPatchFile(Charset cs) throws IOException { final String patchFile = JGitTestUtil.getName() + ".patch"; try (InputStream in = getClass().getResourceAsStream(patchFile)) { if (in == null) { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java index 87c8547812..ad8327ff4e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java @@ -353,7 +353,7 @@ public class FooterLineTest extends RepositoryTestCase { assertFalse("not CC", line.matches(FooterKey.CC)); } - private RevCommit parse(final String msg) throws IOException { + private RevCommit parse(String msg) throws IOException { final StringBuilder buf = new StringBuilder(); buf.append("tree " + ObjectId.zeroId().name() + "\n"); buf.append("author A. U. Thor 1 +0000\n"); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java index 9fc96212c7..cfefac3aa1 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java @@ -138,7 +138,7 @@ public class RevCommitParseTest extends RepositoryTestCase { assertEquals(TimeZone.getTimeZone("GMT" + committerTimeZone), cCommitter.getTimeZone()); } - private RevCommit create(final String msg) throws Exception { + private RevCommit create(String msg) throws Exception { final StringBuilder b = new StringBuilder(); b.append("tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\n"); b.append("author A U. Thor 1218123387 +0700\n"); @@ -483,7 +483,7 @@ public class RevCommitParseTest extends RepositoryTestCase { assertEquals(shortMsg, c.getShortMessage()); } - private static ObjectId id(final String str) { + private static ObjectId id(String str) { return ObjectId.fromString(str); } } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java index 8e9507961b..e11cef7c92 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java @@ -82,7 +82,7 @@ public class RevTagParseTest extends RepositoryTestCase { testOneType(Constants.OBJ_TAG); } - private void testOneType(final int typeCode) throws Exception { + private void testOneType(int typeCode) throws Exception { final ObjectId id = id("9788669ad918b6fcce64af8882fc9a81cb6aba67"); final StringBuilder b = new StringBuilder(); b.append("object " + id.name() + "\n"); @@ -202,7 +202,7 @@ public class RevTagParseTest extends RepositoryTestCase { assertNull(c.getTaggerIdent()); } - private RevTag create(final String msg) throws Exception { + private RevTag create(String msg) throws Exception { final StringBuilder b = new StringBuilder(); b.append("object 9788669ad918b6fcce64af8882fc9a81cb6aba67\n"); b.append("type tree\n"); @@ -480,7 +480,7 @@ public class RevTagParseTest extends RepositoryTestCase { assertEquals(src.getMessage(), p.getFullMessage()); } - private static ObjectId id(final String str) { + private static ObjectId id(String str) { return ObjectId.fromString(str); } } 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 ab2705cbec..70050270d3 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 @@ -75,7 +75,7 @@ public class RevWalkFollowFilterTest extends RevWalkTestCase { diffCollector = new DiffCollector(); } - protected FollowFilter follow(final String followPath) { + protected FollowFilter follow(String followPath) { FollowFilter followFilter = FollowFilter.create(followPath, new Config().get(DiffConfig.KEY)); followFilter.setRenameCallback(diffCollector); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter1Test.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter1Test.java index 6ec529c319..b55a45aa6c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter1Test.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter1Test.java @@ -54,7 +54,7 @@ import org.eclipse.jgit.treewalk.filter.TreeFilter; import org.junit.Test; public class RevWalkPathFilter1Test extends RevWalkTestCase { - protected void filter(final String path) { + protected void filter(String path) { rw.setTreeFilter(AndTreeFilter.create(PathFilterGroup .createFromStrings(Collections.singleton(path)), TreeFilter.ANY_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 631e3956fc..70b4e154ad 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 @@ -102,7 +102,7 @@ public class RevWalkPathFilter6012Test extends RevWalkTestCase { } } - protected void check(final RevCommit... order) throws Exception { + protected void check(RevCommit... order) throws Exception { markStart(i); final StringBuilder act = new StringBuilder(); for (final RevCommit z : rw) { @@ -121,7 +121,7 @@ public class RevWalkPathFilter6012Test extends RevWalkTestCase { assertEquals(exp.toString(), act.toString()); } - protected void filter(final String path) { + protected void filter(String path) { rw.setTreeFilter(AndTreeFilter.create(PathFilterGroup .createFromStrings(Collections.singleton(path)), TreeFilter.ANY_DIFF)); 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 f12cc0872f..544398219f 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 @@ -74,38 +74,38 @@ public abstract class RevWalkTestCase extends RepositoryTestCase { return util.getDate(); } - protected void tick(final int secDelta) { + protected void tick(int secDelta) { util.tick(secDelta); } - protected RevBlob blob(final String content) throws Exception { + protected RevBlob blob(String content) throws Exception { return util.blob(content); } - protected DirCacheEntry file(final String path, final RevBlob blob) + protected DirCacheEntry file(String path, RevBlob blob) throws Exception { return util.file(path, blob); } - protected RevTree tree(final DirCacheEntry... entries) throws Exception { + protected RevTree tree(DirCacheEntry... entries) throws Exception { return util.tree(entries); } - protected RevObject get(final RevTree tree, final String path) + protected RevObject get(RevTree tree, String path) throws Exception { return util.get(tree, path); } - protected RevCommit commit(final RevCommit... parents) throws Exception { + protected RevCommit commit(RevCommit... parents) throws Exception { return util.commit(parents); } - protected RevCommit commit(final RevTree tree, final RevCommit... parents) + protected RevCommit commit(RevTree tree, RevCommit... parents) throws Exception { return util.commit(tree, parents); } - protected RevCommit commit(final int secDelta, final RevCommit... parents) + protected RevCommit commit(int secDelta, RevCommit... parents) throws Exception { return util.commit(secDelta, parents); } @@ -115,7 +115,7 @@ public abstract class RevWalkTestCase extends RepositoryTestCase { return util.commit(secDelta, tree, parents); } - protected RevTag tag(final String name, final RevObject dst) + protected RevTag tag(String name, RevObject dst) throws Exception { return util.tag(name, dst); } @@ -125,19 +125,19 @@ public abstract class RevWalkTestCase extends RepositoryTestCase { return util.commit(); } - protected T parseBody(final T t) throws Exception { + protected T parseBody(T t) throws Exception { return util.parseBody(t); } - protected void markStart(final RevCommit commit) throws Exception { + protected void markStart(RevCommit commit) throws Exception { rw.markStart(commit); } - protected void markUninteresting(final RevCommit commit) throws Exception { + protected void markUninteresting(RevCommit commit) throws Exception { rw.markUninteresting(commit); } - protected void assertCommit(final RevCommit exp, final RevCommit act) { + protected void assertCommit(RevCommit exp, RevCommit act) { assertSame(exp, act); } } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java index 10bea0a8b5..a26ae10af3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java @@ -109,7 +109,7 @@ public class RevWalkUtilsReachableTest extends RevWalkTestCase { } } - private Ref branch(final String name, final RevCommit dst) throws Exception { + private Ref branch(String name, RevCommit dst) throws Exception { return Git.wrap(db).branchCreate().setName(name) .setStartPoint(dst.name()).call(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java index 76404aba91..4e5d56acb2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java @@ -74,7 +74,7 @@ public class NetRCTest extends RepositoryTestCase { configFile = new File(home, ".netrc"); } - private void config(final String data) throws IOException { + private void config(String data) throws IOException { try (OutputStreamWriter fw = new OutputStreamWriter( new FileOutputStream(configFile), CHARSET)) { fw.write(data); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java index 886f577d98..abf80ecd4d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java @@ -90,7 +90,7 @@ public class OpenSshConfigTest extends RepositoryTestCase { osc = new OpenSshConfig(home, configFile); } - private void config(final String data) throws IOException { + private void config(String data) throws IOException { long lastMtime = configFile.lastModified(); do { try (final OutputStreamWriter fw = new OutputStreamWriter( diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineInTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineInTest.java index 982bae8394..8b1d860059 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineInTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineInTest.java @@ -326,7 +326,7 @@ public class PacketLineInTest { // test support - private void init(final String msg) { + private void init(String msg) { rawIn = new ByteArrayInputStream(Constants.encodeASCII(msg)); in = new PacketLineIn(rawIn); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineOutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineOutTest.java index dd9a0d3bb5..391a701b8e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineOutTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PacketLineOutTest.java @@ -173,7 +173,7 @@ public class PacketLineOutTest { assertEquals(1, flushCnt[0]); } - private void assertBuffer(final String exp) throws IOException { + private void assertBuffer(String exp) throws IOException { assertEquals(exp, new String(rawOut.toByteArray(), Constants.CHARACTER_ENCODING)); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/RemoteConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/RemoteConfigTest.java index a0cf0d2dbc..9aabd71d97 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/RemoteConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/RemoteConfigTest.java @@ -67,12 +67,12 @@ public class RemoteConfigTest { config = new Config(); } - private void readConfig(final String dat) throws ConfigInvalidException { + private void readConfig(String dat) throws ConfigInvalidException { config = new Config(); config.fromText(dat); } - private void checkConfig(final String exp) { + private void checkConfig(String exp) { assertEquals(exp, config.toText()); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java index 4571619603..4d3e162240 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java @@ -259,7 +259,7 @@ public class SideBandOutputStreamTest { } } - private void assertBuffer(final String exp) throws IOException { + private void assertBuffer(String exp) throws IOException { assertEquals(exp, new String(rawOut.toByteArray(), Constants.CHARACTER_ENCODING)); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/CanonicalTreeParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/CanonicalTreeParserTest.java index f5e97c2dc2..57eec0b58e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/CanonicalTreeParserTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/CanonicalTreeParserTest.java @@ -91,7 +91,7 @@ public class CanonicalTreeParserTest { hash_sometree), entry(m644, "foo", hash_foo)); } - private static byte[] mktree(final byte[]... data) throws Exception { + private static byte[] mktree(byte[]... data) throws Exception { final ByteArrayOutputStream out = new ByteArrayOutputStream(); for (final byte[] e : data) out.write(e); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java index e34cb97798..0e009b9540 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java @@ -821,7 +821,7 @@ public class FileTreeIteratorTest extends RepositoryTestCase { assertEquals(sha1string, tw.getObjectId(1).getName() /* 1=filetree here */); } - private static String nameOf(final AbstractTreeIterator i) { + private static String nameOf(AbstractTreeIterator i) { return RawParseUtils.decode(Constants.CHARSET, i.path, 0, i.pathLen); } } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java index 717a2f3b2c..fc79d4586d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java @@ -93,7 +93,7 @@ public class FileTreeIteratorWithTimeControl extends FileTreeIterator { } @Override - public AbstractTreeIterator createSubtreeIterator(final ObjectReader reader) { + public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) { return new FileTreeIteratorWithTimeControl(this, ((FileEntry) current()).getFile(), fs, modTimes); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java index 6ad47c2956..87fe00b1c6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java @@ -180,7 +180,7 @@ public class PostOrderTreeWalkTest extends RepositoryTestCase { } } - private DirCacheEntry makeFile(final String path) throws Exception { + private DirCacheEntry makeFile(String path) throws Exception { return createEntry(path, REGULAR_FILE); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/AlwaysCloneTreeFilter.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/AlwaysCloneTreeFilter.java index 8e2cca44ae..d9cfb622a8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/AlwaysCloneTreeFilter.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/AlwaysCloneTreeFilter.java @@ -52,7 +52,7 @@ class AlwaysCloneTreeFilter extends TreeFilter { } @Override - public boolean include(final TreeWalk walker) { + public boolean include(TreeWalk walker) { return false; } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java index 6fed233051..81467c2d01 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java @@ -680,15 +680,15 @@ public class ChangeIdUtilTest { "\n")); } - private void hookDoesNotModify(final String in) throws Exception { + private void hookDoesNotModify(String in) throws Exception { assertEquals(in, call(in)); } - private String call(final String body) throws Exception { + private String call(String body) throws Exception { return call(body, false); } - private String call(final String body, boolean replaceExisting) throws Exception { + private String call(String body, boolean replaceExisting) throws Exception { ObjectId computeChangeId = ChangeIdUtil.computeChangeId(treeId1, parentId1, author, committer, body); if (computeChangeId == null) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java index a680ef9f9c..e34c3cebd6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java @@ -241,7 +241,7 @@ public class HookTest extends RepositoryTestCase { } } - private File writeHookFile(final String name, final String data) + private File writeHookFile(String name, String data) throws IOException { File path = new File(db.getWorkTree() + "/.git/hooks/", name); JGitTestUtil.write(path, data); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/NBTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/NBTest.java index d2d44ffdc8..830f20e5c3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/NBTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/NBTest.java @@ -338,7 +338,7 @@ public class NBTest { assertOutput(b(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff), out, 3); } - private static void prepareOutput(final byte[] buf) { + private static void prepareOutput(byte[] buf) { for (int i = 0; i < buf.length; i++) buf[i] = (byte) (0x77 + i); } @@ -353,11 +353,11 @@ public class NBTest { assertEquals((byte) (0x77 + i), buf[i]); } - private static byte[] b(final int a, final int b) { + private static byte[] b(int a, int b) { return new byte[] { (byte) a, (byte) b }; } - private static byte[] padb(final int len, final int a, final int b) { + private static byte[] padb(int len, int a, int b) { final byte[] r = new byte[len + 2]; for (int i = 0; i < len; i++) r[i] = (byte) 0xaf; @@ -370,7 +370,7 @@ public class NBTest { return new byte[] { (byte) a, (byte) b, (byte) c }; } - private static byte[] b(final int a, final int b, final int c, final int d) { + private static byte[] b(int a, int b, int c, int d) { return new byte[] { (byte) a, (byte) b, (byte) c, (byte) d }; } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringBourneStyleTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringBourneStyleTest.java index 65078763e7..49ad55f42d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringBourneStyleTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringBourneStyleTest.java @@ -52,14 +52,14 @@ import org.eclipse.jgit.lib.Constants; import org.junit.Test; public class QuotedStringBourneStyleTest { - private static void assertQuote(final String in, final String exp) { + private static void assertQuote(String in, String exp) { final String r = BOURNE.quote(in); assertNotSame(in, r); assertFalse(in.equals(r)); assertEquals('\'' + exp + '\'', r); } - private static void assertDequote(final String exp, final String in) { + private static void assertDequote(String exp, String in) { final byte[] b = Constants.encode('\'' + in + '\''); final String r = BOURNE.dequote(b, 0, b.length); assertEquals(exp, r); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringBourneUserPathStyleTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringBourneUserPathStyleTest.java index 7463528b56..17f1b77e0b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringBourneUserPathStyleTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringBourneUserPathStyleTest.java @@ -52,14 +52,14 @@ import org.eclipse.jgit.lib.Constants; import org.junit.Test; public class QuotedStringBourneUserPathStyleTest { - private static void assertQuote(final String in, final String exp) { + private static void assertQuote(String in, String exp) { final String r = BOURNE_USER_PATH.quote(in); assertNotSame(in, r); assertFalse(in.equals(r)); assertEquals('\'' + exp + '\'', r); } - private static void assertDequote(final String exp, final String in) { + private static void assertDequote(String exp, String in) { final byte[] b = Constants.encode('\'' + in + '\''); final String r = BOURNE_USER_PATH.dequote(b, 0, b.length); assertEquals(exp, r); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringGitPathStyleTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringGitPathStyleTest.java index a6f33451ce..9a0c96e171 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringGitPathStyleTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/QuotedStringGitPathStyleTest.java @@ -54,14 +54,14 @@ import org.eclipse.jgit.lib.Constants; import org.junit.Test; public class QuotedStringGitPathStyleTest { - private static void assertQuote(final String exp, final String in) { + private static void assertQuote(String exp, String in) { final String r = GIT_PATH.quote(in); assertNotSame(in, r); assertFalse(in.equals(r)); assertEquals('"' + exp + '"', r); } - private static void assertDequote(final String exp, final String in) { + private static void assertDequote(String exp, String in) { final byte[] b = ('"' + in + '"').getBytes(ISO_8859_1); final String r = GIT_PATH.dequote(b, 0, b.length); assertEquals(exp, r); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_HexParseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_HexParseTest.java index f5b56e7b78..f3c046d4a9 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_HexParseTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_HexParseTest.java @@ -81,7 +81,7 @@ public class RawParseUtils_HexParseTest { assertNotHex('.'); } - private static void assertNotHex(final char c) { + private static void assertNotHex(char c) { try { RawParseUtils.parseHexInt4((byte) c); fail("Incorrectly acccepted " + c); 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 5a1468a8b6..d124d7365c 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 @@ -456,7 +456,7 @@ public class RefListTest { return b.toRefList(); } - private static Ref newRef(final String name) { + private static Ref newRef(String name) { return new ObjectIdRef.Unpeeled(Ref.Storage.LOOSE, name, ID); } } diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java index bccf0c02fe..dcf27b4a7d 100644 --- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java +++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java @@ -125,7 +125,7 @@ final class AWTPlotRenderer extends AbstractPlotRenderer /** {@inheritDoc} */ @Override - protected void drawText(final String msg, final int x, final int y) { + protected void drawText(String msg, int x, int y) { final int texth = g.getFontMetrics().getHeight(); final int y0 = (y - texth) / 2 + (cell.getHeight() - texth) / 2; g.setColor(cell.getForeground()); @@ -134,7 +134,7 @@ final class AWTPlotRenderer extends AbstractPlotRenderer /** {@inheritDoc} */ @Override - protected Color laneColor(final SwingLane myLane) { + protected Color laneColor(SwingLane myLane) { return myLane != null ? myLane.color : Color.black; } diff --git a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java index d122a7728b..3f9217d1c3 100644 --- a/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java +++ b/org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java @@ -114,7 +114,7 @@ public class CommitGraphPane extends JTable { /** {@inheritDoc} */ @Override - public void setModel(final TableModel dataModel) { + public void setModel(TableModel dataModel) { if (dataModel != null && !(dataModel instanceof CommitTableModel)) throw new ClassCastException(UIText.get().mustBeSpecialTableModel); super.setModel(dataModel); @@ -161,7 +161,7 @@ public class CommitGraphPane extends JTable { } @Override - public Object getValueAt(final int rowIndex, final int columnIndex) { + public Object getValueAt(int rowIndex, int columnIndex) { final PlotCommit c = allCommits.get(rowIndex); switch (columnIndex) { case 0: @@ -244,7 +244,7 @@ public class CommitGraphPane extends JTable { } @Override - protected void paintComponent(final Graphics inputGraphics) { + protected void paintComponent(Graphics inputGraphics) { if (inputGraphics == null) return; renderer.paint(inputGraphics, commit); 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 743eb7839b..10519ca9ca 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 @@ -79,7 +79,7 @@ class SwingCommitList extends PlotCommitList { /** {@inheritDoc} */ @Override - protected void recycleLane(final SwingLane lane) { + protected void recycleLane(SwingLane lane) { colors.add(lane.color); } 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 f45e39e069..65b72f7d95 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java @@ -288,7 +288,7 @@ public class CherryPickCommand extends GitCommand { * @return {@code this} * @since 3.1 */ - public CherryPickCommand setReflogPrefix(final String prefix) { + public CherryPickCommand setReflogPrefix(String prefix) { this.reflogPrefix = prefix; return this; } 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 6084375e37..a05d962553 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java @@ -306,7 +306,7 @@ public class CloneCommand extends TransportCommand { return command.call(); } - private List calculateRefSpecs(final String dst) { + private List calculateRefSpecs(String dst) { RefSpec wcrs = new RefSpec(); wcrs = wcrs.setForceUpdate(true); wcrs = wcrs.setSourceDestination(Constants.R_HEADS + "*", dst); //$NON-NLS-1$ @@ -440,7 +440,7 @@ public class CloneCommand extends TransportCommand { clonedRepo.getConfig().save(); } - private RevCommit parseCommit(final Repository clonedRepo, final Ref ref) + private RevCommit parseCommit(Repository clonedRepo, Ref ref) throws MissingObjectException, IncorrectObjectTypeException, IOException { final RevCommit commit; 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 be446f9447..31987036a5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java @@ -245,7 +245,7 @@ public class ResetCommand extends GitCommand { } } - private RevCommit parseCommit(final ObjectId commitId) { + private RevCommit parseCommit(ObjectId commitId) { try (RevWalk rw = new RevWalk(repo)) { return rw.parseCommit(commitId); } catch (IOException e) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java index 5f7928d4d8..01d070cbd9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java @@ -111,7 +111,7 @@ public class StashApplyCommand extends GitCommand { * the {@link org.eclipse.jgit.lib.Repository} to apply the stash * to */ - public StashApplyCommand(final Repository repo) { + public StashApplyCommand(Repository repo) { super(repo); } @@ -125,7 +125,7 @@ public class StashApplyCommand extends GitCommand { * name of the stash {@code Ref} to apply * @return {@code this} */ - public StashApplyCommand setStashRef(final String stashRef) { + public StashApplyCommand setStashRef(String stashRef) { this.stashRef = stashRef; return this; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java index cd8f8e6c96..7f02aabc0a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java @@ -107,7 +107,7 @@ public class StashDropCommand extends GitCommand { * the 0-based index of the stash reference * @return {@code this} */ - public StashDropCommand setStashRef(final int stashRef) { + public StashDropCommand setStashRef(int stashRef) { if (stashRef < 0) throw new IllegalArgumentException(); @@ -124,7 +124,7 @@ public class StashDropCommand extends GitCommand { * {@link #setStashRef(int)} * @return {@code this} */ - public StashDropCommand setAll(final boolean all) { + public StashDropCommand setAll(boolean all) { this.all = all; return this; } @@ -138,7 +138,7 @@ public class StashDropCommand extends GitCommand { } } - private RefUpdate createRefUpdate(final Ref stashRef) throws IOException { + private RefUpdate createRefUpdate(Ref stashRef) throws IOException { RefUpdate update = repo.updateRef(R_STASH); update.disableRefLog(); update.setExpectedOldObjectId(stashRef.getObjectId()); @@ -146,7 +146,7 @@ public class StashDropCommand extends GitCommand { return update; } - private void deleteRef(final Ref stashRef) { + private void deleteRef(Ref stashRef) { try { Result result = createRefUpdate(stashRef).delete(); if (Result.FORCED != result) 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 6451b709f0..f316b2366f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java @@ -72,7 +72,7 @@ public class StashListCommand extends GitCommand> { * * @param repo a {@link org.eclipse.jgit.lib.Repository} object. */ - public StashListCommand(final Repository repo) { + public StashListCommand(Repository repo) { super(repo); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java index 1aa050f560..9538d2be6c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java @@ -88,7 +88,7 @@ public class SubmoduleAddCommand extends * @param repo * a {@link org.eclipse.jgit.lib.Repository} object. */ - public SubmoduleAddCommand(final Repository repo) { + public SubmoduleAddCommand(Repository repo) { super(repo); } @@ -99,7 +99,7 @@ public class SubmoduleAddCommand extends * (with / as separator) * @return this command */ - public SubmoduleAddCommand setPath(final String path) { + public SubmoduleAddCommand setPath(String path) { this.path = path; return this; } @@ -111,7 +111,7 @@ public class SubmoduleAddCommand extends * a {@link java.lang.String} object. * @return this command */ - public SubmoduleAddCommand setURI(final String uri) { + public SubmoduleAddCommand setURI(String uri) { this.uri = uri; return this; } @@ -125,7 +125,7 @@ public class SubmoduleAddCommand extends * a {@link org.eclipse.jgit.lib.ProgressMonitor} object. * @return this command */ - public SubmoduleAddCommand setProgressMonitor(final ProgressMonitor monitor) { + public SubmoduleAddCommand setProgressMonitor(ProgressMonitor monitor) { this.monitor = monitor; 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 6af27d704c..2db12b8e25 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java @@ -77,7 +77,7 @@ public class SubmoduleInitCommand extends GitCommand> { * @param repo * a {@link org.eclipse.jgit.lib.Repository} object. */ - public SubmoduleInitCommand(final Repository repo) { + public SubmoduleInitCommand(Repository repo) { super(repo); paths = new ArrayList<>(); } @@ -89,7 +89,7 @@ public class SubmoduleInitCommand extends GitCommand> { * (with / as separator) * @return this command */ - public SubmoduleInitCommand addPath(final String path) { + public SubmoduleInitCommand addPath(String path) { paths.add(path); return this; } 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 5c21864202..0606c5b8d4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java @@ -77,7 +77,7 @@ public class SubmoduleStatusCommand extends * @param repo * a {@link org.eclipse.jgit.lib.Repository} object. */ - public SubmoduleStatusCommand(final Repository repo) { + public SubmoduleStatusCommand(Repository repo) { super(repo); paths = new ArrayList<>(); } @@ -89,7 +89,7 @@ public class SubmoduleStatusCommand extends * (with / as separator) * @return this command */ - public SubmoduleStatusCommand addPath(final String path) { + public SubmoduleStatusCommand addPath(String path) { paths.add(path); return this; } 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 462543d3bb..7cf4b73af0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java @@ -79,7 +79,7 @@ public class SubmoduleSyncCommand extends GitCommand> { * @param repo * a {@link org.eclipse.jgit.lib.Repository} object. */ - public SubmoduleSyncCommand(final Repository repo) { + public SubmoduleSyncCommand(Repository repo) { super(repo); paths = new ArrayList<>(); } @@ -91,7 +91,7 @@ public class SubmoduleSyncCommand extends GitCommand> { * (with / as separator) * @return this command */ - public SubmoduleSyncCommand addPath(final String path) { + public SubmoduleSyncCommand addPath(String path) { paths.add(path); return this; } @@ -104,7 +104,7 @@ public class SubmoduleSyncCommand extends GitCommand> { * @return shortened branch name, null on failures * @throws java.io.IOException */ - protected String getHeadBranch(final Repository subRepo) throws IOException { + protected String getHeadBranch(Repository subRepo) throws IOException { Ref head = subRepo.exactRef(Constants.HEAD); if (head != null && head.isSymbolic()) return Repository.shortenRefName(head.getLeaf().getName()); 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 289ef4a8f5..398f21ebce 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java @@ -103,7 +103,7 @@ public class SubmoduleUpdateCommand extends * @param repo * a {@link org.eclipse.jgit.lib.Repository} object. */ - public SubmoduleUpdateCommand(final Repository repo) { + public SubmoduleUpdateCommand(Repository repo) { super(repo); paths = new ArrayList<>(); } @@ -132,7 +132,7 @@ public class SubmoduleUpdateCommand extends * @return this command * @since 4.9 */ - public SubmoduleUpdateCommand setFetch(final boolean fetch) { + public SubmoduleUpdateCommand setFetch(boolean fetch) { this.fetch = fetch; return this; } @@ -144,7 +144,7 @@ public class SubmoduleUpdateCommand extends * (with / as separator) * @return this command */ - public SubmoduleUpdateCommand addPath(final String path) { + public SubmoduleUpdateCommand addPath(String path) { paths.add(path); return this; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/TransportCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/TransportCommand.java index 9c915377d0..d34bb5d4cf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/TransportCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/TransportCommand.java @@ -80,7 +80,7 @@ public abstract class TransportCommand extends * * @param repo a {@link org.eclipse.jgit.lib.Repository} object. */ - protected TransportCommand(final Repository repo) { + protected TransportCommand(Repository repo) { super(repo); setCredentialsProvider(CredentialsProvider.getDefault()); } @@ -147,7 +147,7 @@ public abstract class TransportCommand extends * a {@link org.eclipse.jgit.transport.Transport} object. * @return {@code this} */ - protected C configure(final Transport transport) { + protected C configure(Transport transport) { if (credentialsProvider != null) transport.setCredentialsProvider(credentialsProvider); transport.setTimeout(timeout); @@ -164,7 +164,7 @@ public abstract class TransportCommand extends * a {@link org.eclipse.jgit.api.TransportCommand} object. * @return {@code this} */ - protected C configure(final TransportCommand childCommand) { + protected C configure(TransportCommand childCommand) { childCommand.setCredentialsProvider(credentialsProvider); childCommand.setTimeout(timeout); childCommand.setTransportConfigCallback(transportConfigCallback); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/AbortedByHookException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/AbortedByHookException.java old mode 100755 new mode 100644 diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/StashApplyFailureException.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/StashApplyFailureException.java index 517b512664..b12c032f88 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/StashApplyFailureException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/errors/StashApplyFailureException.java @@ -26,7 +26,7 @@ public class StashApplyFailureException extends GitAPIException { * @param message * error message */ - public StashApplyFailureException(final String message) { + public StashApplyFailureException(String message) { super(message); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java index 063cefffa6..21dca6b78c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java @@ -76,7 +76,7 @@ public class DiffConfig { private final int renameLimit; - private DiffConfig(final Config rc) { + private DiffConfig(Config rc) { noPrefix = rc.getBoolean(ConfigConstants.CONFIG_DIFF_SECTION, ConfigConstants.CONFIG_KEY_NOPREFIX, false); renameDetectionType = parseRenameDetectionType(rc.getString( diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java index 2e29b81779..7aaa50030f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java @@ -222,7 +222,7 @@ public class DiffFormatter implements AutoCloseable { * modification and after the last modification within a hunk of * the modified file. */ - public void setContext(final int lineCount) { + public void setContext(int lineCount) { if (lineCount < 0) throw new IllegalArgumentException( JGitText.get().contextMustBeNonNegative); @@ -235,7 +235,7 @@ public class DiffFormatter implements AutoCloseable { * @param count * number of digits to show in an ObjectId. */ - public void setAbbreviationLength(final int count) { + public void setAbbreviationLength(int count) { if (count < 0) throw new IllegalArgumentException( JGitText.get().abbreviationLengthMustBeNonNegative); @@ -742,7 +742,7 @@ public class DiffFormatter implements AutoCloseable { * @throws java.io.IOException * writing to the supplied stream failed. */ - public void format(final FileHeader head, final RawText a, final RawText b) + public void format(FileHeader head, RawText a, RawText b) throws IOException { // Reuse the existing FileHeader as-is by blindly copying its // header lines, but avoiding its hunks. Instead we recreate @@ -768,7 +768,7 @@ public class DiffFormatter implements AutoCloseable { * the text B which was compared * @throws java.io.IOException */ - public void format(final EditList edits, final RawText a, final RawText b) + public void format(EditList edits, RawText a, RawText b) throws IOException { for (int curIdx = 0; curIdx < edits.size();) { Edit curEdit = edits.get(curIdx); @@ -816,12 +816,12 @@ public class DiffFormatter implements AutoCloseable { * the line number within text * @throws java.io.IOException */ - protected void writeContextLine(final RawText text, final int line) + protected void writeContextLine(RawText text, int line) throws IOException { writeLine(' ', text, line); } - private static boolean isEndOfLineMissing(final RawText text, final int line) { + private static boolean isEndOfLineMissing(RawText text, int line) { return line + 1 == text.size() && text.isMissingNewlineAtEnd(); } @@ -834,7 +834,7 @@ public class DiffFormatter implements AutoCloseable { * the line number within text * @throws java.io.IOException */ - protected void writeAddedLine(final RawText text, final int line) + protected void writeAddedLine(RawText text, int line) throws IOException { writeLine('+', text, line); } @@ -848,7 +848,7 @@ public class DiffFormatter implements AutoCloseable { * the line number within text * @throws java.io.IOException */ - protected void writeRemovedLine(final RawText text, final int line) + protected void writeRemovedLine(RawText text, int line) throws IOException { writeLine('-', text, line); } @@ -878,7 +878,7 @@ public class DiffFormatter implements AutoCloseable { out.write('\n'); } - private void writeRange(final char prefix, final int begin, final int cnt) + private void writeRange(char prefix, int begin, int cnt) throws IOException { out.write(' '); out.write(prefix); @@ -1213,7 +1213,7 @@ public class DiffFormatter implements AutoCloseable { o.write(encode("+++ " + newp + "\n")); //$NON-NLS-1$ //$NON-NLS-2$ } - private int findCombinedEnd(final List edits, final int i) { + private int findCombinedEnd(List edits, int i) { int end = i + 1; while (end < edits.size() && (combineA(edits, end) || combineB(edits, end))) @@ -1221,15 +1221,15 @@ public class DiffFormatter implements AutoCloseable { return end - 1; } - private boolean combineA(final List e, final int i) { + private boolean combineA(List e, int i) { return e.get(i).getBeginA() - e.get(i - 1).getEndA() <= 2 * context; } - private boolean combineB(final List e, final int i) { + private boolean combineB(List e, int i) { return e.get(i).getBeginB() - e.get(i - 1).getEndB() <= 2 * context; } - private static boolean end(final Edit edit, final int a, final int b) { + private static boolean end(Edit edit, int a, int b) { return edit.getEndA() <= a && edit.getEndB() <= b; } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/Edit.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/Edit.java index 775d11a46b..5c876e87fd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/Edit.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/Edit.java @@ -94,7 +94,7 @@ public class Edit { * @param bs * beginB: start and end of region in sequence B; 0 based. */ - public Edit(final int as, final int bs) { + public Edit(int as, int bs) { this(as, as, bs, bs); } @@ -110,7 +110,7 @@ public class Edit { * @param be * endB: end of region in sequence B; must be > = bs. */ - public Edit(final int as, final int ae, final int bs, final int be) { + public Edit(int as, int ae, int bs, int be) { beginA = as; endA = ae; @@ -279,7 +279,7 @@ public class Edit { /** {@inheritDoc} */ @Override - public boolean equals(final Object o) { + public boolean equals(Object o) { if (o instanceof Edit) { final Edit e = (Edit) o; return this.beginA == e.beginA && this.endA == e.endA diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiffIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiffIndex.java index 04c79fcd1b..3f813d811f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiffIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiffIndex.java @@ -230,7 +230,7 @@ final class HistogramDiffIndex { return true; } - private int tryLongestCommonSequence(final int bPtr) { + private int tryLongestCommonSequence(int bPtr) { int bNext = bPtr + 1; int rIdx = table[hash(b, bPtr)]; for (long rec; rIdx != 0; rIdx = recNext(rec)) { @@ -328,7 +328,7 @@ final class HistogramDiffIndex { return ((int) rec) & REC_CNT_MASK; } - private static int tableBits(final int sz) { + private static int tableBits(int sz) { int bits = 31 - Integer.numberOfLeadingZeros(sz); if (bits == 0) bits = 1; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextComparator.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextComparator.java index ed2eebb858..1e68c2f416 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextComparator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextComparator.java @@ -77,7 +77,7 @@ public abstract class RawTextComparator extends SequenceComparator { } @Override - protected int hashRegion(final byte[] raw, int ptr, final int end) { + protected int hashRegion(byte[] raw, int ptr, int end) { int hash = 5381; for (; ptr < end; ptr++) hash = ((hash << 5) + hash) + (raw[ptr] & 0xff); @@ -164,7 +164,7 @@ public abstract class RawTextComparator extends SequenceComparator { } @Override - protected int hashRegion(final byte[] raw, int ptr, int end) { + protected int hashRegion(byte[] raw, int ptr, int end) { int hash = 5381; ptr = trimLeadingWhitespace(raw, ptr, end); for (; ptr < end; ptr++) @@ -199,7 +199,7 @@ public abstract class RawTextComparator extends SequenceComparator { } @Override - protected int hashRegion(final byte[] raw, int ptr, int end) { + protected int hashRegion(byte[] raw, int ptr, int end) { int hash = 5381; end = trimTrailingWhitespace(raw, ptr, end); for (; ptr < end; ptr++) @@ -244,7 +244,7 @@ public abstract class RawTextComparator extends SequenceComparator { } @Override - protected int hashRegion(final byte[] raw, int ptr, int end) { + protected int hashRegion(byte[] raw, int ptr, int end) { int hash = 5381; end = trimTrailingWhitespace(raw, ptr, end); while (ptr < end) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/BaseDirCacheEditor.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/BaseDirCacheEditor.java index 0228f4d3cc..aa229f79b9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/BaseDirCacheEditor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/BaseDirCacheEditor.java @@ -85,7 +85,7 @@ abstract class BaseDirCacheEditor { * estimated number of entries the editor will have upon * completion. This sizes the initial entry table. */ - protected BaseDirCacheEditor(final DirCache dc, final int ecnt) { + protected BaseDirCacheEditor(DirCache dc, int ecnt) { cache = dc; entries = new DirCacheEntry[ecnt]; } @@ -111,7 +111,7 @@ abstract class BaseDirCacheEditor { * @param newEntry * the new entry to add. */ - protected void fastAdd(final DirCacheEntry newEntry) { + protected void fastAdd(DirCacheEntry newEntry) { if (entries.length == entryCnt) { final DirCacheEntry[] n = new DirCacheEntry[(entryCnt + 16) * 3 / 2]; System.arraycopy(entries, 0, n, 0, entryCnt); @@ -140,7 +140,7 @@ abstract class BaseDirCacheEditor { * @param cnt * number of entries to copy. */ - protected void fastKeep(final int pos, int cnt) { + protected void fastKeep(int pos, int cnt) { if (entryCnt + cnt > entries.length) { final int m1 = (entryCnt + 16) * 3 / 2; final int m2 = entryCnt + cnt; 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 db1cfd5540..752c017586 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java @@ -113,7 +113,7 @@ public class DirCache { static final Comparator ENT_CMP = new Comparator() { @Override - public int compare(final DirCacheEntry o1, final DirCacheEntry o2) { + public int compare(DirCacheEntry o1, DirCacheEntry o2) { final int cr = cmp(o1, o2); if (cr != 0) return cr; @@ -189,7 +189,7 @@ public class DirCache { * the index file is using a format or extension that this * library does not support. */ - public static DirCache read(final Repository repository) + public static DirCache read(Repository repository) throws CorruptObjectException, IOException { final DirCache c = read(repository.getIndexFile(), repository.getFS()); c.repository = repository; @@ -216,7 +216,7 @@ public class DirCache { * the index file is using a format or extension that this * library does not support. */ - public static DirCache read(final File indexLocation, final FS fs) + public static DirCache read(File indexLocation, FS fs) throws CorruptObjectException, IOException { final DirCache c = new DirCache(indexLocation, fs); c.read(); @@ -245,7 +245,7 @@ public class DirCache { * the index file is using a format or extension that this * library does not support. */ - public static DirCache lock(final File indexLocation, final FS fs) + public static DirCache lock(File indexLocation, FS fs) throws CorruptObjectException, IOException { final DirCache c = new DirCache(indexLocation, fs); if (!c.lock()) @@ -373,7 +373,7 @@ public class DirCache { * the file system abstraction which will be necessary to perform * certain file system operations. */ - public DirCache(final File indexLocation, final FS fs) { + public DirCache(File indexLocation, FS fs) { liveFile = indexLocation; clear(); } @@ -473,7 +473,7 @@ public class DirCache { readIndexChecksum = NO_CHECKSUM; } - private void readFrom(final InputStream inStream) throws IOException, + private void readFrom(InputStream inStream) throws IOException, CorruptObjectException { final BufferedInputStream in = new BufferedInputStream(inStream); final MessageDigest md = Constants.newMessageDigest(); @@ -581,11 +581,11 @@ public class DirCache { } } - private static String formatExtensionName(final byte[] hdr) { + private static String formatExtensionName(byte[] hdr) { return "'" + new String(hdr, 0, 4, ISO_8859_1) + "'"; //$NON-NLS-1$ //$NON-NLS-2$ } - private static boolean is_DIRC(final byte[] hdr) { + private static boolean is_DIRC(byte[] hdr) { if (hdr.length < SIG_DIRC.length) return false; for (int i = 0; i < SIG_DIRC.length; i++) @@ -748,7 +748,7 @@ public class DirCache { return true; } - private void requireLocked(final LockFile tmp) { + private void requireLocked(LockFile tmp) { if (liveFile == null) throw new IllegalStateException(JGitText.get().dirCacheIsNotLocked); if (tmp == null) @@ -779,7 +779,7 @@ public class DirCache { * the index; pass to {@link #getEntry(int)} to obtain the entry * information. If < 0 the entry does not exist in the index. */ - public int findEntry(final String path) { + public int findEntry(String path) { final byte[] p = Constants.encode(path); return findEntry(p, p.length); } @@ -835,7 +835,7 @@ public class DirCache { * entry position of the path that should be skipped. * @return position of the next entry whose path is after the input. */ - public int nextEntry(final int position) { + public int nextEntry(int position) { DirCacheEntry last = sortedEntries[position]; int nextIdx = position + 1; while (nextIdx < entryCnt) { @@ -882,7 +882,7 @@ public class DirCache { * position of the entry to get. * @return the entry at position i. */ - public DirCacheEntry getEntry(final int i) { + public DirCacheEntry getEntry(int i) { return sortedEntries[i]; } @@ -893,7 +893,7 @@ public class DirCache { * the path to search for. * @return the entry for the given path. */ - public DirCacheEntry getEntry(final String path) { + public DirCacheEntry getEntry(String path) { final int i = findEntry(path); return i < 0 ? null : sortedEntries[i]; } @@ -942,7 +942,7 @@ public class DirCache { * @return the cache tree; null if there is no current cache tree available * and build was false. */ - public DirCacheTree getCacheTree(final boolean build) { + public DirCacheTree getCacheTree(boolean build) { if (build) { if (tree == null) tree = new DirCacheTree(); @@ -968,7 +968,7 @@ public class DirCache { * @throws java.io.IOException * an unexpected error occurred writing to the object store. */ - public ObjectId writeTree(final ObjectInserter ow) + public ObjectId writeTree(ObjectInserter ow) throws UnmergedPathException, IOException { return getCacheTree(true).writeTree(sortedEntries, 0, 0, ow); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuildIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuildIterator.java index 6e3682a3e2..e80544e48b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuildIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuildIterator.java @@ -96,7 +96,7 @@ public class DirCacheBuildIterator extends DirCacheIterator { * the cache builder for the cache to walk. The cache must be * already loaded into memory. */ - public DirCacheBuildIterator(final DirCacheBuilder dcb) { + public DirCacheBuildIterator(DirCacheBuilder dcb) { super(dcb.getDirCache()); builder = dcb; } @@ -109,7 +109,7 @@ public class DirCacheBuildIterator extends DirCacheIterator { /** {@inheritDoc} */ @Override - public AbstractTreeIterator createSubtreeIterator(final ObjectReader reader) + public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException { if (currentSubtree == null) throw new IncorrectObjectTypeException(getEntryObjectId(), diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java index 2ff7bb9aea..c5ff9ac41d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java @@ -83,7 +83,7 @@ public class DirCacheBuilder extends BaseDirCacheEditor { * estimated number of entries the builder will have upon * completion. This sizes the initial entry table. */ - protected DirCacheBuilder(final DirCache dc, final int ecnt) { + protected DirCacheBuilder(DirCache dc, int ecnt) { super(dc, ecnt); } @@ -102,7 +102,7 @@ public class DirCacheBuilder extends BaseDirCacheEditor { * @throws java.lang.IllegalArgumentException * If the FileMode of the entry was not set by the caller. */ - public void add(final DirCacheEntry newEntry) { + public void add(DirCacheEntry newEntry) { if (newEntry.getRawMode() == 0) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().fileModeNotSetForPath, @@ -131,7 +131,7 @@ public class DirCacheBuilder extends BaseDirCacheEditor { * @param cnt * number of entries to copy. */ - public void keep(final int pos, int cnt) { + public void keep(int pos, int cnt) { beforeAdd(cache.getEntry(pos)); fastKeep(pos, cnt); } @@ -227,7 +227,7 @@ public class DirCacheBuilder extends BaseDirCacheEditor { replace(); } - private void beforeAdd(final DirCacheEntry newEntry) { + private void beforeAdd(DirCacheEntry newEntry) { if (sorted && entryCnt > 0) { final DirCacheEntry lastEntry = entries[entryCnt - 1]; final int cr = DirCache.cmp(lastEntry, newEntry); 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 30e3a3cf12..74ba97fb8d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java @@ -77,7 +77,7 @@ import org.eclipse.jgit.util.Paths; public class DirCacheEditor extends BaseDirCacheEditor { private static final Comparator EDIT_CMP = new Comparator() { @Override - public int compare(final PathEdit o1, final PathEdit o2) { + public int compare(PathEdit o1, PathEdit o2) { final byte[] a = o1.path; final byte[] b = o2.path; return cmp(a, a.length, b, b.length); @@ -96,7 +96,7 @@ public class DirCacheEditor extends BaseDirCacheEditor { * estimated number of entries the editor will have upon * completion. This sizes the initial entry table. */ - protected DirCacheEditor(final DirCache dc, final int ecnt) { + protected DirCacheEditor(DirCache dc, int ecnt) { super(dc, ecnt); edits = new ArrayList<>(); } @@ -111,7 +111,7 @@ public class DirCacheEditor extends BaseDirCacheEditor { * @param edit * another edit command. */ - public void add(final PathEdit edit) { + public void add(PathEdit edit) { edits.add(edit); } @@ -304,7 +304,7 @@ public class DirCacheEditor extends BaseDirCacheEditor { * @param entryPath * path of the file within the repository. */ - public PathEdit(final String entryPath) { + public PathEdit(String entryPath) { path = Constants.encode(entryPath); } @@ -319,7 +319,7 @@ public class DirCacheEditor extends BaseDirCacheEditor { * entry instance to match path of. Only the path of this * entry is actually considered during command evaluation. */ - public PathEdit(final DirCacheEntry ent) { + public PathEdit(DirCacheEntry ent) { path = ent.path; } @@ -374,7 +374,7 @@ public class DirCacheEditor extends BaseDirCacheEditor { * @param entryPath * path of the file within the repository. */ - public DeletePath(final String entryPath) { + public DeletePath(String entryPath) { super(entryPath); } @@ -385,12 +385,12 @@ public class DirCacheEditor extends BaseDirCacheEditor { * entry instance to remove. Only the path of this entry is * actually considered during command evaluation. */ - public DeletePath(final DirCacheEntry ent) { + public DeletePath(DirCacheEntry ent) { super(ent); } @Override - public void apply(final DirCacheEntry ent) { + public void apply(DirCacheEntry ent) { throw new UnsupportedOperationException(JGitText.get().noApplyInDelete); } } @@ -440,7 +440,7 @@ public class DirCacheEditor extends BaseDirCacheEditor { } @Override - public void apply(final DirCacheEntry ent) { + public void apply(DirCacheEntry ent) { throw new UnsupportedOperationException(JGitText.get().noApplyInDelete); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java index 7c03c64946..19408b0592 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java @@ -227,7 +227,7 @@ public class DirCacheEntry { * "\0". These sequences are not permitted in a git tree object * or DirCache file. */ - public DirCacheEntry(final String newPath) { + public DirCacheEntry(String newPath) { this(Constants.encode(newPath), STAGE_0); } @@ -244,7 +244,7 @@ public class DirCacheEntry { * or DirCache file. Or if {@code stage} is outside of the * range 0..3, inclusive. */ - public DirCacheEntry(final String newPath, final int stage) { + public DirCacheEntry(String newPath, int stage) { this(Constants.encode(newPath), stage); } @@ -258,7 +258,7 @@ public class DirCacheEntry { * "\0". These sequences are not permitted in a git tree object * or DirCache file. */ - public DirCacheEntry(final byte[] newPath) { + public DirCacheEntry(byte[] newPath) { this(newPath, STAGE_0); } @@ -276,7 +276,7 @@ public class DirCacheEntry { * range 0..3, inclusive. */ @SuppressWarnings("boxing") - public DirCacheEntry(byte[] path, final int stage) { + public DirCacheEntry(byte[] path, int stage) { checkPath(path); if (stage < 0 || 3 < stage) throw new IllegalArgumentException(MessageFormat.format( @@ -343,7 +343,7 @@ public class DirCacheEntry { * nanoseconds component of the index's last modified time. * @return true if extra careful checks should be used. */ - public final boolean mightBeRacilyClean(final int smudge_s, final int smudge_ns) { + public final boolean mightBeRacilyClean(int smudge_s, int smudge_ns) { // If the index has a modification time then it came from disk // and was not generated from scratch in memory. In such cases // the entry is 'racily clean' if the entry's cached modification @@ -420,7 +420,7 @@ public class DirCacheEntry { * true to ignore apparent modifications; false to look at last * modified to detect file modifications. */ - public void setAssumeValid(final boolean assume) { + public void setAssumeValid(boolean assume) { if (assume) info[infoOffset + P_FLAGS] |= ASSUME_VALID; else @@ -518,7 +518,7 @@ public class DirCacheEntry { * {@link org.eclipse.jgit.lib.FileMode#TREE}, or any other type * code not permitted in a tree object. */ - public void setFileMode(final FileMode mode) { + public void setFileMode(FileMode mode) { switch (mode.getBits() & FileMode.TYPE_MASK) { case FileMode.TYPE_MISSING: case FileMode.TYPE_TREE: @@ -548,7 +548,7 @@ public class DirCacheEntry { * @param when * new cached creation time of the file, in milliseconds. */ - public void setCreationTime(final long when) { + public void setCreationTime(long when) { encodeTS(P_CTIME, when); } @@ -572,7 +572,7 @@ public class DirCacheEntry { * @param when * new cached modification date of the file, in milliseconds. */ - public void setLastModified(final long when) { + public void setLastModified(long when) { encodeTS(P_MTIME, when); } @@ -604,7 +604,7 @@ public class DirCacheEntry { * new cached size of the file, as bytes. If the file is larger * than 2G, cast it to (int) before calling this method. */ - public void setLength(final int sz) { + public void setLength(int sz) { NB.encodeInt32(info, infoOffset + P_SIZE, sz); } @@ -614,7 +614,7 @@ public class DirCacheEntry { * @param sz * new cached size of the file, as bytes. */ - public void setLength(final long sz) { + public void setLength(long sz) { setLength((int) sz); } @@ -638,7 +638,7 @@ public class DirCacheEntry { * {@link org.eclipse.jgit.lib.ObjectId#zeroId()} to remove the * current identifier. */ - public void setObjectId(final AnyObjectId id) { + public void setObjectId(AnyObjectId id) { id.copyRawTo(idBuffer(), idOffset()); } @@ -651,7 +651,7 @@ public class DirCacheEntry { * @param p * position to read the first byte of data from. */ - public void setObjectIdFromRaw(final byte[] bs, final int p) { + public void setObjectIdFromRaw(byte[] bs, int p) { final int n = Constants.OBJECT_ID_LENGTH; System.arraycopy(bs, p, idBuffer(), idOffset(), n); } @@ -704,7 +704,7 @@ public class DirCacheEntry { * @param src * the entry to copy ObjectId and meta fields from. */ - public void copyMetaData(final DirCacheEntry src) { + public void copyMetaData(DirCacheEntry src) { copyMetaData(src, false); } @@ -741,14 +741,14 @@ public class DirCacheEntry { return (info[infoOffset + P_FLAGS] & EXTENDED) != 0; } - private long decodeTS(final int pIdx) { + private long decodeTS(int pIdx) { final int base = infoOffset + pIdx; final int sec = NB.decodeInt32(info, base); final int ms = NB.decodeInt32(info, base + 4) / 1000000; return 1000L * sec + ms; } - private void encodeTS(final int pIdx, final long when) { + private void encodeTS(int pIdx, long when) { final int base = infoOffset + pIdx; NB.encodeInt32(info, base, (int) (when / 1000)); NB.encodeInt32(info, base + 4, ((int) (when % 1000)) * 1000000); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java index d768216db6..575b9a25f4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java @@ -114,7 +114,7 @@ public class DirCacheIterator extends AbstractTreeIterator { * @param dc * the cache to walk. It must be already loaded into memory. */ - public DirCacheIterator(final DirCache dc) { + public DirCacheIterator(DirCache dc) { cache = dc; tree = dc.getCacheTree(true); treeStart = 0; @@ -137,7 +137,7 @@ public class DirCacheIterator extends AbstractTreeIterator { /** {@inheritDoc} */ @Override - public AbstractTreeIterator createSubtreeIterator(final ObjectReader reader) + public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException { if (currentSubtree == null) throw new IncorrectObjectTypeException(getEntryObjectId(), diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java index dc825d4dc7..e9f1fcd923 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java @@ -82,7 +82,7 @@ public class DirCacheTree { private static final Comparator TREE_CMP = new Comparator() { @Override - public int compare(final DirCacheTree o1, final DirCacheTree o2) { + public int compare(DirCacheTree o1, DirCacheTree o2) { final byte[] a = o1.encodedName; final byte[] b = o2.encodedName; final int aLen = a.length; @@ -248,7 +248,7 @@ public class DirCacheTree { * index of the child to obtain. * @return the child tree. */ - public DirCacheTree getChild(final int i) { + public DirCacheTree getChild(int i) { return children[i]; } @@ -389,7 +389,7 @@ public class DirCacheTree { return size; } - private void appendName(final StringBuilder r) { + private void appendName(StringBuilder r) { if (parent != null) { parent.appendName(r); r.append(getNameString()); @@ -503,7 +503,7 @@ public class DirCacheTree { removeChild(childCnt - 1); } - private void insertChild(final int stIdx, final DirCacheTree st) { + private void insertChild(int stIdx, DirCacheTree st) { final DirCacheTree[] c = children; if (childCnt + 1 <= c.length) { if (stIdx < childCnt) @@ -524,7 +524,7 @@ public class DirCacheTree { childCnt++; } - private void removeChild(final int stIdx) { + private void removeChild(int stIdx) { final int n = --childCnt; if (stIdx < n) System.arraycopy(children, stIdx + 1, children, stIdx, n - stIdx); @@ -540,7 +540,7 @@ public class DirCacheTree { return true; } - private static int namecmp(final byte[] a, int aPos, final DirCacheTree ct) { + private static int namecmp(byte[] a, int aPos, DirCacheTree ct) { if (ct == null) return -1; final byte[] b = ct.encodedName; @@ -557,7 +557,7 @@ public class DirCacheTree { return aLen - bLen; } - private static int slash(final byte[] a, int aPos) { + private static int slash(byte[] a, int aPos) { final int aLen = a.length; for (; aPos < aLen; aPos++) if (a[aPos] == '/') 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 62ff990883..7192138b15 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java @@ -56,7 +56,7 @@ import org.eclipse.jgit.internal.JGitText; public class CompoundException extends Exception { private static final long serialVersionUID = 1L; - private static String format(final Collection causes) { + private static String format(Collection causes) { final StringBuilder msg = new StringBuilder(); msg.append(JGitText.get().failureDueToOneOfTheFollowing); for (final Throwable c : causes) { @@ -75,7 +75,7 @@ public class CompoundException extends Exception { * @param why * Two or more exceptions that may have been the problem. */ - public CompoundException(final Collection why) { + public CompoundException(Collection why) { super(format(why)); causeList = Collections.unmodifiableList(new ArrayList<>(why)); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/ConfigInvalidException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/ConfigInvalidException.java index a7e1d02b49..24f43cfcd5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/ConfigInvalidException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/ConfigInvalidException.java @@ -55,7 +55,7 @@ public class ConfigInvalidException extends Exception { * @param message * why the configuration is invalid. */ - public ConfigInvalidException(final String message) { + public ConfigInvalidException(String message) { super(message); } @@ -67,7 +67,7 @@ public class ConfigInvalidException extends Exception { * @param cause * root cause of the error. */ - public ConfigInvalidException(final String message, final Throwable cause) { + public ConfigInvalidException(String message, Throwable cause) { super(message, cause); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/EntryExistsException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/EntryExistsException.java index 8dd0d539fc..b97d237b28 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/EntryExistsException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/EntryExistsException.java @@ -61,7 +61,7 @@ public class EntryExistsException extends IOException { * * @param name workdir relative file name */ - public EntryExistsException(final String name) { + public EntryExistsException(String name) { super(MessageFormat.format(JGitText.get().treeEntryAlreadyExists, name)); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/IllegalTodoFileModification.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/IllegalTodoFileModification.java index a6471217e1..785cb95bf2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/IllegalTodoFileModification.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/IllegalTodoFileModification.java @@ -56,7 +56,7 @@ public class IllegalTodoFileModification extends Exception { * @param msg * error message */ - public IllegalTodoFileModification(final String msg) { + public IllegalTodoFileModification(String msg) { super(msg); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/IncorrectObjectTypeException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/IncorrectObjectTypeException.java index 7ba3a006d6..5abd0c347b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/IncorrectObjectTypeException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/IncorrectObjectTypeException.java @@ -70,7 +70,7 @@ public class IncorrectObjectTypeException extends IOException { * @param id SHA-1 * @param type object type */ - public IncorrectObjectTypeException(final ObjectId id, final String type) { + public IncorrectObjectTypeException(ObjectId id, String type) { super(MessageFormat.format(JGitText.get().objectIsNotA, id.name(), type)); } @@ -82,7 +82,7 @@ public class IncorrectObjectTypeException extends IOException { * @param id SHA-1 * @param type object type */ - public IncorrectObjectTypeException(final ObjectId id, final int type) { + public IncorrectObjectTypeException(ObjectId id, int type) { this(id, Constants.typeString(type)); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/IndexReadException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/IndexReadException.java index 70f650dde6..e07d308207 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/IndexReadException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/IndexReadException.java @@ -63,7 +63,7 @@ public class IndexReadException extends IOException { * @param s * message */ - public IndexReadException(final String s) { + public IndexReadException(String s) { super(s); } @@ -75,7 +75,7 @@ public class IndexReadException extends IOException { * @param cause * root cause exception */ - public IndexReadException(final String s, final Throwable cause) { + public IndexReadException(String s, Throwable cause) { super(s); initCause(cause); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/IndexWriteException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/IndexWriteException.java index de19c06683..34fd7a8942 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/IndexWriteException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/IndexWriteException.java @@ -60,7 +60,7 @@ public class IndexWriteException extends IOException { * * @param s message */ - public IndexWriteException(final String s) { + public IndexWriteException(String s) { super(s); } @@ -70,7 +70,7 @@ public class IndexWriteException extends IOException { * @param s message * @param cause root cause exception */ - public IndexWriteException(final String s, final Throwable cause) { + public IndexWriteException(String s, Throwable cause) { super(s); initCause(cause); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java index 09bb4a914f..9efc21e7c7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java @@ -56,7 +56,7 @@ import org.eclipse.jgit.transport.URIish; public class MissingBundlePrerequisiteException extends TransportException { private static final long serialVersionUID = 1L; - private static String format(final Map missingCommits) { + private static String format(Map missingCommits) { final StringBuilder r = new StringBuilder(); r.append(JGitText.get().missingPrerequisiteCommits); for (final Map.Entry e : missingCommits.entrySet()) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingObjectException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingObjectException.java index f6aa092db4..c6c47f9591 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingObjectException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingObjectException.java @@ -69,7 +69,7 @@ public class MissingObjectException extends IOException { * @param id SHA-1 * @param type object type */ - public MissingObjectException(final ObjectId id, final String type) { + public MissingObjectException(ObjectId id, String type) { super(MessageFormat.format(JGitText.get().missingObject, type, id.name())); missing = id.copy(); } @@ -81,7 +81,7 @@ public class MissingObjectException extends IOException { * @param id SHA-1 * @param type object type */ - public MissingObjectException(final ObjectId id, final int type) { + public MissingObjectException(ObjectId id, int type) { this(id, Constants.typeString(type)); } @@ -94,7 +94,7 @@ public class MissingObjectException extends IOException { * @param type * object type */ - public MissingObjectException(final AbbreviatedObjectId id, final int type) { + public MissingObjectException(AbbreviatedObjectId id, int type) { super(MessageFormat.format(JGitText.get().missingObject, Constants .typeString(type), id.name())); missing = null; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoPackSignatureException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoPackSignatureException.java index 28e9788974..8c2e872973 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoPackSignatureException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoPackSignatureException.java @@ -60,7 +60,7 @@ public class NoPackSignatureException extends IOException { * @param why * description of the type of error. */ - public NoPackSignatureException(final String why) { + public NoPackSignatureException(String why) { super(why); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoRemoteRepositoryException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoRemoteRepositoryException.java index fe073d5648..524968d524 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoRemoteRepositoryException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/NoRemoteRepositoryException.java @@ -59,7 +59,7 @@ public class NoRemoteRepositoryException extends TransportException { * @param s * message */ - public NoRemoteRepositoryException(final URIish uri, final String s) { + public NoRemoteRepositoryException(URIish uri, String s) { super(uri, s); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/NotSupportedException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/NotSupportedException.java index 124680eccb..114e662fb4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/NotSupportedException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/NotSupportedException.java @@ -58,7 +58,7 @@ public class NotSupportedException extends IOException { * * @param s message describing the issue */ - public NotSupportedException(final String s) { + public NotSupportedException(String s) { super(s); } @@ -70,7 +70,7 @@ public class NotSupportedException extends IOException { * @param why * a lower level implementation specific issue. */ - public NotSupportedException(final String s, final Throwable why) { + public NotSupportedException(String s, Throwable why) { super(s); initCause(why); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/ObjectWritingException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/ObjectWritingException.java index 8af1991b14..bbee42f18f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/ObjectWritingException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/ObjectWritingException.java @@ -58,7 +58,7 @@ public class ObjectWritingException extends IOException { * * @param s message */ - public ObjectWritingException(final String s) { + public ObjectWritingException(String s) { super(s); } @@ -68,7 +68,7 @@ public class ObjectWritingException extends IOException { * @param s message * @param cause root cause exception */ - public ObjectWritingException(final String s, final Throwable cause) { + public ObjectWritingException(String s, Throwable cause) { super(s); initCause(cause); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java index 9886e15dda..a83de06262 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java @@ -61,7 +61,7 @@ public class PackInvalidException extends IOException { * @param path * path of the invalid pack file. */ - public PackInvalidException(final File path) { + public PackInvalidException(File path) { this(path.getAbsolutePath()); } @@ -71,7 +71,7 @@ public class PackInvalidException extends IOException { * @param path * path of the invalid pack file. */ - public PackInvalidException(final String path) { + public PackInvalidException(String path) { super(MessageFormat.format(JGitText.get().packFileInvalid, path)); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackMismatchException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackMismatchException.java index 5b9a4b93b9..ea1e65b221 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackMismatchException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackMismatchException.java @@ -57,7 +57,7 @@ public class PackMismatchException extends IOException { * @param why * description of the type of error. */ - public PackMismatchException(final String why) { + public PackMismatchException(String why) { super(why); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackProtocolException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackProtocolException.java index 44bc16492d..dd13740f1e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackProtocolException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackProtocolException.java @@ -62,7 +62,7 @@ public class PackProtocolException extends TransportException { * @param s * message, which may be shown to an end-user. */ - public PackProtocolException(final URIish uri, final String s) { + public PackProtocolException(URIish uri, String s) { super(uri + ": " + s); //$NON-NLS-1$ } @@ -88,7 +88,7 @@ public class PackProtocolException extends TransportException { * @param s * message, which may be shown to an end-user. */ - public PackProtocolException(final String s) { + public PackProtocolException(String s) { super(s); } @@ -100,7 +100,7 @@ public class PackProtocolException extends TransportException { * @param cause * root cause exception */ - public PackProtocolException(final String s, final Throwable cause) { + public PackProtocolException(String s, Throwable cause) { super(s); initCause(cause); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/RepositoryNotFoundException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/RepositoryNotFoundException.java index aabb46ad42..04fd8ea6d5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/RepositoryNotFoundException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/RepositoryNotFoundException.java @@ -60,7 +60,7 @@ public class RepositoryNotFoundException extends TransportException { * @param location * description of the repository not found, usually file path. */ - public RepositoryNotFoundException(final File location) { + public RepositoryNotFoundException(File location) { this(location.getPath()); } @@ -72,7 +72,7 @@ public class RepositoryNotFoundException extends TransportException { * @param why * why the repository does not exist. */ - public RepositoryNotFoundException(final File location, Throwable why) { + public RepositoryNotFoundException(File location, Throwable why) { this(location.getPath(), why); } @@ -82,7 +82,7 @@ public class RepositoryNotFoundException extends TransportException { * @param location * description of the repository not found, usually file path. */ - public RepositoryNotFoundException(final String location) { + public RepositoryNotFoundException(String location) { super(message(location)); } @@ -98,7 +98,7 @@ public class RepositoryNotFoundException extends TransportException { super(message(location), why); } - private static String message(final String location) { + private static String message(String location) { return MessageFormat.format(JGitText.get().repositoryNotFound, location); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/RevWalkException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/RevWalkException.java index 82654e8bd0..f6852b59ff 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/RevWalkException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/RevWalkException.java @@ -65,7 +65,7 @@ public class RevWalkException extends RuntimeException { * @param cause * the checked exception that describes why the walk failed. */ - public RevWalkException(final Throwable cause) { + public RevWalkException(Throwable cause) { super(JGitText.get().walkFailure, cause); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/SymlinksNotSupportedException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/SymlinksNotSupportedException.java index 60d7aa098f..dc59c8c321 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/SymlinksNotSupportedException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/SymlinksNotSupportedException.java @@ -58,7 +58,7 @@ public class SymlinksNotSupportedException extends IOException { * * @param s name of link in tree or workdir */ - public SymlinksNotSupportedException(final String s) { + public SymlinksNotSupportedException(String s) { super(s); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/TransportException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/TransportException.java index 86dea8284f..5fecf0ea53 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/TransportException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/TransportException.java @@ -64,7 +64,7 @@ public class TransportException extends IOException { * @param s * message */ - public TransportException(final URIish uri, final String s) { + public TransportException(URIish uri, String s) { super(uri.setPass(null) + ": " + s); //$NON-NLS-1$ } @@ -90,7 +90,7 @@ public class TransportException extends IOException { * @param s * message */ - public TransportException(final String s) { + public TransportException(String s) { super(s); } @@ -102,7 +102,7 @@ public class TransportException extends IOException { * @param cause * root cause exception */ - public TransportException(final String s, final Throwable cause) { + public TransportException(String s, Throwable cause) { super(s); initCause(cause); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnmergedPathException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnmergedPathException.java index 4fc534b944..6de9153c0e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnmergedPathException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnmergedPathException.java @@ -63,7 +63,7 @@ public class UnmergedPathException extends IOException { * @param dce * the first non-zero stage of the unmerged path. */ - public UnmergedPathException(final DirCacheEntry dce) { + public UnmergedPathException(DirCacheEntry dce) { super(MessageFormat.format(JGitText.get().unmergedPath, dce.getPathString())); entry = dce; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedCredentialItem.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedCredentialItem.java index 88c2ef6238..9bab68797c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedCredentialItem.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedCredentialItem.java @@ -62,7 +62,7 @@ public class UnsupportedCredentialItem extends RuntimeException { * @param s * message */ - public UnsupportedCredentialItem(final URIish uri, final String s) { + public UnsupportedCredentialItem(URIish uri, String s) { super(uri.setPass(null) + ": " + s); //$NON-NLS-1$ } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackIndexVersionException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackIndexVersionException.java index 0b7ccf5777..0a4fef11f0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackIndexVersionException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackIndexVersionException.java @@ -62,7 +62,7 @@ public class UnsupportedPackIndexVersionException extends IOException { * @param version * pack index version */ - public UnsupportedPackIndexVersionException(final int version) { + public UnsupportedPackIndexVersionException(int version) { super(MessageFormat.format(JGitText.get().unsupportedPackIndexVersion, Integer.valueOf(version))); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackVersionException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackVersionException.java index 23611867be..cbf8f3a6da 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackVersionException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackVersionException.java @@ -62,7 +62,7 @@ public class UnsupportedPackVersionException extends IOException { * @param version * pack version */ - public UnsupportedPackVersionException(final long version) { + public UnsupportedPackVersionException(long version) { super(MessageFormat.format(JGitText.get().unsupportedPackVersion, Long.valueOf(version))); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java index 98aee0eef2..7039c3d618 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java @@ -53,14 +53,14 @@ final class CharacterHead extends AbstractHead { * @param expectedCharacter * expected {@code char} */ - protected CharacterHead(final char expectedCharacter) { + protected CharacterHead(char expectedCharacter) { super(false); this.expectedCharacter = expectedCharacter; } /** {@inheritDoc} */ @Override - protected final boolean matches(final char c) { + protected final boolean matches(char c) { return c == expectedCharacter; } 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 56630395b2..bfcc580ba4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java @@ -105,7 +105,7 @@ public class FileNameMatcher { * @param headsStartValue * must be a list which will never be modified. */ - private FileNameMatcher(final List headsStartValue) { + private FileNameMatcher(List headsStartValue) { this(headsStartValue, headsStartValue); } @@ -315,7 +315,7 @@ public class FileNameMatcher { * @param c new character to append * @return true to continue, false if the matcher can stop appending */ - private boolean extendStringToMatchByOneCharacter(final char c) { + private boolean extendStringToMatchByOneCharacter(char c) { final List newHeads = listForLocalUseage; newHeads.clear(); List lastAddedHeads = null; @@ -357,7 +357,7 @@ public class FileNameMatcher { * extends the string which is matched against the patterns of * this class. */ - public void append(final String stringToMatch) { + public void append(String stringToMatch) { for (int i = 0; i < stringToMatch.length(); i++) { final char c = stringToMatch.charAt(i); if (!extendStringToMatchByOneCharacter(c)) 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 965d90085f..eb98a3acd8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java @@ -132,7 +132,7 @@ final class GroupHead extends AbstractHead { /** {@inheritDoc} */ @Override - protected final boolean matches(final char c) { + protected final boolean matches(char c) { for (CharacterPattern pattern : characterClasses) { if (pattern.matches(c)) { return !inverse; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java index c132e28156..2068b0d896 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java @@ -54,7 +54,7 @@ final class RestrictedWildCardHead extends AbstractHead { /** {@inheritDoc} */ @Override - protected final boolean matches(final char c) { + protected final boolean matches(char c) { return c != excludedCharacter; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java index c806e23134..07362aa967 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java @@ -51,7 +51,7 @@ final class WildCardHead extends AbstractHead { /** {@inheritDoc} */ @Override - protected final boolean matches(final char c) { + protected final boolean matches(char c) { return true; } } 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 8b8df87978..80fd3cf1a4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java @@ -413,7 +413,7 @@ public class RepoCommand extends GitCommand { * a {@link org.eclipse.jgit.lib.ProgressMonitor} * @return this command */ - public RepoCommand setProgressMonitor(final ProgressMonitor monitor) { + public RepoCommand setProgressMonitor(ProgressMonitor monitor) { this.monitor = monitor; return this; } @@ -448,7 +448,7 @@ public class RepoCommand extends GitCommand { * the author's {@link org.eclipse.jgit.lib.PersonIdent} * @return this command */ - public RepoCommand setAuthor(final PersonIdent author) { + public RepoCommand setAuthor(PersonIdent author) { this.author = author; return this; } @@ -463,7 +463,7 @@ public class RepoCommand extends GitCommand { * object. * @return this command */ - public RepoCommand setRemoteReader(final RemoteReader callback) { + public RepoCommand setRemoteReader(RemoteReader callback) { this.callback = callback; return this; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/KetchSystem.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/KetchSystem.java index 1908d6c98a..d1d4f67d86 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/KetchSystem.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/KetchSystem.java @@ -260,7 +260,7 @@ public class KetchSystem { * @throws java.net.URISyntaxException * a follower configuration contains an unsupported URI. */ - public KetchLeader createLeader(final Repository repo) + public KetchLeader createLeader(Repository repo) throws URISyntaxException { KetchLeader leader = new KetchLeader(this) { @Override diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LocalReplica.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LocalReplica.java index 9c37a90cee..7ddde6337f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LocalReplica.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LocalReplica.java @@ -122,7 +122,7 @@ public class LocalReplica extends KetchReplica { /** {@inheritDoc} */ @Override - protected void startPush(final ReplicaPushRequest req) { + protected void startPush(ReplicaPushRequest req) { getSystem().getExecutor().execute(new Runnable() { @Override public void run() { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/RemoteGitReplica.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/RemoteGitReplica.java index 674da1fc68..b61274ef4a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/RemoteGitReplica.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/RemoteGitReplica.java @@ -138,7 +138,7 @@ public class RemoteGitReplica extends KetchReplica { /** {@inheritDoc} */ @Override - protected void startPush(final ReplicaPushRequest req) { + protected void startPush(ReplicaPushRequest req) { getSystem().getExecutor().execute(new Runnable() { @Override public void run() { 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 14dc80fc97..46879529b5 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 @@ -181,7 +181,7 @@ public final class DfsBlockCache { private Ref clockHand; @SuppressWarnings("unchecked") - private DfsBlockCache(final DfsBlockCacheConfig cfg) { + private DfsBlockCache(DfsBlockCacheConfig cfg) { tableSize = tableSize(cfg); if (tableSize < 1) throw new IllegalArgumentException(JGitText.get().tSizeMustBeGreaterOrEqual1); @@ -330,7 +330,7 @@ public final class DfsBlockCache { return blockSize; } - private static int tableSize(final DfsBlockCacheConfig cfg) { + private static int tableSize(DfsBlockCacheConfig cfg) { final int wsz = cfg.getBlockSize(); final long limit = cfg.getBlockLimit(); if (wsz <= 0) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheConfig.java index cd7901b357..dd7cb89c96 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheConfig.java @@ -106,7 +106,7 @@ public class DfsBlockCacheConfig { * pack file data; must be positive. * @return {@code this} */ - public DfsBlockCacheConfig setBlockLimit(final long newLimit) { + public DfsBlockCacheConfig setBlockLimit(long newLimit) { if (newLimit <= 0) { throw new IllegalArgumentException(MessageFormat.format( JGitText.get().blockLimitNotPositive, @@ -135,7 +135,7 @@ public class DfsBlockCacheConfig { * The value must be a power of 2. * @return {@code this} */ - public DfsBlockCacheConfig setBlockSize(final int newSize) { + public DfsBlockCacheConfig setBlockSize(int newSize) { int size = Math.max(512, newSize); if ((size & (size - 1)) != 0) { throw new IllegalArgumentException( @@ -206,7 +206,7 @@ public class DfsBlockCacheConfig { * configuration to read properties from. * @return {@code this} */ - public DfsBlockCacheConfig fromConfig(final Config rc) { + public DfsBlockCacheConfig fromConfig(Config rc) { long cfgBlockLimit = rc.getLong( CONFIG_CORE_SECTION, CONFIG_DFS_SECTION, 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 1220b122b8..0d9e2c1d79 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 @@ -406,7 +406,7 @@ public class DfsInserter extends ObjectInserter { } @Override - public void write(final int b) throws IOException { + public void write(int b) throws IOException { hdrBuf[0] = (byte) b; write(hdrBuf, 0, 1); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java index bf14d18e32..2ea5c39769 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReaderOptions.java @@ -115,7 +115,7 @@ public class DfsReaderOptions { * {@link org.eclipse.jgit.lib.ObjectStream}. * @return {@code this} */ - public DfsReaderOptions setStreamFileThreshold(final int newLimit) { + public DfsReaderOptions setStreamFileThreshold(int newLimit) { streamFileThreshold = Math.max(0, newLimit); return this; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteArrayWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteArrayWindow.java index 338df4a8e1..07b607c189 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteArrayWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteArrayWindow.java @@ -65,7 +65,7 @@ final class ByteArrayWindow extends ByteWindow { /** {@inheritDoc} */ @Override - protected int copy(final int p, final byte[] b, final int o, int n) { + protected int copy(int p, byte[] b, int o, int n) { n = Math.min(array.length - p, n); System.arraycopy(array, p, b, o, n); return n; @@ -73,7 +73,7 @@ final class ByteArrayWindow extends ByteWindow { /** {@inheritDoc} */ @Override - protected int setInput(final int pos, final Inflater inf) + protected int setInput(int pos, Inflater inf) throws DataFormatException { int n = array.length - pos; inf.setInput(array, pos, n); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteBufferWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteBufferWindow.java index 4dcf133e08..343d36922f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteBufferWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteBufferWindow.java @@ -67,7 +67,7 @@ final class ByteBufferWindow extends ByteWindow { /** {@inheritDoc} */ @Override - protected int copy(final int p, final byte[] b, final int o, int n) { + protected int copy(int p, byte[] b, int o, int n) { final ByteBuffer s = buffer.slice(); s.position(p); n = Math.min(s.remaining(), n); @@ -92,7 +92,7 @@ final class ByteBufferWindow extends ByteWindow { /** {@inheritDoc} */ @Override - protected int setInput(final int pos, final Inflater inf) + protected int setInput(int pos, Inflater inf) throws DataFormatException { final ByteBuffer s = buffer.slice(); s.position(pos); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteWindow.java index 7963ceac47..a3146dbb52 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteWindow.java @@ -76,7 +76,7 @@ abstract class ByteWindow { * @param n * size of the byte window */ - protected ByteWindow(final PackFile p, final long s, final int n) { + protected ByteWindow(PackFile p, long s, int n) { pack = p; start = s; end = start + n; 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 e810ae0e27..945e97950d 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 @@ -181,11 +181,11 @@ class CachedObjectDirectory extends FileObjectDatabase { /** {@inheritDoc} */ @Override - public boolean has(final AnyObjectId objectId) throws IOException { + public boolean has(AnyObjectId objectId) throws IOException { return has(objectId, null); } - private boolean has(final AnyObjectId objectId, Set skips) + private boolean has(AnyObjectId objectId, Set skips) throws IOException { if (unpackedObjects.contains(objectId)) { return true; 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 b3979894e4..b464a1b79f 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 @@ -52,7 +52,7 @@ class DeltaBaseCache { static final SoftReference DEAD; - private static int hash(final long position) { + private static int hash(long position) { return (((int) position) << 22) >>> 22; } @@ -136,7 +136,7 @@ class DeltaBaseCache { } } - private void moveToHead(final Slot e) { + private void moveToHead(Slot e) { unlink(e); e.lruPrev = null; e.lruNext = lruHead; @@ -147,7 +147,7 @@ class DeltaBaseCache { lruHead = e; } - private void unlink(final Slot e) { + private void unlink(Slot e) { final Slot prev = e.lruPrev; final Slot next = e.lruNext; if (prev != null) @@ -156,7 +156,7 @@ class DeltaBaseCache { next.lruPrev = prev; } - private void clearEntry(final Slot e) { + private void clearEntry(Slot e) { openByteCount -= e.sz; e.provider = null; e.data = DEAD; 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 9bbf7466b6..f174e491af 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 @@ -149,7 +149,7 @@ public class FileRepository extends Repository { * accessed. * @see FileRepositoryBuilder */ - public FileRepository(final File gitDir) throws IOException { + public FileRepository(File gitDir) throws IOException { this(new FileRepositoryBuilder().setGitDir(gitDir).setup()); } @@ -163,7 +163,7 @@ public class FileRepository extends Repository { * accessed. * @see FileRepositoryBuilder */ - public FileRepository(final String gitDir) throws IOException { + public FileRepository(String gitDir) throws IOException { this(new File(gitDir)); } @@ -176,7 +176,7 @@ public class FileRepository extends Repository { * the user configuration file or repository configuration file * cannot be accessed. */ - public FileRepository(final BaseRepositoryBuilder options) throws IOException { + public FileRepository(BaseRepositoryBuilder options) throws IOException { super(options); if (StringUtils.isEmptyOrNull(SystemReader.getInstance().getenv( @@ -533,7 +533,7 @@ public class FileRepository extends Repository { * index file could not be opened, read, or is not recognized as * a Git pack file index. */ - public void openPack(final File pack) throws IOException { + public void openPack(File pack) throws IOException { objectDatabase.openPack(pack); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java index 2165aa2b76..10adc6ccc0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java @@ -239,7 +239,7 @@ public class FileSnapshot { + ", read: " + f.format(new Date(lastRead)) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ } - private boolean notRacyClean(final long read) { + private boolean notRacyClean(long read) { // The last modified time granularity of FAT filesystems is 2 seconds. // Using 2.5 seconds here provides a reasonably high assurance that // a modification was not missed. @@ -247,7 +247,7 @@ public class FileSnapshot { return read - lastModified > 2500; } - private boolean isModified(final long currLastModified) { + private boolean isModified(long currLastModified) { // Any difference indicates the path was modified. // if (lastModified != currLastModified) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java index 80d67cf6af..a11e4ffdfe 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java @@ -88,7 +88,7 @@ public class LockFile { * a {@link java.io.File} object. * @return true if unlocked, false if unlocking failed */ - public static boolean unlock(final File file) { + public static boolean unlock(File file) { final File lockFile = getLockFile(file); final int flags = FileUtils.RETRY | FileUtils.SKIP_MISSING; try { @@ -137,7 +137,7 @@ public class LockFile { * @param f * the file that will be locked. */ - public LockFile(final File f) { + public LockFile(File f) { ref = f; lck = getLockFile(ref); } @@ -253,7 +253,7 @@ public class LockFile { * the temporary file could not be written. The lock is released * before throwing the underlying exception to the caller. */ - public void write(final ObjectId id) throws IOException { + public void write(ObjectId id) throws IOException { byte[] buf = new byte[Constants.OBJECT_ID_STRING_LENGTH + 1]; id.copyTo(buf, 0); buf[Constants.OBJECT_ID_STRING_LENGTH] = '\n'; @@ -274,7 +274,7 @@ public class LockFile { * the temporary file could not be written. The lock is released * before throwing the underlying exception to the caller. */ - public void write(final byte[] content) throws IOException { + public void write(byte[] content) throws IOException { requireLock(); try { if (fsync) { @@ -320,18 +320,18 @@ public class LockFile { return new OutputStream() { @Override - public void write(final byte[] b, final int o, final int n) + public void write(byte[] b, int o, int n) throws IOException { out.write(b, o, n); } @Override - public void write(final byte[] b) throws IOException { + public void write(byte[] b) throws IOException { out.write(b); } @Override - public void write(final int b) throws IOException { + public void write(int b) throws IOException { out.write(b); } @@ -371,7 +371,7 @@ public class LockFile { * @param on * true if the commit method must remember the modification time. */ - public void setNeedStatInformation(final boolean on) { + public void setNeedStatInformation(boolean on) { setNeedSnapshot(on); } @@ -382,7 +382,7 @@ public class LockFile { * @param on * true if the commit method must remember the FileSnapshot. */ - public void setNeedSnapshot(final boolean on) { + public void setNeedSnapshot(boolean on) { needSnapshot = on; } @@ -392,7 +392,7 @@ public class LockFile { * @param on * true if dirty data should be forced to the drive. */ - public void setFSync(final boolean on) { + public void setFSync(boolean on) { fsync = on; } 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 92b53ad44a..4cab5f8bb8 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 @@ -278,7 +278,7 @@ public class ObjectDirectory extends FileObjectDatabase { * Add a single existing pack to the list of available pack files. */ @Override - public PackFile openPack(final File pack) + public PackFile openPack(File pack) throws IOException { final String p = pack.getName(); if (p.length() != 50 || !p.startsWith("pack-") || !p.endsWith(".pack")) //$NON-NLS-1$ //$NON-NLS-2$ @@ -814,7 +814,7 @@ public class ObjectDirectory extends FileObjectDatabase { return shallowCommitsIds; } - private void insertPack(final PackFile pf) { + private void insertPack(PackFile pf) { PackList o, n; do { o = packList.get(); @@ -837,7 +837,7 @@ public class ObjectDirectory extends FileObjectDatabase { } while (!packList.compareAndSet(o, n)); } - private void removePack(final PackFile deadPack) { + private void removePack(PackFile deadPack) { PackList o, n; do { o = packList.get(); @@ -855,7 +855,7 @@ public class ObjectDirectory extends FileObjectDatabase { deadPack.close(); } - private static int indexOf(final PackFile[] list, final PackFile pack) { + private static int indexOf(PackFile[] list, PackFile pack) { for (int i = 0; i < list.length; i++) { if (list[i] == pack) return i; @@ -863,7 +863,7 @@ public class ObjectDirectory extends FileObjectDatabase { return -1; } - private PackList scanPacks(final PackList original) { + private PackList scanPacks(PackList original) { synchronized (packList) { PackList o, n; do { @@ -882,7 +882,7 @@ public class ObjectDirectory extends FileObjectDatabase { } } - private PackList scanPacksImpl(final PackList old) { + private PackList scanPacksImpl(PackList old) { final Map forReuse = reuseMap(old); final FileSnapshot snapshot = FileSnapshot.save(packDirectory); final Set names = listPackDirectory(); @@ -943,7 +943,7 @@ public class ObjectDirectory extends FileObjectDatabase { return new PackList(snapshot, r); } - private static Map reuseMap(final PackList old) { + private static Map reuseMap(PackList old) { final Map forReuse = new HashMap<>(); for (final PackFile p : old.packs) { if (p.invalid()) { @@ -1033,12 +1033,12 @@ public class ObjectDirectory extends FileObjectDatabase { return l.toArray(new AlternateHandle[l.size()]); } - private static BufferedReader open(final File f) + private static BufferedReader open(File f) throws FileNotFoundException { return new BufferedReader(new FileReader(f)); } - private AlternateHandle openAlternate(final String location) + private AlternateHandle openAlternate(String location) throws IOException { final File objdir = fs.resolve(objects, location); return openAlternate(objdir); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java index e06f72167e..e6ae9686a4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java @@ -117,7 +117,7 @@ class ObjectDirectoryInserter extends ObjectInserter { /** {@inheritDoc} */ @Override - public ObjectId insert(final int type, long len, final InputStream is) + public ObjectId insert(int type, long len, InputStream is) throws IOException { return insert(type, len, is, false); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java index b5a4d5c3fd..0cec2d5a85 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java @@ -153,7 +153,7 @@ public class ObjectDirectoryPackParser extends PackParser { * @param empty * true to enable keeping an empty pack. */ - public void setKeepEmpty(final boolean empty) { + public void setKeepEmpty(boolean empty) { keepEmpty = empty; } @@ -440,7 +440,7 @@ public class ObjectDirectoryPackParser extends PackParser { } } - private PackLock renameAndOpenPack(final String lockMessage) + private PackLock renameAndOpenPack(String lockMessage) throws IOException { if (!keepEmpty && getObjectCount() == 0) { cleanupTemporaryFiles(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java index d5219c7a05..c32ba36010 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java @@ -103,7 +103,7 @@ public class PackFile implements Iterable { /** Sorts PackFiles to be most recently created to least recently created. */ public static final Comparator SORT = new Comparator() { @Override - public int compare(final PackFile a, final PackFile b) { + public int compare(PackFile a, PackFile b) { return b.packLastModified - a.packLastModified; } }; @@ -162,7 +162,7 @@ public class PackFile implements Iterable { * @param extensions * additional pack file extensions with the same base as the pack */ - public PackFile(final File packFile, int extensions) { + public PackFile(File packFile, int extensions) { this.packFile = packFile; this.packLastModified = (int) (packFile.lastModified() >> 10); this.extensions = extensions; @@ -251,7 +251,7 @@ public class PackFile implements Iterable { * @throws java.io.IOException * the index file cannot be loaded into memory. */ - public boolean hasObject(final AnyObjectId id) throws IOException { + public boolean hasObject(AnyObjectId id) throws IOException { final long offset = idx().findOffset(id); return 0 < offset && !isCorrupt(offset); } @@ -1100,7 +1100,7 @@ public class PackFile implements Iterable { } } - private long findEndOffset(final long startOffset) + private long findEndOffset(long startOffset) throws IOException, CorruptObjectException { final long maxOffset = length - 20; return getReverseIdx().findNextOffset(startOffset, maxOffset); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java index e324c1f52b..72699b0438 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java @@ -94,7 +94,7 @@ public abstract class PackIndex * the file exists but could not be read due to security errors, * unrecognized data version, or unexpected data corruption. */ - public static PackIndex open(final File idxFile) throws IOException { + public static PackIndex open(File idxFile) throws IOException { try (SilentFileInputStream fd = new SilentFileInputStream( idxFile)) { return read(fd); @@ -139,7 +139,7 @@ public abstract class PackIndex return new PackIndexV1(fd, hdr); } - private static boolean isTOC(final byte[] h) { + private static boolean isTOC(byte[] h) { final byte[] toc = PackIndexWriter.TOC; for (int i = 0; i < toc.length; i++) if (h[i] != toc[i]) @@ -157,7 +157,7 @@ public abstract class PackIndex * the object to look for. Must not be null. * @return true if the object is listed in this index; false otherwise. */ - public boolean hasObject(final AnyObjectId id) { + public boolean hasObject(AnyObjectId id) { return findOffset(id) != -1; } @@ -241,7 +241,7 @@ public abstract class PackIndex * negative, but still valid. * @return the ObjectId for the corresponding entry. */ - public final ObjectId getObjectId(final int nthPosition) { + public final ObjectId getObjectId(int nthPosition) { if (nthPosition >= 0) return getObjectId((long) nthPosition); final int u31 = nthPosition >>> 1; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java index 8ea31e4fa0..66d35bd900 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java @@ -120,7 +120,7 @@ class PackIndexV1 extends PackIndex { return n64; } - private int findLevelOne(final long nthPosition) { + private int findLevelOne(long nthPosition) { int levelOne = Arrays.binarySearch(idxHeader, nthPosition + 1); if (levelOne >= 0) { // If we hit the bucket exactly the item is in the bucket, or @@ -137,14 +137,14 @@ class PackIndexV1 extends PackIndex { return levelOne; } - private int getLevelTwo(final long nthPosition, final int levelOne) { + private int getLevelTwo(long nthPosition, int levelOne) { final long base = levelOne > 0 ? idxHeader[levelOne - 1] : 0; return (int) (nthPosition - base); } /** {@inheritDoc} */ @Override - public ObjectId getObjectId(final long nthPosition) { + public ObjectId getObjectId(long nthPosition) { final int levelOne = findLevelOne(nthPosition); final int p = getLevelTwo(nthPosition, levelOne); final int dataIdx = idOffset(p); @@ -161,7 +161,7 @@ class PackIndexV1 extends PackIndex { /** {@inheritDoc} */ @Override - public long findOffset(final AnyObjectId objId) { + public long findOffset(AnyObjectId objId) { final int levelOne = objId.getFirstByte(); byte[] data = idxdata[levelOne]; if (data == null) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java index 9f6201f9a7..a9606cfa2d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java @@ -176,7 +176,7 @@ class PackIndexV2 extends PackIndex { return offset64.length / 8; } - private int findLevelOne(final long nthPosition) { + private int findLevelOne(long nthPosition) { int levelOne = Arrays.binarySearch(fanoutTable, nthPosition + 1); if (levelOne >= 0) { // If we hit the bucket exactly the item is in the bucket, or @@ -193,14 +193,14 @@ class PackIndexV2 extends PackIndex { return levelOne; } - private int getLevelTwo(final long nthPosition, final int levelOne) { + private int getLevelTwo(long nthPosition, int levelOne) { final long base = levelOne > 0 ? fanoutTable[levelOne - 1] : 0; return (int) (nthPosition - base); } /** {@inheritDoc} */ @Override - public ObjectId getObjectId(final long nthPosition) { + public ObjectId getObjectId(long nthPosition) { final int levelOne = findLevelOne(nthPosition); final int p = getLevelTwo(nthPosition, levelOne); final int p4 = p << 2; @@ -209,7 +209,7 @@ class PackIndexV2 extends PackIndex { /** {@inheritDoc} */ @Override - public long getOffset(final long nthPosition) { + public long getOffset(long nthPosition) { final int levelOne = findLevelOne(nthPosition); final int levelTwo = getLevelTwo(nthPosition, levelOne); return getOffset(levelOne, levelTwo); @@ -217,7 +217,7 @@ class PackIndexV2 extends PackIndex { /** {@inheritDoc} */ @Override - public long findOffset(final AnyObjectId objId) { + public long findOffset(AnyObjectId objId) { final int levelOne = objId.getFirstByte(); final int levelTwo = binarySearchLevelTwo(objId, levelOne); if (levelTwo == -1) @@ -225,7 +225,7 @@ class PackIndexV2 extends PackIndex { return getOffset(levelOne, levelTwo); } - private long getOffset(final int levelOne, final int levelTwo) { + private long getOffset(int levelOne, int levelTwo) { final long p = NB.decodeUInt32(offset32[levelOne], levelTwo << 2); if ((p & IS_O64) != 0) return NB.decodeUInt64(offset64, (8 * (int) (p & ~IS_O64))); @@ -290,7 +290,7 @@ class PackIndexV2 extends PackIndex { return (p << 2) + p; // p * 5 } - private int binarySearchLevelTwo(final AnyObjectId objId, final int levelOne) { + private int binarySearchLevelTwo(AnyObjectId objId, int levelOne) { final int[] data = names[levelOne]; int high = offset32[levelOne].length >>> 2; if (high == 0) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriter.java index b92f7b207c..61bb902a97 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriter.java @@ -180,7 +180,7 @@ public abstract class PackIndexWriter { * the stream this instance outputs to. If not already buffered * it will be automatically wrapped in a buffered stream. */ - protected PackIndexWriter(final OutputStream dst) { + protected PackIndexWriter(OutputStream dst) { out = new DigestOutputStream(dst instanceof BufferedOutputStream ? dst : new BufferedOutputStream(dst), Constants.newMessageDigest()); @@ -250,7 +250,7 @@ public abstract class PackIndexWriter { * @throws java.io.IOException * an error occurred while writing to the output stream. */ - protected void writeTOC(final int version) throws IOException { + protected void writeTOC(int version) throws IOException { out.write(TOC); NB.encodeInt32(tmp, 0, version); out.write(tmp, 0, 4); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackInserter.java index 7ff269694b..0ce3cc93ce 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackInserter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackInserter.java @@ -438,7 +438,7 @@ public class PackInserter extends ObjectInserter { } @Override - public void write(final int b) throws IOException { + public void write(int b) throws IOException { hdrBuf[0] = (byte) b; write(hdrBuf, 0, 1); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackLock.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackLock.java index 82f0da1c8c..0fb8911ba5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackLock.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackLock.java @@ -65,7 +65,7 @@ public class PackLock { * @param fs * the filesystem abstraction used by the repository. */ - public PackLock(final File packFile, final FS fs) { + public PackLock(File packFile, FS fs) { final File p = packFile.getParentFile(); final String n = packFile.getName(); keepFile = new File(p, n.substring(0, n.length() - 5) + ".keep"); //$NON-NLS-1$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackReverseIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackReverseIndex.java index 944af26dc5..fb7eddf6b6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackReverseIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackReverseIndex.java @@ -88,7 +88,7 @@ public class PackReverseIndex { * @param packIndex * forward index - entries to (reverse) index. */ - public PackReverseIndex(final PackIndex packIndex) { + public PackReverseIndex(PackIndex packIndex) { index = packIndex; final long cnt = index.getObjectCount(); @@ -155,7 +155,7 @@ public class PackReverseIndex { * start offset of object to find. * @return object id for this offset, or null if no object was found. */ - public ObjectId findObject(final long offset) { + public ObjectId findObject(long offset) { final int ith = binarySearch(offset); if (ith < 0) return null; @@ -177,7 +177,7 @@ public class PackReverseIndex { * @throws org.eclipse.jgit.errors.CorruptObjectException * when there is no object with the provided offset. */ - public long findNextOffset(final long offset, final long maxOffset) + public long findNextOffset(long offset, long maxOffset) throws CorruptObjectException { final int ith = binarySearch(offset); if (ith < 0) @@ -195,7 +195,7 @@ public class PackReverseIndex { return binarySearch(offset); } - private int binarySearch(final long offset) { + private int binarySearch(long offset) { int bucket = (int) (offset / bucketSize); int low = bucket == 0 ? 0 : offsetIndex[bucket - 1]; int high = offsetIndex[bucket]; 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 198775cc13..8e3357fdcb 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 @@ -345,7 +345,7 @@ public class RefDirectory extends RefDatabase { /** {@inheritDoc} */ @Override - public Ref getRef(final String needle) throws IOException { + public Ref getRef(String needle) throws IOException { final RefList packed = getPackedRefs(); Ref ref = null; for (String prefix : SEARCH_PATH) { @@ -545,7 +545,7 @@ public class RefDirectory extends RefDatabase { /** {@inheritDoc} */ @Override - public Ref peel(final Ref ref) throws IOException { + public Ref peel(Ref ref) throws IOException { final Ref leaf = ref.getLeaf(); if (leaf.isPeeled() || leaf.getObjectId() == null) return ref; @@ -567,7 +567,7 @@ public class RefDirectory extends RefDatabase { return recreate(ref, newLeaf); } - private ObjectIdRef doPeel(final Ref leaf) throws MissingObjectException, + private ObjectIdRef doPeel(Ref leaf) throws MissingObjectException, IOException { try (RevWalk rw = new RevWalk(getRepository())) { RevObject obj = rw.parseAny(leaf.getObjectId()); @@ -581,7 +581,7 @@ public class RefDirectory extends RefDatabase { } } - private static Ref recreate(final Ref old, final ObjectIdRef leaf) { + private static Ref recreate(Ref old, ObjectIdRef leaf) { if (old.isSymbolic()) { Ref dst = recreate(old.getTarget(), leaf); return new SymbolicRef(old.getName(), dst); @@ -971,7 +971,7 @@ public class RefDirectory extends RefDatabase { } } - private RefList parsePackedRefs(final BufferedReader br) + private RefList parsePackedRefs(BufferedReader br) throws IOException { RefList.Builder all = new RefList.Builder<>(); Ref last = null; @@ -1023,7 +1023,7 @@ public class RefDirectory extends RefDatabase { return all.toRefList(); } - private static String copy(final String src, final int off, final int end) { + private static String copy(String src, int off, int end) { // Don't use substring since it could leave a reference to the much // larger existing string. Force construction of a full new object. return new StringBuilder(end - off).append(src, off, end).toString(); @@ -1189,7 +1189,7 @@ public class RefDirectory extends RefDatabase { return new LooseUnpeeled(otherSnapshot, name, id); } - private static boolean isSymRef(final byte[] buf, int n) { + private static boolean isSymRef(byte[] buf, int n) { if (n < 6) return false; return /**/buf[0] == 'r' // @@ -1273,7 +1273,7 @@ public class RefDirectory extends RefDatabase { delete(file, depth, null); } - private static void delete(final File file, final int depth, LockFile rLck) + private static void delete(File file, int depth, LockFile rLck) throws IOException { if (!file.delete() && file.isFile()) { throw new IOException(MessageFormat.format( diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java index 4d6b245705..fb839dff61 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java @@ -106,7 +106,7 @@ class RefDirectoryUpdate extends RefUpdate { /** {@inheritDoc} */ @Override - protected Result doUpdate(final Result status) throws IOException { + protected Result doUpdate(Result status) throws IOException { WriteConfig wc = database.getRepository().getConfig() .get(WriteConfig.KEY); @@ -148,7 +148,7 @@ class RefDirectoryUpdate extends RefUpdate { /** {@inheritDoc} */ @Override - protected Result doDelete(final Result status) throws IOException { + protected Result doDelete(Result status) throws IOException { if (getRef().getStorage() != Ref.Storage.NEW) database.delete(this); return status; @@ -156,7 +156,7 @@ class RefDirectoryUpdate extends RefUpdate { /** {@inheritDoc} */ @Override - protected Result doLink(final String target) throws IOException { + protected Result doLink(String target) throws IOException { WriteConfig wc = database.getRepository().getConfig() .get(WriteConfig.KEY); 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 e71284fb62..c03fb2f835 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 @@ -157,7 +157,7 @@ public class WindowCache { * settings, usually too low of a limit. */ @Deprecated - public static void reconfigure(final WindowCacheConfig cfg) { + public static void reconfigure(WindowCacheConfig cfg) { final WindowCache nc = new WindowCache(cfg); final WindowCache oc = cache; if (oc != null) @@ -232,7 +232,7 @@ public class WindowCache { private final AtomicLong openBytes; - private WindowCache(final WindowCacheConfig cfg) { + private WindowCache(WindowCacheConfig cfg) { tableSize = tableSize(cfg); final int lockCount = lockCount(cfg); if (tableSize < 1) @@ -286,11 +286,11 @@ public class WindowCache { return openBytes.get(); } - private int hash(final int packHash, final long off) { + private int hash(int packHash, long off) { return packHash + (int) (off >>> windowSizeShift); } - private ByteWindow load(final PackFile pack, final long offset) + private ByteWindow load(PackFile pack, long offset) throws IOException { if (pack.beginWindowCache()) openFiles.incrementAndGet(); @@ -310,18 +310,18 @@ public class WindowCache { } } - private Ref createRef(final PackFile p, final long o, final ByteWindow v) { + private Ref createRef(PackFile p, long o, ByteWindow v) { final Ref ref = new Ref(p, o, v, queue); openBytes.addAndGet(ref.size); return ref; } - private void clear(final Ref ref) { + private void clear(Ref ref) { openBytes.addAndGet(-ref.size); close(ref.pack); } - private void close(final PackFile pack) { + private void close(PackFile pack) { if (pack.endWindowCache()) openFiles.decrementAndGet(); } @@ -330,11 +330,11 @@ public class WindowCache { return maxFiles < openFiles.get() || maxBytes < openBytes.get(); } - private long toStart(final long offset) { + private long toStart(long offset) { return (offset >>> windowSizeShift) << windowSizeShift; } - private static int tableSize(final WindowCacheConfig cfg) { + private static int tableSize(WindowCacheConfig cfg) { final int wsz = cfg.getPackedGitWindowSize(); final long limit = cfg.getPackedGitLimit(); if (wsz <= 0) @@ -344,7 +344,7 @@ public class WindowCache { return (int) Math.min(5 * (limit / wsz) / 2, 2000000000); } - private static int lockCount(final WindowCacheConfig cfg) { + private static int lockCount(WindowCacheConfig cfg) { return Math.max(cfg.getPackedGitOpenFiles(), 32); } @@ -360,7 +360,7 @@ public class WindowCache { * the object reference was not in the cache and could not be * obtained by {@link #load(PackFile, long)}. */ - private ByteWindow getOrLoad(final PackFile pack, final long position) + private ByteWindow getOrLoad(PackFile pack, long position) throws IOException { final int slot = slot(pack, position); final Entry e1 = table.get(slot); @@ -399,7 +399,7 @@ public class WindowCache { return v; } - private ByteWindow scan(Entry n, final PackFile pack, final long position) { + private ByteWindow scan(Entry n, PackFile pack, long position) { for (; n != null; n = n.next) { final Ref r = n.ref; if (r.pack == pack && r.position == position) { @@ -415,7 +415,7 @@ public class WindowCache { return null; } - private void hit(final Ref r) { + private void hit(Ref r) { // We don't need to be 100% accurate here. Its sufficient that at least // one thread performs the increment. Any other concurrent access at // exactly the same time can simply use the same clock value. @@ -487,7 +487,7 @@ public class WindowCache { * @param pack * the file to purge all entries of. */ - private void removeAll(final PackFile pack) { + private void removeAll(PackFile pack) { for (int s = 0; s < tableSize; s++) { final Entry e1 = table.get(s); boolean hasDead = false; @@ -521,11 +521,11 @@ public class WindowCache { } } - private int slot(final PackFile pack, final long position) { + private int slot(PackFile pack, long position) { return (hash(pack.hash, position) >>> 1) % tableSize; } - private Lock lock(final PackFile pack, final long position) { + private Lock lock(PackFile pack, long position) { return locks[(hash(pack.hash, position) >>> 1) % locks.length]; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WriteConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WriteConfig.java index d9cbbd8f82..23055ee957 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WriteConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WriteConfig.java @@ -57,7 +57,7 @@ class WriteConfig { private final boolean fsyncRefFiles; - private WriteConfig(final Config rc) { + private WriteConfig(Config rc) { compression = rc.get(CoreConfig.KEY).getCompression(); fsyncObjectFiles = rc.getBoolean("core", "fsyncobjectfiles", false); //$NON-NLS-1$ //$NON-NLS-2$ fsyncRefFiles = rc.getBoolean("core", "fsyncreffiles", false); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BinaryDelta.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BinaryDelta.java index 2565931e05..c7e5ad6232 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BinaryDelta.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BinaryDelta.java @@ -64,7 +64,7 @@ public class BinaryDelta { * the delta stream, or at least the header of it. * @return the base object's size. */ - public static long getBaseSize(final byte[] delta) { + public static long getBaseSize(byte[] delta) { int p = 0; long baseLen = 0; int c, shift = 0; @@ -83,7 +83,7 @@ public class BinaryDelta { * the delta stream, or at least the header of it. * @return the resulting object's size. */ - public static long getResultSize(final byte[] delta) { + public static long getResultSize(byte[] delta) { int p = 0; // Skip length of the base object. @@ -114,7 +114,7 @@ public class BinaryDelta { * another. * @return patched base */ - public static final byte[] apply(final byte[] base, final byte[] delta) { + public static final byte[] apply(byte[] base, byte[] delta) { return apply(base, delta, null); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndexScanner.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndexScanner.java index 969d02b946..944a9e5e4d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndexScanner.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndexScanner.java @@ -89,7 +89,7 @@ class DeltaIndexScanner { } } - private void scan(byte[] raw, final int end) { + private void scan(byte[] raw, int end) { // We scan the input backwards, and always insert onto the // front of the chain. This ensures that chains will have lower // offsets at the front of the chain, allowing us to prefer the @@ -120,7 +120,7 @@ class DeltaIndexScanner { } while (0 <= ptr); } - private static int tableSize(final int worstCaseBlockCnt) { + private static int tableSize(int worstCaseBlockCnt) { int shift = 32 - Integer.numberOfLeadingZeros(worstCaseBlockCnt); int sz = 1 << (shift - 1); if (sz < worstCaseBlockCnt) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaWindow.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaWindow.java index 73b285afc1..a047534fbf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaWindow.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaWindow.java @@ -266,7 +266,7 @@ final class DeltaWindow { deltaBuf = null; } - private boolean delta(final DeltaWindowEntry src) + private boolean delta(DeltaWindowEntry src) throws IOException { // If the sizes are radically different, this is a bad pairing. if (res.size() < src.size() >>> 4) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java index e8c75107b9..a30bf982fa 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java @@ -103,7 +103,7 @@ public class ObjectToPack extends PackedObjectInfo { * @param type * real type code of the object, not its in-pack type. */ - public ObjectToPack(AnyObjectId src, final int type) { + public ObjectToPack(AnyObjectId src, int type) { super(src); flags = type << TYPE_SHIFT; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackOutputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackOutputStream.java index fd9c1a00d3..7f38a7b51a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackOutputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackOutputStream.java @@ -107,7 +107,7 @@ public final class PackOutputStream extends OutputStream { /** {@inheritDoc} */ @Override - public final void write(final int b) throws IOException { + public final void write(int b) throws IOException { count++; out.write(b); md.update((byte) b); @@ -115,7 +115,7 @@ public final class PackOutputStream extends OutputStream { /** {@inheritDoc} */ @Override - public final void write(final byte[] b, int off, int len) + public final void write(byte[] b, int off, int len) throws IOException { while (0 < len) { final int n = Math.min(len, BYTES_TO_WRITE_BEFORE_CANCEL_CHECK); 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 490766b8f7..f5e600d558 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 @@ -314,7 +314,7 @@ public class PackWriter implements AutoCloseable { * @param repo * repository where objects are stored. */ - public PackWriter(final Repository repo) { + public PackWriter(Repository repo) { this(repo, repo.newObjectReader()); } @@ -327,7 +327,7 @@ public class PackWriter implements AutoCloseable { * @param reader * reader to read from the repository with. */ - public PackWriter(final ObjectReader reader) { + public PackWriter(ObjectReader reader) { this(new PackConfig(), reader); } @@ -342,7 +342,7 @@ public class PackWriter implements AutoCloseable { * @param reader * reader to read from the repository with. */ - public PackWriter(final Repository repo, final ObjectReader reader) { + public PackWriter(Repository repo, ObjectReader reader) { this(new PackConfig(repo), reader); } @@ -357,7 +357,7 @@ public class PackWriter implements AutoCloseable { * @param reader * reader to read from the repository with. */ - public PackWriter(final PackConfig config, final ObjectReader reader) { + public PackWriter(PackConfig config, ObjectReader reader) { this(config, reader, null); } @@ -512,7 +512,7 @@ public class PackWriter implements AutoCloseable { * determined by set; this kind of pack is used only for * transport; true - to produce thin pack, false - otherwise. */ - public void setThin(final boolean packthin) { + public void setThin(boolean packthin) { thin = packthin; } @@ -603,7 +603,7 @@ public class PackWriter implements AutoCloseable { * pack; false otherwise - non existing uninteresting objects may * cause {@link org.eclipse.jgit.errors.MissingObjectException} */ - public void setIgnoreMissingUninteresting(final boolean ignore) { + public void setIgnoreMissingUninteresting(boolean ignore) { ignoreMissingUninteresting = ignore; } @@ -924,7 +924,7 @@ public class PackWriter implements AutoCloseable { * @throws java.io.IOException * a cached pack cannot be examined. */ - public boolean willInclude(final AnyObjectId id) throws IOException { + public boolean willInclude(AnyObjectId id) throws IOException { ObjectToPack obj = objectsMap.get(id); return obj != null && !obj.isEdge(); } @@ -991,7 +991,7 @@ public class PackWriter implements AutoCloseable { * @throws java.io.IOException * the index data could not be written to the supplied stream. */ - public void writeIndex(final OutputStream indexStream) throws IOException { + public void writeIndex(OutputStream indexStream) throws IOException { if (isIndexDisabled()) throw new IOException(JGitText.get().cachedPacksPreventsIndexCreation); @@ -1013,7 +1013,7 @@ public class PackWriter implements AutoCloseable { * @throws java.io.IOException * the index data could not be written to the supplied stream. */ - public void writeBitmapIndex(final OutputStream bitmapIndexStream) + public void writeBitmapIndex(OutputStream bitmapIndexStream) throws IOException { if (writeBitmaps == null) throw new IOException(JGitText.get().bitmapsMustBePrepared); @@ -1733,7 +1733,7 @@ public class PackWriter implements AutoCloseable { typeStats.deltaBytes += out.length() - otp.getOffset(); } - private TemporaryBuffer.Heap delta(final ObjectToPack otp) + private TemporaryBuffer.Heap delta(ObjectToPack otp) throws IOException { DeltaIndex index = new DeltaIndex(buffer(otp.getDeltaBaseId())); byte[] res = buffer(otp); @@ -2050,13 +2050,13 @@ public class PackWriter implements AutoCloseable { * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException * the object is an unsupported type. */ - public void addObject(final RevObject object) + public void addObject(RevObject object) throws IncorrectObjectTypeException { if (!exclude(object)) addObject(object, 0); } - private void addObject(final RevObject object, final int pathHashCode) { + private void addObject(RevObject object, int pathHashCode) { addObject(object, object.getType(), pathHashCode); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTree.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTree.java index e9aa110419..5751dd6fa6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTree.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTree.java @@ -279,7 +279,7 @@ public class RefTree { return HEAD.equals(n) || Repository.isValidRefName(n); } - private void apply(DirCacheEditor ed, final Command cmd) { + private void apply(DirCacheEditor ed, Command cmd) { String path = refPath(cmd.getRefName()); Ref oldRef = cmd.getOldRef(); final Ref newRef = cmd.getNewRef(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java index 425f7f689a..6acc684bc7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java @@ -74,7 +74,7 @@ public final class AbbreviatedObjectId implements Serializable { * the string to test. * @return true if the string can converted into an AbbreviatedObjectId. */ - public static final boolean isId(final String id) { + public static final boolean isId(String id) { if (id.length() < 2 || Constants.OBJECT_ID_STRING_LENGTH < id.length()) return false; try { @@ -131,7 +131,7 @@ public final class AbbreviatedObjectId implements Serializable { * the string to read from. Must be <= 40 characters. * @return the converted object id. */ - public static final AbbreviatedObjectId fromString(final String str) { + public static final AbbreviatedObjectId fromString(String str) { if (str.length() > Constants.OBJECT_ID_STRING_LENGTH) throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidId, str)); final byte[] b = Constants.encodeASCII(str); @@ -244,7 +244,7 @@ public final class AbbreviatedObjectId implements Serializable { * >0 if this abbreviation names an object that is after * other. */ - public final int prefixCompare(final AnyObjectId other) { + public final int prefixCompare(AnyObjectId other) { int cmp; cmp = NB.compareUInt32(w1, mask(1, other.w1)); @@ -280,7 +280,7 @@ public final class AbbreviatedObjectId implements Serializable { * >0 if this abbreviation names an object that is after * other. */ - public final int prefixCompare(final byte[] bs, final int p) { + public final int prefixCompare(byte[] bs, int p) { int cmp; cmp = NB.compareUInt32(w1, mask(1, NB.decodeInt32(bs, p))); @@ -316,7 +316,7 @@ public final class AbbreviatedObjectId implements Serializable { * >0 if this abbreviation names an object that is after * other. */ - public final int prefixCompare(final int[] bs, final int p) { + public final int prefixCompare(int[] bs, int p) { int cmp; cmp = NB.compareUInt32(w1, mask(1, bs[p])); @@ -347,7 +347,7 @@ public final class AbbreviatedObjectId implements Serializable { return w1 >>> 24; } - private int mask(final int word, final int v) { + private int mask(int word, int v) { return mask(nibbles, word, v); } @@ -359,7 +359,7 @@ public final class AbbreviatedObjectId implements Serializable { /** {@inheritDoc} */ @Override - public boolean equals(final Object o) { + public boolean equals(Object o) { if (o instanceof AbbreviatedObjectId) { final AbbreviatedObjectId b = (AbbreviatedObjectId) o; return nibbles == b.nibbles && w1 == b.w1 && w2 == b.w2 diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java index 91c9a6b04e..e7d465b125 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java @@ -161,7 +161,7 @@ public abstract class AnyObjectId implements Comparable { * Compare this ObjectId to another and obtain a sort ordering. */ @Override - public final int compareTo(final AnyObjectId other) { + public final int compareTo(AnyObjectId other) { if (this == other) return 0; @@ -197,7 +197,7 @@ public abstract class AnyObjectId implements Comparable { * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. */ - public final int compareTo(final byte[] bs, final int p) { + public final int compareTo(byte[] bs, int p) { int cmp; cmp = NB.compareUInt32(w1, NB.decodeInt32(bs, p)); @@ -230,7 +230,7 @@ public abstract class AnyObjectId implements Comparable { * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. */ - public final int compareTo(final int[] bs, final int p) { + public final int compareTo(int[] bs, int p) { int cmp; cmp = NB.compareUInt32(w1, bs[p]); @@ -259,7 +259,7 @@ public abstract class AnyObjectId implements Comparable { * the abbreviation. * @return true if this ObjectId begins with the abbreviation; else false. */ - public boolean startsWith(final AbbreviatedObjectId abbr) { + public boolean startsWith(AbbreviatedObjectId abbr) { return abbr.prefixCompare(this) == 0; } @@ -276,13 +276,13 @@ public abstract class AnyObjectId implements Comparable { * the other id to compare to. May be null. * @return true only if both ObjectIds have identical bits. */ - public final boolean equals(final AnyObjectId other) { + public final boolean equals(AnyObjectId other) { return other != null ? equals(this, other) : false; } /** {@inheritDoc} */ @Override - public final boolean equals(final Object o) { + public final boolean equals(Object o) { if (o instanceof AnyObjectId) return equals((AnyObjectId) o); else @@ -295,7 +295,7 @@ public abstract class AnyObjectId implements Comparable { * @param w * the buffer to copy to. Must be in big endian order. */ - public void copyRawTo(final ByteBuffer w) { + public void copyRawTo(ByteBuffer w) { w.putInt(w1); w.putInt(w2); w.putInt(w3); @@ -311,7 +311,7 @@ public abstract class AnyObjectId implements Comparable { * @param o * the offset within b to write at. */ - public void copyRawTo(final byte[] b, final int o) { + public void copyRawTo(byte[] b, int o) { NB.encodeInt32(b, o, w1); NB.encodeInt32(b, o + 4, w2); NB.encodeInt32(b, o + 8, w3); @@ -327,7 +327,7 @@ public abstract class AnyObjectId implements Comparable { * @param o * the offset within b to write at. */ - public void copyRawTo(final int[] b, final int o) { + public void copyRawTo(int[] b, int o) { b[o] = w1; b[o + 1] = w2; b[o + 2] = w3; @@ -343,7 +343,7 @@ public abstract class AnyObjectId implements Comparable { * @throws java.io.IOException * the stream writing failed. */ - public void copyRawTo(final OutputStream w) throws IOException { + public void copyRawTo(OutputStream w) throws IOException { writeRawInt(w, w1); writeRawInt(w, w2); writeRawInt(w, w3); @@ -351,7 +351,7 @@ public abstract class AnyObjectId implements Comparable { writeRawInt(w, w5); } - private static void writeRawInt(final OutputStream w, int v) + private static void writeRawInt(OutputStream w, int v) throws IOException { w.write(v >>> 24); w.write(v >>> 16); @@ -367,7 +367,7 @@ public abstract class AnyObjectId implements Comparable { * @throws java.io.IOException * the stream writing failed. */ - public void copyTo(final OutputStream w) throws IOException { + public void copyTo(OutputStream w) throws IOException { w.write(toHexByteArray()); } @@ -410,7 +410,7 @@ public abstract class AnyObjectId implements Comparable { private static final byte[] hexbyte = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; - private static void formatHexByte(final byte[] dst, final int p, int w) { + private static void formatHexByte(byte[] dst, int p, int w) { int o = p + 7; while (o >= p && w != 0) { dst[o--] = hexbyte[w & 0xf]; @@ -428,7 +428,7 @@ public abstract class AnyObjectId implements Comparable { * @throws java.io.IOException * the stream writing failed. */ - public void copyTo(final Writer w) throws IOException { + public void copyTo(Writer w) throws IOException { w.write(toHexCharArray()); } @@ -444,7 +444,7 @@ public abstract class AnyObjectId implements Comparable { * @throws java.io.IOException * the stream writing failed. */ - public void copyTo(final char[] tmp, final Writer w) throws IOException { + public void copyTo(char[] tmp, Writer w) throws IOException { toHexCharArray(tmp); w.write(tmp, 0, Constants.OBJECT_ID_STRING_LENGTH); } @@ -459,7 +459,7 @@ public abstract class AnyObjectId implements Comparable { * @param w * the string to append onto. */ - public void copyTo(final char[] tmp, final StringBuilder w) { + public void copyTo(char[] tmp, StringBuilder w) { toHexCharArray(tmp); w.append(tmp, 0, Constants.OBJECT_ID_STRING_LENGTH); } @@ -470,7 +470,7 @@ public abstract class AnyObjectId implements Comparable { return dst; } - private void toHexCharArray(final char[] dst) { + private void toHexCharArray(char[] dst) { formatHexChar(dst, 0, w1); formatHexChar(dst, 8, w2); formatHexChar(dst, 16, w3); @@ -529,7 +529,7 @@ public abstract class AnyObjectId implements Comparable { * length of the abbreviated string. * @return SHA-1 abbreviation. */ - public AbbreviatedObjectId abbreviate(final int len) { + public AbbreviatedObjectId abbreviate(int len) { final int a = AbbreviatedObjectId.mask(len, 1, w1); final int b = AbbreviatedObjectId.mask(len, 2, w2); final int c = AbbreviatedObjectId.mask(len, 3, w3); 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 6919f7ef0f..5e17553706 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java @@ -179,7 +179,7 @@ public class BatchRefUpdate { * configuration. * @return {@code this}. */ - public BatchRefUpdate setRefLogIdent(final PersonIdent pi) { + public BatchRefUpdate setRefLogIdent(PersonIdent pi) { refLogIdent = pi; return this; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobBasedConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobBasedConfig.java index f44aeceb52..e008be3a3c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobBasedConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobBasedConfig.java @@ -78,7 +78,7 @@ public class BlobBasedConfig extends Config { * @throws org.eclipse.jgit.errors.ConfigInvalidException * the byte array is not a valid configuration format. */ - public BlobBasedConfig(Config base, final byte[] blob) + public BlobBasedConfig(Config base, byte[] blob) throws ConfigInvalidException { super(base); final String decoded; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java index 596da0349c..be53c4b4f6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java @@ -107,7 +107,7 @@ public class BranchConfig { * @param branchName * the short branch name of the section to read */ - public BranchConfig(final Config config, String branchName) { + public BranchConfig(Config config, String branchName) { this.config = config; this.branchName = branchName; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java index 2217fde049..59a13f6550 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java @@ -243,7 +243,7 @@ public class CommitBuilder { * @param newMessage * the commit message. Should not be null. */ - public void setMessage(final String newMessage) { + public void setMessage(String newMessage) { message = newMessage; } 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 285a56c87a..f59cc6961d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java @@ -376,7 +376,7 @@ public class Config { } @SuppressWarnings("unchecked") - private static T[] allValuesOf(final T value) { + private static T[] allValuesOf(T value) { try { return (T[]) value.getClass().getMethod("values").invoke(null); //$NON-NLS-1$ } catch (Exception err) { @@ -515,7 +515,7 @@ public class Config { * order they are declared by the configuration starting from this * instance and progressing through the base. */ - public Set getSubsections(final String section) { + public Set getSubsections(String section) { return getState().getSubsections(section); } @@ -601,7 +601,7 @@ public class Config { * @return the parsed object instance, which is cached inside this config. */ @SuppressWarnings("unchecked") - public T get(final SectionParser parser) { + public T get(SectionParser parser) { final ConfigSnapshot myState = getState(); T obj = (T) myState.cache.get(parser); if (obj == null) { @@ -621,7 +621,7 @@ public class Config { * parser used to obtain the configuration object. * @see #get(SectionParser) */ - public void uncache(final SectionParser parser) { + public void uncache(SectionParser parser) { state.get().cache.remove(parser); } @@ -1059,11 +1059,11 @@ public class Config { * the text supplied is not formatted correctly. No changes were * made to {@code this}. */ - public void fromText(final String text) throws ConfigInvalidException { + public void fromText(String text) throws ConfigInvalidException { state.set(newState(fromTextRecurse(text, 1))); } - private List fromTextRecurse(final String text, int depth) + private List fromTextRecurse(String text, int depth) throws ConfigInvalidException { if (depth > MAX_DEPTH) { throw new ConfigInvalidException( @@ -1185,7 +1185,7 @@ public class Config { getBaseState()); } - private ConfigSnapshot newState(final List entries) { + private ConfigSnapshot newState(List entries) { return new ConfigSnapshot(Collections.unmodifiableList(entries), getBaseState()); } @@ -1210,7 +1210,7 @@ public class Config { && bytes[1] == (byte) 0xBB && bytes[2] == (byte) 0xBF; } - private static String readSectionName(final StringReader in) + private static String readSectionName(StringReader in) throws ConfigInvalidException { final StringBuilder name = new StringBuilder(); for (;;) { @@ -1249,7 +1249,7 @@ public class Config { return name.toString(); } - private static String readKeyName(final StringReader in) + private static String readKeyName(StringReader in) throws ConfigInvalidException { final StringBuilder name = new StringBuilder(); for (;;) { @@ -1336,7 +1336,7 @@ public class Config { return r.toString(); } - private static String readValue(final StringReader in) + private static String readValue(StringReader in) throws ConfigInvalidException { StringBuilder value = new StringBuilder(); StringBuilder trailingSpaces = null; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java index d5f1d8f085..011cecccac 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java @@ -96,7 +96,7 @@ class ConfigLine { && eqSameCase(subsection, aSubsection); } - private static boolean eqIgnoreCase(final String a, final String b) { + private static boolean eqIgnoreCase(String a, String b) { if (a == null && b == null) return true; if (a == null || b == null) @@ -104,7 +104,7 @@ class ConfigLine { return StringUtils.equalsIgnoreCase(a, b); } - private static boolean eqSameCase(final String a, final String b) { + private static boolean eqSameCase(String a, String b) { if (a == null && b == null) return true; if (a == null || b == null) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java index 5c7cee6ca5..a119480ea4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java @@ -477,7 +477,7 @@ public final class Constants { * @param typeCode the type code, from a pack representation. * @return the canonical string name of this type. */ - public static String typeString(final int typeCode) { + public static String typeString(int typeCode) { switch (typeCode) { case OBJ_COMMIT: return TYPE_COMMIT; @@ -502,7 +502,7 @@ public final class Constants { * @param typeCode the type code, from a pack representation. * @return the canonical ASCII encoded name of this type. */ - public static byte[] encodedTypeString(final int typeCode) { + public static byte[] encodedTypeString(int typeCode) { switch (typeCode) { case OBJ_COMMIT: return ENCODED_TYPE_COMMIT; @@ -601,7 +601,7 @@ public final class Constants { * @return a decimal representation of the input integer. The returned array * is the smallest array that will hold the value. */ - public static byte[] encodeASCII(final long s) { + public static byte[] encodeASCII(long s) { return encodeASCII(Long.toString(s)); } @@ -617,7 +617,7 @@ public final class Constants { * the input string contains one or more characters outside of * the 7-bit ASCII character space. */ - public static byte[] encodeASCII(final String s) { + public static byte[] encodeASCII(String s) { final byte[] r = new byte[s.length()]; for (int k = r.length - 1; k >= 0; k--) { final char c = s.charAt(k); @@ -637,7 +637,7 @@ public final class Constants { * default character encoding (UTF-8). * @see #CHARACTER_ENCODING */ - public static byte[] encode(final String str) { + public static byte[] encode(String str) { final ByteBuffer bb = Constants.CHARSET.encode(str); final int len = bb.limit(); if (bb.hasArray() && bb.arrayOffset() == 0) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java index 32a894f795..98de3a91cc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java @@ -166,7 +166,7 @@ public class CoreConfig { DOTGITONLY } - private CoreConfig(final Config rc) { + private CoreConfig(Config rc) { compression = rc.getInt(ConfigConstants.CONFIG_CORE_SECTION, ConfigConstants.CONFIG_KEY_COMPRESSION, DEFAULT_COMPRESSION); packIndexVersion = rc.getInt(ConfigConstants.CONFIG_PACK_SECTION, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java index 68f881dd1e..89aef7fcf4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java @@ -270,7 +270,7 @@ public class DefaultTypedConfigGetter implements TypedConfigGetter { } } - private static boolean match(final String a, final String... cases) { + private static boolean match(String a, String... cases) { for (final String b : cases) { if (b != null && b.equalsIgnoreCase(a)) { return true; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/FileMode.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/FileMode.java index 7852371648..d4c4d5b40d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/FileMode.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/FileMode.java @@ -88,7 +88,7 @@ public abstract class FileMode { public static final FileMode TREE = new FileMode(TYPE_TREE, Constants.OBJ_TREE) { @Override - public boolean equals(final int modeBits) { + public boolean equals(int modeBits) { return (modeBits & TYPE_MASK) == TYPE_TREE; } }; @@ -97,7 +97,7 @@ public abstract class FileMode { public static final FileMode SYMLINK = new FileMode(TYPE_SYMLINK, Constants.OBJ_BLOB) { @Override - public boolean equals(final int modeBits) { + public boolean equals(int modeBits) { return (modeBits & TYPE_MASK) == TYPE_SYMLINK; } }; @@ -106,7 +106,7 @@ public abstract class FileMode { public static final FileMode REGULAR_FILE = new FileMode(0100644, Constants.OBJ_BLOB) { @Override - public boolean equals(final int modeBits) { + public boolean equals(int modeBits) { return (modeBits & TYPE_MASK) == TYPE_FILE && (modeBits & 0111) == 0; } }; @@ -115,7 +115,7 @@ public abstract class FileMode { public static final FileMode EXECUTABLE_FILE = new FileMode(0100755, Constants.OBJ_BLOB) { @Override - public boolean equals(final int modeBits) { + public boolean equals(int modeBits) { return (modeBits & TYPE_MASK) == TYPE_FILE && (modeBits & 0111) != 0; } }; @@ -124,7 +124,7 @@ public abstract class FileMode { public static final FileMode GITLINK = new FileMode(TYPE_GITLINK, Constants.OBJ_COMMIT) { @Override - public boolean equals(final int modeBits) { + public boolean equals(int modeBits) { return (modeBits & TYPE_MASK) == TYPE_GITLINK; } }; @@ -133,7 +133,7 @@ public abstract class FileMode { public static final FileMode MISSING = new FileMode(TYPE_MISSING, Constants.OBJ_BAD) { @Override - public boolean equals(final int modeBits) { + public boolean equals(int modeBits) { return modeBits == 0; } }; @@ -145,7 +145,7 @@ public abstract class FileMode { * the mode bits the caller has somehow obtained. * @return the FileMode instance that represents the given bits. */ - public static final FileMode fromBits(final int bits) { + public static final FileMode fromBits(int bits) { switch (bits & TYPE_MASK) { case TYPE_MISSING: if (bits == 0) @@ -165,7 +165,7 @@ public abstract class FileMode { return new FileMode(bits, Constants.OBJ_BAD) { @Override - public boolean equals(final int a) { + public boolean equals(int a) { return bits == a; } }; @@ -177,7 +177,7 @@ public abstract class FileMode { private final int objectType; - private FileMode(int mode, final int expType) { + private FileMode(int mode, int expType) { modeBits = mode; objectType = expType; if (mode != 0) { @@ -206,7 +206,7 @@ public abstract class FileMode { * a int. * @return true if the mode bits represent the same mode as this object */ - public abstract boolean equals(final int modebits); + public abstract boolean equals(int modebits); /** * Copy this mode as a sequence of octal US-ASCII bytes. @@ -222,7 +222,7 @@ public abstract class FileMode { * @throws java.io.IOException * the stream encountered an error during the copy. */ - public void copyTo(final OutputStream os) throws IOException { + public void copyTo(OutputStream os) throws IOException { os.write(octalBytes); } 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 fbdffbc48e..94b9ddc188 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java @@ -742,7 +742,7 @@ public class IndexDiff { * @param path a {@link java.lang.String} object. * @return file mode */ - public FileMode getIndexMode(final String path) { + public FileMode getIndexMode(String path) { final DirCacheEntry entry = dirCache.getEntry(path); return entry != null ? entry.getFileMode() : FileMode.MISSING; } @@ -756,7 +756,7 @@ public class IndexDiff { * the given file mode * @since 3.6 */ - public Set getPathsWithIndexMode(final FileMode mode) { + public Set getPathsWithIndexMode(FileMode mode) { Set paths = fileModes.get(mode); if (paths == null) paths = new HashSet<>(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/InflaterCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/InflaterCache.java index a97721c732..dd0f18e165 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/InflaterCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/InflaterCache.java @@ -89,7 +89,7 @@ public class InflaterCache { * the inflater to return. May be null, in which case this method * does nothing. */ - public static void release(final Inflater i) { + public static void release(Inflater i) { if (i != null) { i.reset(); if (releaseImpl(i)) @@ -97,7 +97,7 @@ public class InflaterCache { } } - private static synchronized boolean releaseImpl(final Inflater i) { + private static synchronized boolean releaseImpl(Inflater i) { if (openInflaterCount < SZ) { inflaterCache[openInflaterCount++] = i; return false; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/MutableObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/MutableObjectId.java index e492af94b9..8cf0fd05c4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/MutableObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/MutableObjectId.java @@ -162,7 +162,7 @@ public class MutableObjectId extends AnyObjectId { * the raw byte buffer to read from. At least 20 bytes must be * available within this byte array. */ - public void fromRaw(final byte[] bs) { + public void fromRaw(byte[] bs) { fromRaw(bs, 0); } @@ -175,7 +175,7 @@ public class MutableObjectId extends AnyObjectId { * @param p * position to read the first byte of data from. */ - public void fromRaw(final byte[] bs, final int p) { + public void fromRaw(byte[] bs, int p) { w1 = NB.decodeInt32(bs, p); w2 = NB.decodeInt32(bs, p + 4); w3 = NB.decodeInt32(bs, p + 8); @@ -190,7 +190,7 @@ public class MutableObjectId extends AnyObjectId { * the raw int buffer to read from. At least 5 integers must be * available within this integers array. */ - public void fromRaw(final int[] ints) { + public void fromRaw(int[] ints) { fromRaw(ints, 0); } @@ -203,7 +203,7 @@ public class MutableObjectId extends AnyObjectId { * @param p * position to read the first integer of data from. */ - public void fromRaw(final int[] ints, final int p) { + public void fromRaw(int[] ints, int p) { w1 = ints[p]; w2 = ints[p + 1]; w3 = ints[p + 2]; @@ -243,7 +243,7 @@ public class MutableObjectId extends AnyObjectId { * @param offset * position to read the first character from. */ - public void fromString(final byte[] buf, final int offset) { + public void fromString(byte[] buf, int offset) { fromHexString(buf, offset); } @@ -253,14 +253,14 @@ public class MutableObjectId extends AnyObjectId { * @param str * the string to read from. Must be 40 characters long. */ - public void fromString(final String str) { + public void fromString(String str) { if (str.length() != Constants.OBJECT_ID_STRING_LENGTH) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().invalidId, str)); fromHexString(Constants.encodeASCII(str), 0); } - private void fromHexString(final byte[] bs, int p) { + private void fromHexString(byte[] bs, int p) { try { w1 = RawParseUtils.parseHexInt32(bs, p); w2 = RawParseUtils.parseHexInt32(bs, p + 8); 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 a6d2c3f22c..689659b398 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java @@ -1105,7 +1105,7 @@ public class ObjectChecker { * @throws org.eclipse.jgit.errors.CorruptObjectException * if any error was detected. */ - public void checkBlob(final byte[] raw) throws CorruptObjectException { + public void checkBlob(byte[] raw) throws CorruptObjectException { // We can always assume the blob is valid. } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java index bbef51da20..3abdc0c41a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java @@ -121,7 +121,7 @@ public abstract class ObjectDatabase { * @throws java.io.IOException * the object store cannot be accessed. */ - public boolean has(final AnyObjectId objectId) throws IOException { + public boolean has(AnyObjectId objectId) throws IOException { try (final ObjectReader or = newReader()) { return or.has(objectId); } @@ -141,7 +141,7 @@ public abstract class ObjectDatabase { * @throws java.io.IOException * the object store cannot be accessed. */ - public ObjectLoader open(final AnyObjectId objectId) + public ObjectLoader open(AnyObjectId objectId) throws IOException { return open(objectId, ObjectReader.OBJ_ANY); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java index 0e85545531..764f890158 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java @@ -86,7 +86,7 @@ public class ObjectId extends AnyObjectId implements Serializable { * the string to test. * @return true if the string can converted into an ObjectId. */ - public static final boolean isId(final String id) { + public static final boolean isId(String id) { if (id.length() != Constants.OBJECT_ID_STRING_LENGTH) return false; try { @@ -106,7 +106,7 @@ public class ObjectId extends AnyObjectId implements Serializable { * the id to convert. May be null. * @return the hex string conversion of this id's content. */ - public static final String toString(final ObjectId i) { + public static final String toString(ObjectId i) { return i != null ? i.name() : ZEROID_STR; } @@ -157,7 +157,7 @@ public class ObjectId extends AnyObjectId implements Serializable { * available within this byte array. * @return the converted object id. */ - public static final ObjectId fromRaw(final byte[] bs) { + public static final ObjectId fromRaw(byte[] bs) { return fromRaw(bs, 0); } @@ -171,7 +171,7 @@ public class ObjectId extends AnyObjectId implements Serializable { * position to read the first byte of data from. * @return the converted object id. */ - public static final ObjectId fromRaw(final byte[] bs, final int p) { + public static final ObjectId fromRaw(byte[] bs, int p) { final int a = NB.decodeInt32(bs, p); final int b = NB.decodeInt32(bs, p + 4); final int c = NB.decodeInt32(bs, p + 8); @@ -188,7 +188,7 @@ public class ObjectId extends AnyObjectId implements Serializable { * be available within this int array. * @return the converted object id. */ - public static final ObjectId fromRaw(final int[] is) { + public static final ObjectId fromRaw(int[] is) { return fromRaw(is, 0); } @@ -202,7 +202,7 @@ public class ObjectId extends AnyObjectId implements Serializable { * position to read the first integer of data from. * @return the converted object id. */ - public static final ObjectId fromRaw(final int[] is, final int p) { + public static final ObjectId fromRaw(int[] is, int p) { return new ObjectId(is[p], is[p + 1], is[p + 2], is[p + 3], is[p + 4]); } @@ -216,7 +216,7 @@ public class ObjectId extends AnyObjectId implements Serializable { * position to read the first character from. * @return the converted object id. */ - public static final ObjectId fromString(final byte[] buf, final int offset) { + public static final ObjectId fromString(byte[] buf, int offset) { return fromHexString(buf, offset); } @@ -227,14 +227,14 @@ public class ObjectId extends AnyObjectId implements Serializable { * the string to read from. Must be 40 characters long. * @return the converted object id. */ - public static ObjectId fromString(final String str) { + public static ObjectId fromString(String str) { if (str.length() != Constants.OBJECT_ID_STRING_LENGTH) { throw new InvalidObjectIdException(str); } return fromHexString(Constants.encodeASCII(str), 0); } - private static final ObjectId fromHexString(final byte[] bs, int p) { + private static final ObjectId fromHexString(byte[] bs, int p) { try { final int a = RawParseUtils.parseHexInt32(bs, p); final int b = RawParseUtils.parseHexInt32(bs, p + 8); @@ -281,7 +281,7 @@ public class ObjectId extends AnyObjectId implements Serializable { * @param src * another already parsed ObjectId to copy the value out of. */ - protected ObjectId(final AnyObjectId src) { + protected ObjectId(AnyObjectId src) { w1 = src.w1; w2 = src.w2; w3 = src.w3; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java index 03a430cab6..9df593375d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java @@ -134,7 +134,7 @@ public class ObjectIdOwnerMap * @return the instance mapped to toFind, or null if no mapping exists. */ @SuppressWarnings("unchecked") - public V get(final AnyObjectId toFind) { + public V get(AnyObjectId toFind) { int h = toFind.w1; V obj = directory[h & mask][h >>> SEGMENT_SHIFT]; for (; obj != null; obj = (V) obj.next) @@ -149,7 +149,7 @@ public class ObjectIdOwnerMap * Returns true if this map contains the specified object. */ @Override - public boolean contains(final AnyObjectId toFind) { + public boolean contains(AnyObjectId toFind) { return get(toFind) != null; } @@ -163,7 +163,7 @@ public class ObjectIdOwnerMap * @param newValue * the object to store. */ - public void add(final Q newValue) { + public void add(Q newValue) { if (++size == grow) grow(); @@ -194,7 +194,7 @@ public class ObjectIdOwnerMap * {@code get(newValue)} first. */ @SuppressWarnings("unchecked") - public V addIfAbsent(final Q newValue) { + public V addIfAbsent(Q newValue) { int h = newValue.w1; V[] table = directory[h & mask]; h >>>= SEGMENT_SHIFT; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java index 001aa9cdd6..cd57bda82e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java @@ -96,7 +96,7 @@ public class ObjectIdSubclassMap * the object identifier to find. * @return the instance mapped to toFind, or null if no mapping exists. */ - public V get(final AnyObjectId toFind) { + public V get(AnyObjectId toFind) { final int msk = mask; int i = toFind.w1 & msk; final V[] tbl = table; @@ -116,7 +116,7 @@ public class ObjectIdSubclassMap * Returns true if this map contains the specified object. */ @Override - public boolean contains(final AnyObjectId toFind) { + public boolean contains(AnyObjectId toFind) { return get(toFind) != null; } @@ -131,7 +131,7 @@ public class ObjectIdSubclassMap * @param newValue * the object to store. */ - public void add(final Q newValue) { + public void add(Q newValue) { if (++size == grow) grow(); insert(newValue); @@ -155,7 +155,7 @@ public class ObjectIdSubclassMap * that would have been returned had the caller used * {@code get(newValue)} first. */ - public V addIfAbsent(final Q newValue) { + public V addIfAbsent(Q newValue) { final int msk = mask; int i = newValue.w1 & msk; final V[] tbl = table; @@ -226,7 +226,7 @@ public class ObjectIdSubclassMap }; } - private void insert(final V newValue) { + private void insert(V newValue) { final int msk = mask; int j = newValue.w1 & msk; final V[] tbl = table; @@ -254,7 +254,7 @@ public class ObjectIdSubclassMap } @SuppressWarnings("unchecked") - private final V[] createArray(final int sz) { + private final V[] createArray(int sz) { return (V[]) new ObjectId[sz]; } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java index 40522ba244..77fa1b2346 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java @@ -361,7 +361,7 @@ public abstract class ObjectInserter implements AutoCloseable { * @throws java.io.IOException * the object could not be stored. */ - public ObjectId insert(final int type, final byte[] data) + public ObjectId insert(int type, byte[] data) throws IOException { return insert(type, data, 0, data.length); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java index 64f2a6fc6d..2e52f031cd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java @@ -271,7 +271,7 @@ public abstract class ObjectLoader { } } - private static byte[] cloneArray(final byte[] data) { + private static byte[] cloneArray(byte[] data) { final byte[] copy = new byte[data.length]; System.arraycopy(data, 0, copy, 0, data.length); return copy; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java index 18a11f0015..c16a2b6ab4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java @@ -167,7 +167,7 @@ public class PersonIdent implements Serializable { * * @param repo a {@link org.eclipse.jgit.lib.Repository} object. */ - public PersonIdent(final Repository repo) { + public PersonIdent(Repository repo) { this(repo.getConfig().get(UserConfig.KEY)); } @@ -177,7 +177,7 @@ public class PersonIdent implements Serializable { * @param pi * Original {@link org.eclipse.jgit.lib.PersonIdent} */ - public PersonIdent(final PersonIdent pi) { + public PersonIdent(PersonIdent pi) { this(pi.getName(), pi.getEmailAddress()); } @@ -190,7 +190,7 @@ public class PersonIdent implements Serializable { * @param aEmailAddress * a {@link java.lang.String} object. */ - public PersonIdent(final String aName, final String aEmailAddress) { + public PersonIdent(String aName, String aEmailAddress) { this(aName, aEmailAddress, SystemReader.getInstance().getCurrentTime()); } @@ -221,7 +221,7 @@ public class PersonIdent implements Serializable { * @param tz * time zone */ - public PersonIdent(final PersonIdent pi, final Date when, final TimeZone tz) { + public PersonIdent(PersonIdent pi, Date when, TimeZone tz) { this(pi.getName(), pi.getEmailAddress(), when, tz); } @@ -234,7 +234,7 @@ public class PersonIdent implements Serializable { * @param aWhen * local time */ - public PersonIdent(final PersonIdent pi, final Date aWhen) { + public PersonIdent(PersonIdent pi, Date aWhen) { this(pi.getName(), pi.getEmailAddress(), aWhen.getTime(), pi.tzOffset); } @@ -264,7 +264,7 @@ public class PersonIdent implements Serializable { * @param aTZ * time zone */ - public PersonIdent(final PersonIdent pi, final long aWhen, final int aTZ) { + public PersonIdent(PersonIdent pi, long aWhen, int aTZ) { this(pi.getName(), pi.getEmailAddress(), aWhen, aTZ); } @@ -274,7 +274,7 @@ public class PersonIdent implements Serializable { .getTimezone(when)); } - private PersonIdent(final UserConfig config) { + private PersonIdent(UserConfig config) { this(config.getCommitterName(), config.getCommitterEmail()); } @@ -370,7 +370,7 @@ public class PersonIdent implements Serializable { /** {@inheritDoc} */ @Override - public boolean equals(final Object o) { + public boolean equals(Object o) { if (o instanceof PersonIdent) { final PersonIdent p = (PersonIdent) o; return getName().equals(p.getName()) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Ref.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Ref.java index 395bb323de..b000558944 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Ref.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Ref.java @@ -105,7 +105,7 @@ public interface Ref { private final boolean packed; - private Storage(final boolean l, final boolean p) { + private Storage(boolean l, boolean p) { loose = l; packed = p; } 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 43d2f3766c..8bcac00876 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java @@ -62,7 +62,7 @@ public class RefComparator implements Comparator { /** {@inheritDoc} */ @Override - public int compare(final Ref o1, final Ref o2) { + public int compare(Ref o1, Ref o2) { return compareTo(o1, o2); } @@ -73,7 +73,7 @@ public class RefComparator implements Comparator { * collection to be sorted * @return sorted collection of refs */ - public static Collection sort(final Collection refs) { + public static Collection sort(Collection refs) { final List r = new ArrayList<>(refs); Collections.sort(r, INSTANCE); return r; @@ -101,7 +101,7 @@ public class RefComparator implements Comparator { * the other reference instance. * @return standard Comparator result of < 0, 0, > 0. */ - public static int compareTo(final Ref o1, final Ref o2) { + public static int compareTo(Ref o1, Ref o2) { return o1.getName().compareTo(o2.getName()); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java index 3d22bb0fc5..a05daa00ab 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java @@ -73,7 +73,7 @@ public abstract class RefRename { * @param dst * operation to create (or overwrite) the destination. */ - protected RefRename(final RefUpdate src, final RefUpdate dst) { + protected RefRename(RefUpdate src, RefUpdate dst) { source = src; destination = dst; @@ -107,7 +107,7 @@ public abstract class RefRename { * automatically determined based on the repository * configuration. */ - public void setRefLogIdent(final PersonIdent pi) { + public void setRefLogIdent(PersonIdent pi) { destination.setRefLogIdent(pi); } @@ -127,7 +127,7 @@ public abstract class RefRename { * @param msg * the message to describe this change. */ - public void setRefLogMessage(final String msg) { + public void setRefLogMessage(String msg) { if (msg == null) disableRefLog(); else diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java index 06a7576db1..5cd593ed5e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java @@ -227,7 +227,7 @@ public abstract class RefUpdate { * @param ref * the reference that will be updated by this operation. */ - protected RefUpdate(final Ref ref) { + protected RefUpdate(Ref ref) { this.ref = ref; oldValue = ref.getObjectId(); refLogMessage = ""; //$NON-NLS-1$ @@ -350,7 +350,7 @@ public abstract class RefUpdate { * @param id * the new value. */ - public void setNewObjectId(final AnyObjectId id) { + public void setNewObjectId(AnyObjectId id) { newValue = id.copy(); } @@ -377,7 +377,7 @@ public abstract class RefUpdate { * Use {@link org.eclipse.jgit.lib.ObjectId#zeroId()} to indicate * expectation of a non-existant ref. */ - public void setExpectedOldObjectId(final AnyObjectId id) { + public void setExpectedOldObjectId(AnyObjectId id) { expValue = id != null ? id.toObjectId() : null; } @@ -396,7 +396,7 @@ public abstract class RefUpdate { * @param b * true if this update should ignore merge tests. */ - public void setForceUpdate(final boolean b) { + public void setForceUpdate(boolean b) { force = b; } @@ -421,7 +421,7 @@ public abstract class RefUpdate { * automatically determined based on the repository * configuration. */ - public void setRefLogIdent(final PersonIdent pi) { + public void setRefLogIdent(PersonIdent pi) { refLogIdent = pi; } @@ -461,7 +461,7 @@ public abstract class RefUpdate { * forced-update) should be appended to the user supplied * message. */ - public void setRefLogMessage(final String msg, final boolean appendStatus) { + public void setRefLogMessage(String msg, boolean appendStatus) { if (msg == null && !appendStatus) disableRefLog(); else if (msg == null && appendStatus) { @@ -615,7 +615,7 @@ public abstract class RefUpdate { * @throws java.io.IOException * an unexpected IO error occurred while writing changes. */ - public Result update(final RevWalk walk) throws IOException { + public Result update(RevWalk walk) throws IOException { requireCanDoUpdate(); try { return result = updateImpl(walk, new Store() { @@ -659,7 +659,7 @@ public abstract class RefUpdate { * @return the result status of the delete. * @throws java.io.IOException */ - public Result delete(final RevWalk walk) throws IOException { + public Result delete(RevWalk walk) throws IOException { final String myName = detachingSymbolicRef ? getRef().getName() : getRef().getLeaf().getName(); @@ -731,7 +731,7 @@ public abstract class RefUpdate { } } - private Result updateImpl(final RevWalk walk, final Store store) + private Result updateImpl(RevWalk walk, Store store) throws IOException { RevObject newObj; RevObject oldObj; 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 9b50851893..e7e2b00349 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -162,7 +162,7 @@ public abstract class Repository implements AutoCloseable { * @param options * options to configure the repository. */ - protected Repository(final BaseRepositoryBuilder options) { + protected Repository(BaseRepositoryBuilder options) { gitDir = options.getGitDir(); fs = options.getFS(); workTree = options.getWorkTree(); @@ -342,7 +342,7 @@ public abstract class Repository implements AutoCloseable { * the object store cannot be accessed. */ @NonNull - public ObjectLoader open(final AnyObjectId objectId) + public ObjectLoader open(AnyObjectId objectId) throws MissingObjectException, IOException { return getObjectDatabase().open(objectId); } @@ -390,7 +390,7 @@ public abstract class Repository implements AutoCloseable { * to the base ref, as the symbolic ref could not be read. */ @NonNull - public RefUpdate updateRef(final String ref) throws IOException { + public RefUpdate updateRef(String ref) throws IOException { return updateRef(ref, false); } @@ -409,7 +409,7 @@ public abstract class Repository implements AutoCloseable { * to the base ref, as the symbolic ref could not be read. */ @NonNull - public RefUpdate updateRef(final String ref, final boolean detach) throws IOException { + public RefUpdate updateRef(String ref, boolean detach) throws IOException { return getRefDatabase().newUpdate(ref, detach); } @@ -425,7 +425,7 @@ public abstract class Repository implements AutoCloseable { * the rename could not be performed. */ @NonNull - public RefRename renameRef(final String fromRef, final String toRef) throws IOException { + public RefRename renameRef(String fromRef, String toRef) throws IOException { return getRefDatabase().newRename(fromRef, toRef); } @@ -480,7 +480,7 @@ public abstract class Repository implements AutoCloseable { * on serious errors */ @Nullable - public ObjectId resolve(final String revstr) + public ObjectId resolve(String revstr) throws AmbiguousObjectException, IncorrectObjectTypeException, RevisionSyntaxException, IOException { try (RevWalk rw = new RevWalk(this)) { @@ -507,7 +507,7 @@ public abstract class Repository implements AutoCloseable { * @throws java.io.IOException */ @Nullable - public String simplify(final String revstr) + public String simplify(String revstr) throws AmbiguousObjectException, IOException { try (RevWalk rw = new RevWalk(this)) { Object resolved = resolve(rw, revstr); @@ -521,7 +521,7 @@ public abstract class Repository implements AutoCloseable { } @Nullable - private Object resolve(final RevWalk rw, final String revstr) + private Object resolve(RevWalk rw, String revstr) throws IOException { char[] revChars = revstr.toCharArray(); RevObject rev = null; @@ -841,7 +841,7 @@ public abstract class Repository implements AutoCloseable { } @Nullable - private ObjectId resolveSimple(final String revstr) throws IOException { + private ObjectId resolveSimple(String revstr) throws IOException { if (ObjectId.isId(revstr)) return ObjectId.fromString(revstr); @@ -911,7 +911,7 @@ public abstract class Repository implements AutoCloseable { } @Nullable - private ObjectId resolveAbbreviation(final String revstr) throws IOException, + private ObjectId resolveAbbreviation(String revstr) throws IOException, AmbiguousObjectException { AbbreviatedObjectId id = AbbreviatedObjectId.fromString(revstr); try (ObjectReader reader = newObjectReader()) { @@ -1133,7 +1133,7 @@ public abstract class Repository implements AutoCloseable { * (or null). */ @NonNull - public Ref peel(final Ref ref) { + public Ref peel(Ref ref) { try { return getRefDatabase().peel(ref); } catch (IOException e) { @@ -1360,7 +1360,7 @@ public abstract class Repository implements AutoCloseable { * @param refName a {@link java.lang.String} object. * @return true if refName is a valid ref name */ - public static boolean isValidRefName(final String refName) { + public static boolean isValidRefName(String refName) { final int len = refName.length(); if (len == 0) return false; 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 5e902c9883..400342b1bd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java @@ -88,7 +88,7 @@ public class RepositoryCache { * @throws org.eclipse.jgit.errors.RepositoryNotFoundException * there is no repository at the given location. */ - public static Repository open(final Key location) throws IOException, + public static Repository open(Key location) throws IOException, RepositoryNotFoundException { return open(location, true); } @@ -115,7 +115,7 @@ public class RepositoryCache { * There is no repository at the given location, only thrown if * {@code mustExist} is true. */ - public static Repository open(final Key location, final boolean mustExist) + public static Repository open(Key location, boolean mustExist) throws IOException { return cache.openRepository(location, mustExist); } @@ -135,7 +135,7 @@ public class RepositoryCache { * @param db * repository to register. */ - public static void register(final Repository db) { + public static void register(Repository db) { if (db.getDirectory() != null) { FileKey key = FileKey.exact(db.getDirectory(), db.getFS()); cache.registerRepository(key, db); @@ -151,7 +151,7 @@ public class RepositoryCache { * @param db * repository to unregister. */ - public static void close(@NonNull final Repository db) { + public static void close(@NonNull Repository db) { if (db.getDirectory() != null) { FileKey key = FileKey.exact(db.getDirectory(), db.getFS()); cache.unregisterAndCloseRepository(key); @@ -170,7 +170,7 @@ public class RepositoryCache { * repository to unregister. * @since 4.3 */ - public static void unregister(final Repository db) { + public static void unregister(Repository db) { if (db.getDirectory() != null) { unregister(FileKey.exact(db.getDirectory(), db.getFS())); } @@ -287,13 +287,13 @@ public class RepositoryCache { return db; } - private void registerRepository(final Key location, final Repository db) { + private void registerRepository(Key location, Repository db) { try (Repository oldDb = cacheMap.put(location, db)) { // oldDb is auto-closed } } - private Repository unregisterRepository(final Key location) { + private Repository unregisterRepository(Key location) { return cacheMap.remove(location); } @@ -302,7 +302,7 @@ public class RepositoryCache { && (System.currentTimeMillis() - db.closedAt.get() > expireAfter); } - private void unregisterAndCloseRepository(final Key location) { + private void unregisterAndCloseRepository(Key location) { synchronized (lockFor(location)) { Repository oldDb = unregisterRepository(location); if (oldDb != null) { @@ -329,7 +329,7 @@ public class RepositoryCache { } } - private Lock lockFor(final Key location) { + private Lock lockFor(Key location) { return openLocks[(location.hashCode() >>> 1) % openLocks.length]; } @@ -383,7 +383,7 @@ public class RepositoryCache { * @return a key for the given directory. * @see #lenient(File, FS) */ - public static FileKey exact(final File directory, FS fs) { + public static FileKey exact(File directory, FS fs) { return new FileKey(directory, fs); } @@ -406,7 +406,7 @@ public class RepositoryCache { * @return a key for the given directory. * @see #exact(File, FS) */ - public static FileKey lenient(final File directory, FS fs) { + public static FileKey lenient(File directory, FS fs) { final File gitdir = resolve(directory, fs); return new FileKey(gitdir != null ? gitdir : directory, fs); } @@ -421,12 +421,12 @@ public class RepositoryCache { * the file system abstraction which will be necessary to * perform certain file system operations. */ - protected FileKey(final File directory, FS fs) { + protected FileKey(File directory, FS fs) { path = canonical(directory); this.fs = fs; } - private static File canonical(final File path) { + private static File canonical(File path) { try { return path.getCanonicalFile(); } catch (IOException e) { @@ -440,7 +440,7 @@ public class RepositoryCache { } @Override - public Repository open(final boolean mustExist) throws IOException { + public Repository open(boolean mustExist) throws IOException { if (mustExist && !isGitRepository(path, fs)) throw new RepositoryNotFoundException(path); return new FileRepository(path); @@ -452,7 +452,7 @@ public class RepositoryCache { } @Override - public boolean equals(final Object o) { + public boolean equals(Object o) { return o instanceof FileKey && path.equals(((FileKey) o).path); } @@ -476,19 +476,19 @@ public class RepositoryCache { * it doesn't look enough like a Git directory to really be a * Git directory. */ - public static boolean isGitRepository(final File dir, FS fs) { + public static boolean isGitRepository(File dir, FS fs) { return fs.resolve(dir, "objects").exists() //$NON-NLS-1$ && fs.resolve(dir, "refs").exists() //$NON-NLS-1$ && isValidHead(new File(dir, Constants.HEAD)); } - private static boolean isValidHead(final File head) { + private static boolean isValidHead(File head) { final String ref = readFirstLine(head); return ref != null && (ref.startsWith("ref: refs/") || ObjectId.isId(ref)); //$NON-NLS-1$ } - private static String readFirstLine(final File head) { + private static String readFirstLine(File head) { try { final byte[] buf = IO.readFully(head, 4096); int n = buf.length; @@ -521,7 +521,7 @@ public class RepositoryCache { * @return the actual directory location if a better match is found; * null if there is no suitable match. */ - public static File resolve(final File directory, FS fs) { + public static File resolve(File directory, FS fs) { if (isGitRepository(directory, fs)) return directory; if (isGitRepository(new File(directory, Constants.DOT_GIT), fs)) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java index 32ef504802..bd03165805 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java @@ -168,7 +168,7 @@ public class TagBuilder { * @param newMessage * the tag's message. */ - public void setMessage(final String newMessage) { + public void setMessage(String newMessage) { message = newMessage; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java index 1a3c6f6bd5..bfb5e2fc12 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java @@ -71,7 +71,7 @@ public class UserConfig { private boolean isCommitterEmailImplicit; - private UserConfig(final Config rc) { + private UserConfig(Config rc) { authorName = getNameInternal(rc, Constants.GIT_AUTHOR_NAME_KEY); if (authorName == null) { authorName = getDefaultUserName(); 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 520ea6e74a..98a706c6ad 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeStrategy.java @@ -100,7 +100,7 @@ public abstract class MergeStrategy { * @throws java.lang.IllegalArgumentException * a strategy by the same name has already been registered. */ - public static void register(final MergeStrategy imp) { + public static void register(MergeStrategy imp) { register(imp.getName(), imp); } @@ -129,7 +129,7 @@ public abstract class MergeStrategy { * name of the strategy to locate. * @return the strategy instance; null if no strategy matches the name. */ - public static synchronized MergeStrategy get(final String name) { + public static synchronized MergeStrategy get(String name) { return STRATEGIES.get(name); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/Merger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/Merger.java index cd19d696a8..25eb1af127 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/Merger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/Merger.java @@ -113,7 +113,7 @@ public abstract class Merger { * @param local * the repository this merger will read and write data on. */ - protected Merger(final Repository local) { + protected Merger(Repository local) { if (local == null) { throw new NullPointerException(JGitText.get().repositoryIsRequired); } @@ -215,7 +215,7 @@ public abstract class Merger { * one or more sources could not be read, or outputs could not * be written to the Repository. */ - public boolean merge(final AnyObjectId... tips) throws IOException { + public boolean merge(AnyObjectId... tips) throws IOException { return merge(true, tips); } @@ -243,7 +243,7 @@ public abstract class Merger { * one or more sources could not be read, or outputs could not * be written to the Repository. */ - public boolean merge(final boolean flush, final AnyObjectId... tips) + public boolean merge(boolean flush, AnyObjectId... tips) throws IOException { sourceObjects = new RevObject[tips.length]; for (int i = 0; i < tips.length; i++) @@ -328,7 +328,7 @@ public abstract class Merger { * @throws java.io.IOException * the tree object is not found or cannot be read. */ - protected AbstractTreeIterator openTree(final AnyObjectId treeId) + protected AbstractTreeIterator openTree(AnyObjectId treeId) throws IncorrectObjectTypeException, IOException { return new CanonicalTreeParser(null, reader, treeId); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java old mode 100755 new mode 100644 index 17a3d6194e..a908db7a13 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java @@ -995,11 +995,11 @@ public class ResolveMerger extends ThreeWayMerger { return RawText.load(loader, threshold); } - private static boolean nonTree(final int mode) { + private static boolean nonTree(int mode) { return mode != 0 && !FileMode.TREE.equals(mode); } - private static boolean isGitLink(final int mode) { + private static boolean isGitLink(int mode) { return FileMode.GITLINK.equals(mode); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategyOneSided.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategyOneSided.java index 979685c409..6e2e2aad0d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategyOneSided.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategyOneSided.java @@ -71,7 +71,7 @@ public class StrategyOneSided extends MergeStrategy { * @param index * the position of the input tree to accept as the result. */ - protected StrategyOneSided(final String name, final int index) { + protected StrategyOneSided(String name, int index) { strategyName = name; treeIndex = index; } @@ -84,31 +84,31 @@ public class StrategyOneSided extends MergeStrategy { /** {@inheritDoc} */ @Override - public Merger newMerger(final Repository db) { + public Merger newMerger(Repository db) { return new OneSide(db, treeIndex); } /** {@inheritDoc} */ @Override - public Merger newMerger(final Repository db, boolean inCore) { + public Merger newMerger(Repository db, boolean inCore) { return new OneSide(db, treeIndex); } /** {@inheritDoc} */ @Override - public Merger newMerger(final ObjectInserter inserter, final Config config) { + public Merger newMerger(ObjectInserter inserter, Config config) { return new OneSide(inserter, treeIndex); } static class OneSide extends Merger { private final int treeIndex; - protected OneSide(final Repository local, final int index) { + protected OneSide(Repository local, int index) { super(local); treeIndex = index; } - protected OneSide(final ObjectInserter inserter, final int index) { + protected OneSide(ObjectInserter inserter, int index) { super(inserter); treeIndex = index; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java index 5739d58b39..08f0a8a629 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java @@ -84,7 +84,7 @@ public class StrategySimpleTwoWayInCore extends ThreeWayMergeStrategy { /** {@inheritDoc} */ @Override - public ThreeWayMerger newMerger(final Repository db) { + public ThreeWayMerger newMerger(Repository db) { return new InCoreMerger(db); } @@ -182,11 +182,11 @@ public class StrategySimpleTwoWayInCore extends ThreeWayMergeStrategy { } } - private static boolean nonTree(final int mode) { + private static boolean nonTree(int mode) { return mode != 0 && !FileMode.TREE.equals(mode); } - private void add(final int tree, final int stage) throws IOException { + private void add(int tree, int stage) throws IOException { final AbstractTreeIterator i = getTree(tree); if (i != null) { if (FileMode.TREE.equals(tw.getRawMode(tree))) { @@ -203,7 +203,7 @@ public class StrategySimpleTwoWayInCore extends ThreeWayMergeStrategy { } } - private AbstractTreeIterator getTree(final int tree) { + private AbstractTreeIterator getTree(int tree) { return tw.getTree(tree, AbstractTreeIterator.class); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ThreeWayMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ThreeWayMerger.java index 3f28820092..2fc0f4f073 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ThreeWayMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ThreeWayMerger.java @@ -71,7 +71,7 @@ public abstract class ThreeWayMerger extends Merger { * @param local * the repository this merger will read and write data on. */ - protected ThreeWayMerger(final Repository local) { + protected ThreeWayMerger(Repository local) { super(local); } @@ -83,7 +83,7 @@ public abstract class ThreeWayMerger extends Merger { * @param inCore * perform the merge in core with no working folder involved */ - protected ThreeWayMerger(final Repository local, boolean inCore) { + protected ThreeWayMerger(Repository local, boolean inCore) { this(local); } @@ -112,7 +112,7 @@ public abstract class ThreeWayMerger extends Merger { * @throws java.io.IOException * the object could not be read. */ - public void setBase(final AnyObjectId id) throws MissingObjectException, + public void setBase(AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (id != null) { baseTree = walk.parseTree(id); @@ -123,7 +123,7 @@ public abstract class ThreeWayMerger extends Merger { /** {@inheritDoc} */ @Override - public boolean merge(final AnyObjectId... tips) throws IOException { + public boolean merge(AnyObjectId... tips) throws IOException { if (tips.length != 2) return false; return super.merge(tips); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java b/org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java index 1be5251622..6723b6309c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java @@ -218,7 +218,7 @@ class LeafBucket extends InMemoryNoteBucket { return fmt; } - private int treeSize(final int nameLen) { + private int treeSize(int nameLen) { int sz = cnt * TreeFormatter.entrySize(REGULAR_FILE, nameLen); for (NonNoteEntry e = nonNotes; e != null; e = e.next) sz += e.treeEntrySize(); 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 1afb53da8e..0f8f7aad02 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java @@ -108,7 +108,7 @@ public class CombinedFileHeader extends FileHeader { * the ancestor to get the mode of * @return the mode of the requested ancestor. */ - public FileMode getOldMode(final int nthParent) { + public FileMode getOldMode(int nthParent) { return oldModes[nthParent]; } @@ -130,13 +130,13 @@ public class CombinedFileHeader extends FileHeader { * the ancestor to get the object id of * @return the id of the requested ancestor. */ - public AbbreviatedObjectId getOldId(final int nthParent) { + public AbbreviatedObjectId getOldId(int nthParent) { return oldIds[nthParent]; } /** {@inheritDoc} */ @Override - public String getScriptText(final Charset ocs, final Charset ncs) { + public String getScriptText(Charset ocs, Charset ncs) { final Charset[] cs = new Charset[getParentCount() + 1]; Arrays.fill(cs, ocs); cs[getParentCount()] = ncs; @@ -149,7 +149,7 @@ public class CombinedFileHeader extends FileHeader { * Convert the patch script for this file into a string. */ @Override - public String getScriptText(final Charset[] charsetGuess) { + public String getScriptText(Charset[] charsetGuess) { return super.getScriptText(charsetGuess); } @@ -191,7 +191,7 @@ public class CombinedFileHeader extends FileHeader { /** {@inheritDoc} */ @Override - protected void parseIndexLine(int ptr, final int eol) { + protected void parseIndexLine(int ptr, int eol) { // "index $asha1,$bsha1..$csha1" // final List ids = new ArrayList<>(); @@ -213,7 +213,7 @@ public class CombinedFileHeader extends FileHeader { /** {@inheritDoc} */ @Override - protected void parseNewFileMode(final int ptr, final int eol) { + protected void parseNewFileMode(int ptr, int eol) { for (int i = 0; i < oldModes.length; i++) oldModes[i] = FileMode.MISSING; super.parseNewFileMode(ptr, eol); @@ -224,7 +224,7 @@ public class CombinedFileHeader extends FileHeader { return new CombinedHunkHeader(this, offset); } - private void parseModeLine(int ptr, final int eol) { + private void parseModeLine(int ptr, int eol) { // "mode $amode,$bmode..$cmode" // int n = 0; @@ -240,7 +240,7 @@ public class CombinedFileHeader extends FileHeader { newMode = parseFileMode(dot2 + 1, eol); } - private void parseDeletedFileMode(int ptr, final int eol) { + private void parseDeletedFileMode(int ptr, int eol) { // "deleted file mode $amode,$bmode" // changeType = ChangeType.DELETE; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java index bbf802317d..3f27bb3b2c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java @@ -97,7 +97,7 @@ public class CombinedHunkHeader extends HunkHeader { * the ancestor to get the old image data of * @return image data of the requested ancestor. */ - public OldImage getOldImage(final int nthParent) { + public OldImage getOldImage(int nthParent) { return old[nthParent]; } 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 5cfbbb2d88..32cf642305 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java @@ -146,7 +146,7 @@ public class FileHeader extends DiffEntry { * @param type * the type of patch used to modify this file */ - public FileHeader(final byte[] headerLines, EditList edits, PatchType type) { + public FileHeader(byte[] headerLines, EditList edits, PatchType type) { this(headerLines, 0); endOffset = headerLines.length; int ptr = parseGitFileName(Patch.DIFF_GIT.length, headerLines.length); @@ -269,7 +269,7 @@ public class FileHeader extends DiffEntry { return r.toString(); } - private static boolean trySimpleConversion(final Charset[] charsetGuess) { + private static boolean trySimpleConversion(Charset[] charsetGuess) { if (charsetGuess == null) return true; for (int i = 1; i < charsetGuess.length; i++) { @@ -279,7 +279,7 @@ public class FileHeader extends DiffEntry { return true; } - private String[] extractFileLines(final Charset[] csGuess) { + private String[] extractFileLines(Charset[] csGuess) { final TemporaryBuffer[] tmp = new TemporaryBuffer[getParentCount() + 1]; try { for (int i = 0; i < tmp.length; i++) @@ -555,7 +555,7 @@ public class FileHeader extends DiffEntry { return ptr; } - private String parseName(final String expect, int ptr, final int end) { + private String parseName(String expect, int ptr, int end) { if (ptr == end) return expect; 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 da123a7c2d..3a77387f23 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java @@ -101,7 +101,7 @@ public class Patch { * @param fh * the header of the file. */ - public void addFile(final FileHeader fh) { + public void addFile(FileHeader fh) { files.add(fh); } @@ -120,7 +120,7 @@ public class Patch { * @param err * the error description. */ - public void addError(final FormatError err) { + public void addError(FormatError err) { errors.add(err); } @@ -146,12 +146,12 @@ public class Patch { * @throws java.io.IOException * there was an error reading from the input stream. */ - public void parse(final InputStream is) throws IOException { + public void parse(InputStream is) throws IOException { final byte[] buf = readFully(is); parse(buf, 0, buf.length); } - private static byte[] readFully(final InputStream is) throws IOException { + private static byte[] readFully(InputStream is) throws IOException { try (TemporaryBuffer b = new TemporaryBuffer.Heap(Integer.MAX_VALUE)) { b.copy(is); return b.toByteArray(); @@ -173,12 +173,12 @@ public class Patch { * 1 past the last position to end parsing. The total length to * be parsed is end - ptr. */ - public void parse(final byte[] buf, int ptr, final int end) { + public void parse(byte[] buf, int ptr, int end) { while (ptr < end) ptr = parseFile(buf, ptr, end); } - private int parseFile(final byte[] buf, int c, final int end) { + private int parseFile(byte[] buf, int c, int end) { while (c < end) { if (isHunkHdr(buf, c, end) >= 1) { // If we find a disconnected hunk header we might @@ -234,7 +234,7 @@ public class Patch { return c; } - private int parseDiffGit(final byte[] buf, final int start, final int end) { + private int parseDiffGit(byte[] buf, int start, int end) { final FileHeader fh = new FileHeader(buf, start); int ptr = fh.parseGitFileName(start + DIFF_GIT.length, end); if (ptr < 0) @@ -271,14 +271,14 @@ public class Patch { return ptr; } - private static int skipFile(final byte[] buf, int ptr) { + private static int skipFile(byte[] buf, int ptr) { ptr = nextLF(buf, ptr); if (match(buf, ptr, OLD_NAME) >= 0) ptr = nextLF(buf, ptr); return ptr; } - private int parseHunks(final FileHeader fh, int c, final int end) { + private int parseHunks(FileHeader fh, int c, int end) { final byte[] buf = fh.buf; while (c < end) { // If we see a file header at this point, we have all of the @@ -349,7 +349,7 @@ public class Patch { return c; } - private int parseGitBinary(final FileHeader fh, int c, final int end) { + private int parseGitBinary(FileHeader fh, int c, int end) { final BinaryHunk postImage = new BinaryHunk(fh, c); final int nEnd = postImage.parseHunk(c, end); if (nEnd < 0) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java index f88b819d4d..c12acb40c2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java @@ -92,7 +92,7 @@ public abstract class AbstractPlotRenderer { * total height (in pixels) of this cell. */ @SuppressWarnings("unchecked") - protected void paintCommit(final PlotCommit commit, final int h) { + protected void paintCommit(PlotCommit commit, int h) { final int dotSize = computeDotSize(h); final TLane myLane = commit.getLane(); final int myLaneX = laneC(myLane); @@ -190,7 +190,7 @@ public abstract class AbstractPlotRenderer { */ protected abstract int drawLabel(int x, int y, Ref ref); - private static int computeDotSize(final int h) { + private static int computeDotSize(int h) { int d = (int) (Math.min(h, LANE_WIDTH) * 0.50f); d += (d & 1); return d; @@ -282,12 +282,12 @@ public abstract class AbstractPlotRenderer { */ protected abstract void drawText(String msg, int x, int y); - private static int laneX(final PlotLane myLane) { + private static int laneX(PlotLane myLane) { final int p = myLane != null ? myLane.getPosition() : 0; return LEFT_PAD + LANE_WIDTH * p; } - private static int laneC(final PlotLane myLane) { + private static int laneC(PlotLane myLane) { return laneX(myLane) + LANE_WIDTH / 2; } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java index 091bf683ac..fecc48d551 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java @@ -79,7 +79,7 @@ public class PlotCommit extends RevCommit { * @param id * the identity of this commit. */ - protected PlotCommit(final AnyObjectId id) { + protected PlotCommit(AnyObjectId id) { super(id); forkingOffLanes = NO_LANES; passingLanes = NO_LANES; @@ -100,7 +100,7 @@ public class PlotCommit extends RevCommit { mergingLanes = addLane(m, mergingLanes); } - private static PlotLane[] addLane(final PlotLane l, PlotLane[] lanes) { + private static PlotLane[] addLane(PlotLane l, PlotLane[] lanes) { final int cnt = lanes.length; if (cnt == 0) lanes = new PlotLane[] { l }; @@ -152,7 +152,7 @@ public class PlotCommit extends RevCommit { * @throws java.lang.ArrayIndexOutOfBoundsException * an invalid child index was specified. */ - public final PlotCommit getChild(final int nth) { + public final PlotCommit getChild(int nth) { return children[nth]; } @@ -163,7 +163,7 @@ public class PlotCommit extends RevCommit { * the commit to test. * @return true if the given commit built on top of this commit. */ - public final boolean isChild(final PlotCommit c) { + public final boolean isChild(PlotCommit c) { for (final PlotCommit a : children) if (a == c) return true; @@ -189,7 +189,7 @@ public class PlotCommit extends RevCommit { * @throws java.lang.ArrayIndexOutOfBoundsException * an invalid ref index was specified. */ - public final Ref getRef(final int nth) { + public final Ref getRef(int nth) { return refs[nth]; } 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 6a0ba66ba1..d952fa67ea 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java @@ -94,7 +94,7 @@ public class PlotCommitList extends /** {@inheritDoc} */ @Override - public void source(final RevWalk w) { + public void source(RevWalk w) { if (!(w instanceof PlotWalk)) throw new ClassCastException(MessageFormat.format(JGitText.get().classCastNotA, PlotWalk.class.getName())); super.source(w); @@ -126,7 +126,7 @@ public class PlotCommitList extends /** {@inheritDoc} */ @Override - protected void enter(final int index, final PlotCommit currCommit) { + protected void enter(int index, PlotCommit currCommit) { setupChildren(currCommit); final int nChildren = currCommit.getChildCount(); @@ -202,7 +202,7 @@ public class PlotCommitList extends closeLane(currCommit.lane); } - private void continueActiveLanes(final PlotCommit currCommit) { + private void continueActiveLanes(PlotCommit currCommit) { for (PlotLane lane : activeLanes) if (lane != currCommit.lane) currCommit.addPassingLane(lane); @@ -356,7 +356,7 @@ public class PlotCommitList extends } } - private void setupChildren(final PlotCommit currCommit) { + private void setupChildren(PlotCommit currCommit) { final int nParents = currCommit.getParentCount(); for (int i = 0; i < nParents; i++) ((PlotCommit) currCommit.getParent(i)).addChild(currCommit); @@ -416,7 +416,7 @@ public class PlotCommitList extends * @param lane * a lane */ - protected void recycleLane(final L lane) { + protected void recycleLane(L lane) { // Nothing. } } 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 8ba8d6e4ca..f27f356c6b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java @@ -90,7 +90,7 @@ public class PlotWalk extends RevWalk { * @param repo * the repository the walker will obtain data from. */ - public PlotWalk(final Repository repo) { + public PlotWalk(Repository repo) { super(repo); super.sort(RevSort.TOPO, true); reverseRefMap = repo.getAllRefsByPeeledObjectId(); @@ -118,7 +118,7 @@ public class PlotWalk extends RevWalk { /** {@inheritDoc} */ @Override - public void sort(final RevSort s, final boolean use) { + public void sort(RevSort s, boolean use) { if (s == RevSort.TOPO && !use) throw new IllegalArgumentException(JGitText.get().topologicalSortRequired); super.sort(s, use); @@ -126,7 +126,7 @@ public class PlotWalk extends RevWalk { /** {@inheritDoc} */ @Override - protected RevCommit createCommit(final AnyObjectId id) { + protected RevCommit createCommit(AnyObjectId id) { return new PlotCommit(id); } @@ -140,7 +140,7 @@ public class PlotWalk extends RevWalk { return pc; } - private Ref[] getRefs(final AnyObjectId commitId) { + private Ref[] getRefs(AnyObjectId commitId) { Collection list = reverseRefMap.get(commitId); if (list == null) return PlotCommit.NO_REFS; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AbstractRevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AbstractRevQueue.java index b948adb42e..247a3bdb28 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AbstractRevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AbstractRevQueue.java @@ -74,7 +74,7 @@ abstract class AbstractRevQueue extends Generator { * @param queueControl * flag that controls admission to the queue. */ - public final void add(final RevCommit c, final RevFlag queueControl) { + public final void add(RevCommit c, RevFlag queueControl) { if (!c.has(queueControl)) { c.add(queueControl); add(c); @@ -94,7 +94,7 @@ abstract class AbstractRevQueue extends Generator { * @param queueControl * flag that controls admission to the queue. */ - public final void addParents(final RevCommit c, final RevFlag queueControl) { + public final void addParents(RevCommit c, RevFlag queueControl) { final RevCommit[] pList = c.parents; if (pList == null) return; @@ -132,7 +132,7 @@ abstract class AbstractRevQueue extends Generator { * @param c * a {@link org.eclipse.jgit.revwalk.RevCommit} */ - protected static void describe(final StringBuilder s, final RevCommit c) { + protected static void describe(StringBuilder s, RevCommit c) { s.append(c.toString()); s.append('\n'); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java index 74a3511088..31612ff66a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java @@ -85,7 +85,7 @@ abstract class BlockRevQueue extends AbstractRevQueue { * sharing the same free list are doing so from only a single thread. */ @Override - public void shareFreeList(final BlockRevQueue q) { + public void shareFreeList(BlockRevQueue q) { free = q.free; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java index c993fe50a9..795bdf1951 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java @@ -88,7 +88,7 @@ public class DateRevQueue extends AbstractRevQueue { /** {@inheritDoc} */ @Override - public void add(final RevCommit c) { + public void add(RevCommit c) { sinceLastIndex++; if (++inQueue > REBUILD_INDEX_COUNT && sinceLastIndex > REBUILD_INDEX_COUNT) @@ -212,7 +212,7 @@ public class DateRevQueue extends AbstractRevQueue { return s.toString(); } - private Entry newEntry(final RevCommit c) { + private Entry newEntry(RevCommit c) { Entry r = free; if (r == null) r = new Entry(); @@ -222,7 +222,7 @@ public class DateRevQueue extends AbstractRevQueue { return r; } - private void freeEntry(final Entry e) { + private void freeEntry(Entry e) { e.next = free; free = e; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java index 63b7990600..1bb8715a33 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java @@ -70,7 +70,7 @@ public class FIFORevQueue extends BlockRevQueue { /** {@inheritDoc} */ @Override - public void add(final RevCommit c) { + public void add(RevCommit c) { Block b = tail; if (b == null) { b = free.newBlock(); @@ -92,7 +92,7 @@ public class FIFORevQueue extends BlockRevQueue { * @param c * the commit to insert into the queue. */ - public void unpop(final RevCommit c) { + public void unpop(RevCommit c) { Block b = head; if (b == null) { b = free.newBlock(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java index 2da97c891b..567c8465c6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java @@ -112,7 +112,7 @@ public class FollowFilter extends TreeFilter { /** {@inheritDoc} */ @Override - public boolean include(final TreeWalk walker) + public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { return path.include(walker) && ANY_DIFF.include(walker); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterKey.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterKey.java index 360be298e3..45d5f809bb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterKey.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterKey.java @@ -70,7 +70,7 @@ public final class FooterKey { * @param keyName * name of the footer line. */ - public FooterKey(final String keyName) { + public FooterKey(String keyName) { name = keyName; raw = Constants.encode(keyName.toLowerCase(Locale.ROOT)); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java index 074ce8275c..d6fed66702 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java @@ -86,7 +86,7 @@ public final class FooterLine { * key to test this line's key name against. * @return true if {@code key.getName().equalsIgnorecase(getKey())}. */ - public boolean matches(final FooterKey key) { + public boolean matches(FooterKey key) { final byte[] kRaw = key.raw; final int len = kRaw.length; int bPtr = keyStart; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java index f734b693ef..cbffd91d70 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java @@ -69,7 +69,7 @@ public class LIFORevQueue extends BlockRevQueue { /** {@inheritDoc} */ @Override - public void add(final RevCommit c) { + public void add(RevCommit c) { Block b = head; if (b == null || !b.canUnpop()) { b = free.newBlock(); 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 73ce9854e0..755df58cf8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java @@ -119,7 +119,7 @@ class MergeBaseGenerator extends Generator { } } - private void add(final RevCommit c) { + private void add(RevCommit c) { final int flag = walker.allocFlag(); branchMask |= flag; if ((c.flags & branchMask) != 0) { 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 25c3e1224e..e5903c9117 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java @@ -119,7 +119,7 @@ public class ObjectWalk extends RevWalk { * @param repo * the repository the walker will obtain data from. */ - public ObjectWalk(final Repository repo) { + public ObjectWalk(Repository repo) { this(repo.newObjectReader()); } @@ -699,7 +699,7 @@ public class ObjectWalk extends RevWalk { /** {@inheritDoc} */ @Override - protected void reset(final int retainFlags) { + protected void reset(int retainFlags) { super.reset(retainFlags); for (RevObject obj : rootObjects) @@ -711,7 +711,7 @@ public class ObjectWalk extends RevWalk { freeVisit = null; } - private void addObject(final RevObject o) { + private void addObject(RevObject o) { if ((o.flags & IN_PENDING) == 0) { o.flags |= IN_PENDING; rootObjects.add(o); @@ -719,7 +719,7 @@ public class ObjectWalk extends RevWalk { } } - private void markTreeUninteresting(final RevTree tree) + private void markTreeUninteresting(RevTree tree) throws MissingObjectException, IncorrectObjectTypeException, IOException { if ((tree.flags & UNINTERESTING) != 0) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevBlob.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevBlob.java index d3529292e6..cc5e3e40db 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevBlob.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevBlob.java @@ -62,7 +62,7 @@ public class RevBlob extends RevObject { * @param id * object name for the blob. */ - protected RevBlob(final AnyObjectId id) { + protected RevBlob(AnyObjectId id) { super(id); } 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 5c8371f918..14222e9d50 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java @@ -148,7 +148,7 @@ public class RevCommit extends RevObject { * @param id * object name for the commit. */ - protected RevCommit(final AnyObjectId id) { + protected RevCommit(AnyObjectId id) { super(id); } @@ -310,7 +310,7 @@ public class RevCommit extends RevObject { * @param flag * the single flag value to carry back onto parents. */ - public void carry(final RevFlag flag) { + public void carry(RevFlag flag) { final int carry = flags & flag.mask; if (carry != 0) carryFlags(this, carry); @@ -353,7 +353,7 @@ public class RevCommit extends RevObject { * @throws java.lang.ArrayIndexOutOfBoundsException * an invalid parent index was specified. */ - public final RevCommit getParent(final int nth) { + public final RevCommit getParent(int nth) { return parents[nth]; } @@ -615,7 +615,7 @@ public class RevCommit extends RevObject { * with the specified key, or there are no footers at all. * @see #getFooterLines() */ - public final List getFooterLines(final String keyName) { + public final List getFooterLines(String keyName) { return getFooterLines(new FooterKey(keyName)); } @@ -630,7 +630,7 @@ public class RevCommit extends RevObject { * with the specified key, or there are no footers at all. * @see #getFooterLines() */ - public final List getFooterLines(final FooterKey keyName) { + public final List getFooterLines(FooterKey keyName) { final List src = getFooterLines(); if (src.isEmpty()) return Collections.emptyList(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java index 38cf3f510a..d2fda2f91e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java @@ -91,7 +91,7 @@ public class RevCommitList extends RevObjectList { * object that should be present was not found. Repository * corruption may have occurred. */ - public void applyFlag(final RevFilter matching, final RevFlag flag) + public void applyFlag(RevFilter matching, RevFlag flag) throws MissingObjectException, IncorrectObjectTypeException, IOException { applyFlag(matching, flag, 0, size()); @@ -165,7 +165,7 @@ public class RevCommitList extends RevObjectList { * the flag to remove. Applications are responsible for * allocating this flag from the source RevWalk. */ - public void clearFlag(final RevFlag flag) { + public void clearFlag(RevFlag flag) { clearFlag(flag, 0, size()); } @@ -207,7 +207,7 @@ public class RevCommitList extends RevObjectList { * @return index of the first commit at or after index begin * that has the specified flag set on it; -1 if no match is found. */ - public int indexOf(final RevFlag flag, int begin) { + public int indexOf(RevFlag flag, int begin) { while (begin < size()) { int index = begin; Block s = contents; @@ -238,7 +238,7 @@ public class RevCommitList extends RevObjectList { * @return index of the first commit at or before index begin * that has the specified flag set on it; -1 if no match is found. */ - public int lastIndexOf(final RevFlag flag, int begin) { + public int lastIndexOf(RevFlag flag, int begin) { begin = Math.min(begin, size() - 1); while (begin >= 0) { int index = begin; @@ -265,7 +265,7 @@ public class RevCommitList extends RevObjectList { * the walker to populate from. * @see #fillTo(int) */ - public void source(final RevWalk w) { + public void source(RevWalk w) { walker = w; } @@ -299,7 +299,7 @@ public class RevCommitList extends RevObjectList { * see {@link org.eclipse.jgit.revwalk.RevWalk#next()} */ @SuppressWarnings("unchecked") - public void fillTo(final int highMark) throws MissingObjectException, + public void fillTo(int highMark) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (walker == null || size > highMark) return; @@ -364,7 +364,7 @@ public class RevCommitList extends RevObjectList { * see {@link org.eclipse.jgit.revwalk.RevWalk#next()} */ @SuppressWarnings("unchecked") - public void fillTo(final RevCommit commitToLoad, int highMark) + public void fillTo(RevCommit commitToLoad, int highMark) throws MissingObjectException, IncorrectObjectTypeException, IOException { if (walker == null || commitToLoad == null @@ -419,7 +419,7 @@ public class RevCommitList extends RevObjectList { * @param e * the object being added (or set) into the list. */ - protected void enter(final int index, final E e) { + protected void enter(int index, E e) { // Do nothing by default. } } 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 9740d1417d..45a730cfd2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java @@ -73,7 +73,7 @@ public class RevFlagSet extends AbstractSet { * @param s * the set to copy flags from. */ - public RevFlagSet(final RevFlagSet s) { + public RevFlagSet(RevFlagSet s) { mask = s.mask; active = new ArrayList<>(s.active); } @@ -84,14 +84,14 @@ public class RevFlagSet extends AbstractSet { * @param s * the collection to copy flags from. */ - public RevFlagSet(final Collection s) { + public RevFlagSet(Collection s) { this(); addAll(s); } /** {@inheritDoc} */ @Override - public boolean contains(final Object o) { + public boolean contains(Object o) { if (o instanceof RevFlag) return (mask & ((RevFlag) o).mask) != 0; return false; @@ -99,7 +99,7 @@ public class RevFlagSet extends AbstractSet { /** {@inheritDoc} */ @Override - public boolean containsAll(final Collection c) { + public boolean containsAll(Collection c) { if (c instanceof RevFlagSet) { final int cMask = ((RevFlagSet) c).mask; return (mask & cMask) == cMask; @@ -109,7 +109,7 @@ public class RevFlagSet extends AbstractSet { /** {@inheritDoc} */ @Override - public boolean add(final RevFlag flag) { + public boolean add(RevFlag flag) { if ((mask & flag.mask) != 0) return false; mask |= flag.mask; @@ -122,7 +122,7 @@ public class RevFlagSet extends AbstractSet { /** {@inheritDoc} */ @Override - public boolean remove(final Object o) { + public boolean remove(Object o) { final RevFlag flag = (RevFlag) o; if ((mask & flag.mask) == 0) return false; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java index 4a88105d10..1c76fe9c17 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java @@ -93,7 +93,7 @@ public abstract class RevObject extends ObjectIdOwnerMap.Entry { * the flag to test. * @return true if the flag has been added to this object; false if not. */ - public final boolean has(final RevFlag flag) { + public final boolean has(RevFlag flag) { return (flags & flag.mask) != 0; } @@ -105,7 +105,7 @@ public abstract class RevObject extends ObjectIdOwnerMap.Entry { * @return true if any flag in the set has been added to this object; false * if not. */ - public final boolean hasAny(final RevFlagSet set) { + public final boolean hasAny(RevFlagSet set) { return (flags & set.mask) != 0; } @@ -117,7 +117,7 @@ public abstract class RevObject extends ObjectIdOwnerMap.Entry { * @return true if all flags of the set have been added to this object; * false if some or none have been added. */ - public final boolean hasAll(final RevFlagSet set) { + public final boolean hasAll(RevFlagSet set) { return (flags & set.mask) == set.mask; } @@ -129,7 +129,7 @@ public abstract class RevObject extends ObjectIdOwnerMap.Entry { * @param flag * the flag to mark on this object, for later testing. */ - public final void add(final RevFlag flag) { + public final void add(RevFlag flag) { flags |= flag.mask; } @@ -139,7 +139,7 @@ public abstract class RevObject extends ObjectIdOwnerMap.Entry { * @param set * the set of flags to mark on this object, for later testing. */ - public final void add(final RevFlagSet set) { + public final void add(RevFlagSet set) { flags |= set.mask; } @@ -151,7 +151,7 @@ public abstract class RevObject extends ObjectIdOwnerMap.Entry { * @param flag * the flag to remove from this object. */ - public final void remove(final RevFlag flag) { + public final void remove(RevFlag flag) { flags &= ~flag.mask; } @@ -161,7 +161,7 @@ public abstract class RevObject extends ObjectIdOwnerMap.Entry { * @param set * the flag to remove from this object. */ - public final void remove(final RevFlagSet set) { + public final void remove(RevFlagSet set) { flags &= ~set.mask; } @@ -183,7 +183,7 @@ public abstract class RevObject extends ObjectIdOwnerMap.Entry { * @param s * buffer to append a debug description of core RevFlags onto. */ - protected void appendCoreFlags(final StringBuilder s) { + protected void appendCoreFlags(StringBuilder s) { s.append((flags & RevWalk.TOPO_DELAY) != 0 ? 'o' : '-'); s.append((flags & RevWalk.TEMP_MARK) != 0 ? 't' : '-'); s.append((flags & RevWalk.REWRITE) != 0 ? 'r' : '-'); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java index 2bb4427181..42f26d267a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java @@ -82,7 +82,7 @@ public class RevObjectList extends AbstractList { /** {@inheritDoc} */ @Override - public void add(final int index, final E element) { + public void add(int index, E element) { if (index != size) throw new UnsupportedOperationException(MessageFormat.format( JGitText.get().unsupportedOperationNotAddAtEnd, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java index cbeda71a87..e7fe0f73bc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java @@ -137,7 +137,7 @@ public class RevTag extends RevObject { * @param id * object name for the tag. */ - protected RevTag(final AnyObjectId id) { + protected RevTag(AnyObjectId id) { super(id); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTree.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTree.java index 92b81a17d6..e7de270f65 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTree.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTree.java @@ -62,7 +62,7 @@ public class RevTree extends RevObject { * @param id * object name for the tree. */ - protected RevTree(final AnyObjectId id) { + protected RevTree(AnyObjectId id) { super(id); } 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 91c15a1e70..cf278bbbe7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java @@ -209,7 +209,7 @@ public class RevWalk implements Iterable, AutoCloseable { * ObjectReader will be created by the walker, and will be closed * when the walker is closed. */ - public RevWalk(final Repository repo) { + public RevWalk(Repository repo) { this(repo.newObjectReader(), true); } @@ -294,7 +294,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ - public void markStart(final RevCommit c) throws MissingObjectException, + public void markStart(RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { if ((c.flags & SEEN) != 0) return; @@ -324,7 +324,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ - public void markStart(final Collection list) + public void markStart(Collection list) throws MissingObjectException, IncorrectObjectTypeException, IOException { for (final RevCommit c : list) @@ -364,7 +364,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ - public void markUninteresting(final RevCommit c) + public void markUninteresting(RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { c.flags |= UNINTERESTING; @@ -402,7 +402,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ - public boolean isMergedInto(final RevCommit base, final RevCommit tip) + public boolean isMergedInto(RevCommit base, RevCommit tip) throws MissingObjectException, IncorrectObjectTypeException, IOException { final RevFilter oldRF = filter; @@ -475,7 +475,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @param s * a sorting strategy to enable. */ - public void sort(final RevSort s) { + public void sort(RevSort s) { assertNotStarted(); sorting.clear(); sorting.add(s); @@ -496,7 +496,7 @@ public class RevWalk implements Iterable, AutoCloseable { * true if this strategy should be used, false if it should be * removed. */ - public void sort(final RevSort s, final boolean use) { + public void sort(RevSort s, boolean use) { assertNotStarted(); if (use) sorting.add(s); @@ -541,7 +541,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @see org.eclipse.jgit.revwalk.filter.AndRevFilter * @see org.eclipse.jgit.revwalk.filter.OrRevFilter */ - public void setRevFilter(final RevFilter newFilter) { + public void setRevFilter(RevFilter newFilter) { assertNotStarted(); filter = newFilter != null ? newFilter : RevFilter.ALL; } @@ -582,7 +582,7 @@ public class RevWalk implements Iterable, AutoCloseable { * will be used instead, as it matches everything. * @see org.eclipse.jgit.treewalk.filter.PathFilter */ - public void setTreeFilter(final TreeFilter newFilter) { + public void setTreeFilter(TreeFilter newFilter) { assertNotStarted(); treeFilter = newFilter != null ? newFilter : TreeFilter.ALL; } @@ -638,7 +638,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @param retain * true to retain bodies; false to discard them early. */ - public void setRetainBody(final boolean retain) { + public void setRetainBody(boolean retain) { retainBody = retain; } @@ -653,7 +653,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @return reference to the blob object. Never null. */ @NonNull - public RevBlob lookupBlob(final AnyObjectId id) { + public RevBlob lookupBlob(AnyObjectId id) { RevBlob c = (RevBlob) objects.get(id); if (c == null) { c = new RevBlob(id); @@ -673,7 +673,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @return reference to the tree object. Never null. */ @NonNull - public RevTree lookupTree(final AnyObjectId id) { + public RevTree lookupTree(AnyObjectId id) { RevTree c = (RevTree) objects.get(id); if (c == null) { c = new RevTree(id); @@ -696,7 +696,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @return reference to the commit object. Never null. */ @NonNull - public RevCommit lookupCommit(final AnyObjectId id) { + public RevCommit lookupCommit(AnyObjectId id) { RevCommit c = (RevCommit) objects.get(id); if (c == null) { c = createCommit(id); @@ -716,7 +716,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @return reference to the tag object. Never null. */ @NonNull - public RevTag lookupTag(final AnyObjectId id) { + public RevTag lookupTag(AnyObjectId id) { RevTag c = (RevTag) objects.get(id); if (c == null) { c = new RevTag(id); @@ -738,7 +738,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @return reference to the object. Never null. */ @NonNull - public RevObject lookupAny(final AnyObjectId id, final int type) { + public RevObject lookupAny(AnyObjectId id, int type) { RevObject r = objects.get(id); if (r == null) { switch (type) { @@ -793,7 +793,7 @@ public class RevWalk implements Iterable, AutoCloseable { * a pack file or loose object could not be read. */ @NonNull - public RevCommit parseCommit(final AnyObjectId id) + public RevCommit parseCommit(AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { RevObject c = peel(parseAny(id)); @@ -821,7 +821,7 @@ public class RevWalk implements Iterable, AutoCloseable { * a pack file or loose object could not be read. */ @NonNull - public RevTree parseTree(final AnyObjectId id) + public RevTree parseTree(AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { RevObject c = peel(parseAny(id)); @@ -856,7 +856,7 @@ public class RevWalk implements Iterable, AutoCloseable { * a pack file or loose object could not be read. */ @NonNull - public RevTag parseTag(final AnyObjectId id) throws MissingObjectException, + public RevTag parseTag(AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { RevObject c = parseAny(id); if (!(c instanceof RevTag)) @@ -882,7 +882,7 @@ public class RevWalk implements Iterable, AutoCloseable { * a pack file or loose object could not be read. */ @NonNull - public RevObject parseAny(final AnyObjectId id) + public RevObject parseAny(AnyObjectId id) throws MissingObjectException, IOException { RevObject r = objects.get(id); if (r == null) @@ -1040,7 +1040,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ - public void parseHeaders(final RevObject obj) + public void parseHeaders(RevObject obj) throws MissingObjectException, IOException { if ((obj.flags & PARSED) == 0) obj.parseHeaders(this); @@ -1059,7 +1059,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.io.IOException * a pack file or loose object could not be read. */ - public void parseBody(final RevObject obj) + public void parseBody(RevObject obj) throws MissingObjectException, IOException { obj.parseBody(this); } @@ -1100,7 +1100,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @throws java.lang.IllegalArgumentException * too many flags have been reserved on this revision walker. */ - public RevFlag newFlag(final String name) { + public RevFlag newFlag(String name) { final int m = allocFlag(); return new RevFlag(this, name, m); } @@ -1124,7 +1124,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @param flag * the flag to carry onto parents, if set on a descendant. */ - public void carry(final RevFlag flag) { + public void carry(RevFlag flag) { if ((freeFlags & flag.mask) != 0) throw new IllegalArgumentException(MessageFormat.format(JGitText.get().flagIsDisposed, flag.name)); if (flag.walker != this) @@ -1141,7 +1141,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @param set * the flags to carry onto parents, if set on a descendant. */ - public void carry(final Collection set) { + public void carry(Collection set) { for (final RevFlag flag : set) carry(flag); } @@ -1200,7 +1200,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @param flag * the to recycle. */ - public void disposeFlag(final RevFlag flag) { + public void disposeFlag(RevFlag flag) { freeFlag(flag.mask); } @@ -1244,7 +1244,7 @@ public class RevWalk implements Iterable, AutoCloseable { * application flags that should not be cleared from * existing commit objects. */ - public final void resetRetain(final RevFlagSet retainFlags) { + public final void resetRetain(RevFlagSet retainFlags) { reset(retainFlags.mask); } @@ -1262,7 +1262,7 @@ public class RevWalk implements Iterable, AutoCloseable { * application flags that should not be cleared from * existing commit objects. */ - public final void resetRetain(final RevFlag... retainFlags) { + public final void resetRetain(RevFlag... retainFlags) { int mask = 0; for (final RevFlag flag : retainFlags) mask |= flag.mask; @@ -1435,7 +1435,7 @@ public class RevWalk implements Iterable, AutoCloseable { * the object this walker requires a commit reference for. * @return a new unparsed reference for the object. */ - protected RevCommit createCommit(final AnyObjectId id) { + protected RevCommit createCommit(AnyObjectId id) { return new RevCommit(id); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java index f82301a82d..bb0955ccfd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java @@ -148,7 +148,7 @@ class RewriteGenerator extends Generator { } } - private RevCommit[] cleanup(final RevCommit[] oldList) { + private RevCommit[] cleanup(RevCommit[] oldList) { // Remove any duplicate parents caused due to rewrites (e.g. a merge // with two sides that both simplified back into the merge base). // We also may have deleted a parent by marking it null. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java index 99c5d59a11..11301538e6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java @@ -89,7 +89,7 @@ public class TreeRevFilter extends RevFilter { * replaced with a new filter following new paths after a rename. * @since 3.5 */ - public TreeRevFilter(final RevWalk walker, final TreeFilter t) { + public TreeRevFilter(RevWalk walker, TreeFilter t) { this(walker, t, 0); } @@ -132,7 +132,7 @@ public class TreeRevFilter extends RevFilter { /** {@inheritDoc} */ @Override - public boolean include(final RevWalk walker, final RevCommit c) + public boolean include(RevWalk walker, RevCommit c) throws StopWalkException, MissingObjectException, IncorrectObjectTypeException, IOException { // Reset the tree filter to scan this commit and parents. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java index 0019e0c283..4215f21212 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java @@ -72,7 +72,7 @@ public abstract class AndRevFilter extends RevFilter { * second filter to test. * @return a filter that must match both input filters. */ - public static RevFilter create(final RevFilter a, final RevFilter b) { + public static RevFilter create(RevFilter a, RevFilter b) { if (a == ALL) return b; if (b == ALL) @@ -88,7 +88,7 @@ public abstract class AndRevFilter extends RevFilter { * filters. * @return a filter that must match all input filters. */ - public static RevFilter create(final RevFilter[] list) { + public static RevFilter create(RevFilter[] list) { if (list.length == 2) return create(list[0], list[1]); if (list.length < 2) @@ -106,7 +106,7 @@ public abstract class AndRevFilter extends RevFilter { * filters. * @return a filter that must match all input filters. */ - public static RevFilter create(final Collection list) { + public static RevFilter create(Collection list) { if (list.size() < 2) throw new IllegalArgumentException(JGitText.get().atLeastTwoFiltersNeeded); final RevFilter[] subfilters = new RevFilter[list.size()]; @@ -131,7 +131,7 @@ public abstract class AndRevFilter extends RevFilter { } @Override - public boolean include(final RevWalk walker, final RevCommit c) + public boolean include(RevWalk walker, RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { return a.include(walker, c) && b.include(walker, c); @@ -169,7 +169,7 @@ public abstract class AndRevFilter extends RevFilter { } @Override - public boolean include(final RevWalk walker, final RevCommit c) + public boolean include(RevWalk walker, RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { for (final RevFilter f : subfilters) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AuthorRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AuthorRevFilter.java index e00feaf9a0..8474e6c43f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AuthorRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AuthorRevFilter.java @@ -96,7 +96,7 @@ public class AuthorRevFilter { } @Override - protected CharSequence text(final RevCommit cmit) { + protected CharSequence text(RevCommit cmit) { return textFor(cmit); } @@ -112,7 +112,7 @@ public class AuthorRevFilter { } @Override - protected RawCharSequence text(final RevCommit cmit) { + protected RawCharSequence text(RevCommit cmit) { return textFor(cmit); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java index 9f4f10f3ae..002985b118 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java @@ -64,7 +64,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { * the point in time to cut on. * @return a new filter to select commits on or before ts. */ - public static final RevFilter before(final Date ts) { + public static final RevFilter before(Date ts) { return before(ts.getTime()); } @@ -75,7 +75,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { * the point in time to cut on, in milliseconds * @return a new filter to select commits on or before ts. */ - public static final RevFilter before(final long ts) { + public static final RevFilter before(long ts) { return new Before(ts); } @@ -86,7 +86,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { * the point in time to cut on. * @return a new filter to select commits on or after ts. */ - public static final RevFilter after(final Date ts) { + public static final RevFilter after(Date ts) { return after(ts.getTime()); } @@ -97,7 +97,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { * the point in time to cut on, in milliseconds. * @return a new filter to select commits on or after ts. */ - public static final RevFilter after(final long ts) { + public static final RevFilter after(long ts) { return new After(ts); } @@ -109,7 +109,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { * @param until the point in time to cut off. * @return a new filter to select commits between the given date/times. */ - public static final RevFilter between(final Date since, final Date until) { + public static final RevFilter between(Date since, Date until) { return between(since.getTime(), until.getTime()); } @@ -121,7 +121,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { * @param until the point in time to cut off, in millisconds. * @return a new filter to select commits between the given date/times. */ - public static final RevFilter between(final long since, final long until) { + public static final RevFilter between(long since, long until) { return new Between(since, until); } @@ -149,7 +149,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { } @Override - public boolean include(final RevWalk walker, final RevCommit cmit) + public boolean include(RevWalk walker, RevCommit cmit) throws StopWalkException, MissingObjectException, IncorrectObjectTypeException, IOException { return cmit.getCommitTime() <= when; @@ -168,7 +168,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { } @Override - public boolean include(final RevWalk walker, final RevCommit cmit) + public boolean include(RevWalk walker, RevCommit cmit) throws StopWalkException, MissingObjectException, IncorrectObjectTypeException, IOException { // Since the walker sorts commits by commit time we can be @@ -196,7 +196,7 @@ public abstract class CommitTimeRevFilter extends RevFilter { } @Override - public boolean include(final RevWalk walker, final RevCommit cmit) + public boolean include(RevWalk walker, RevCommit cmit) throws StopWalkException, MissingObjectException, IncorrectObjectTypeException, IOException { return cmit.getCommitTime() <= until && cmit.getCommitTime() >= when; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitterRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitterRevFilter.java index 4a1b3a6c7f..8d73ce43b8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitterRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitterRevFilter.java @@ -96,7 +96,7 @@ public class CommitterRevFilter { } @Override - protected CharSequence text(final RevCommit cmit) { + protected CharSequence text(RevCommit cmit) { return textFor(cmit); } @@ -112,7 +112,7 @@ public class CommitterRevFilter { } @Override - protected RawCharSequence text(final RevCommit cmit) { + protected RawCharSequence text(RevCommit cmit) { return textFor(cmit); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/MessageRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/MessageRevFilter.java index f1f4065480..5621e64633 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/MessageRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/MessageRevFilter.java @@ -96,7 +96,7 @@ public class MessageRevFilter { } @Override - protected CharSequence text(final RevCommit cmit) { + protected CharSequence text(RevCommit cmit) { return textFor(cmit); } @@ -112,7 +112,7 @@ public class MessageRevFilter { } @Override - protected RawCharSequence text(final RevCommit cmit) { + protected RawCharSequence text(RevCommit cmit) { return textFor(cmit); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/NotRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/NotRevFilter.java index 84b7f6b7b6..69dec567b8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/NotRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/NotRevFilter.java @@ -61,13 +61,13 @@ public class NotRevFilter extends RevFilter { * filter to negate. * @return a filter that does the reverse of a. */ - public static RevFilter create(final RevFilter a) { + public static RevFilter create(RevFilter a) { return new NotRevFilter(a); } private final RevFilter a; - private NotRevFilter(final RevFilter one) { + private NotRevFilter(RevFilter one) { a = one; } @@ -79,7 +79,7 @@ public class NotRevFilter extends RevFilter { /** {@inheritDoc} */ @Override - public boolean include(final RevWalk walker, final RevCommit c) + public boolean include(RevWalk walker, RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { return !a.include(walker, c); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java index a14764a82d..97697349f5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java @@ -72,7 +72,7 @@ public abstract class OrRevFilter extends RevFilter { * second filter to test. * @return a filter that must match at least one input filter. */ - public static RevFilter create(final RevFilter a, final RevFilter b) { + public static RevFilter create(RevFilter a, RevFilter b) { if (a == ALL || b == ALL) return ALL; return new Binary(a, b); @@ -86,7 +86,7 @@ public abstract class OrRevFilter extends RevFilter { * filters. * @return a filter that must match at least one input filter. */ - public static RevFilter create(final RevFilter[] list) { + public static RevFilter create(RevFilter[] list) { if (list.length == 2) return create(list[0], list[1]); if (list.length < 2) @@ -104,7 +104,7 @@ public abstract class OrRevFilter extends RevFilter { * filters. * @return a filter that must match at least one input filter. */ - public static RevFilter create(final Collection list) { + public static RevFilter create(Collection list) { if (list.size() < 2) throw new IllegalArgumentException(JGitText.get().atLeastTwoFiltersNeeded); final RevFilter[] subfilters = new RevFilter[list.size()]; @@ -129,7 +129,7 @@ public abstract class OrRevFilter extends RevFilter { } @Override - public boolean include(final RevWalk walker, final RevCommit c) + public boolean include(RevWalk walker, RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { return a.include(walker, c) || b.include(walker, c); @@ -167,7 +167,7 @@ public abstract class OrRevFilter extends RevFilter { } @Override - public boolean include(final RevWalk walker, final RevCommit c) + public boolean include(RevWalk walker, RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { for (final RevFilter f : subfilters) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/PatternMatchRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/PatternMatchRevFilter.java index edce224a6e..4f41edf54d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/PatternMatchRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/PatternMatchRevFilter.java @@ -72,7 +72,7 @@ public abstract class PatternMatchRevFilter extends RevFilter { * @return same pattern, but re-encoded to match our funny raw UTF-8 * character sequence {@link org.eclipse.jgit.util.RawCharSequence}. */ - protected static final String forceToRaw(final String patternText) { + protected static final String forceToRaw(String patternText) { final byte[] b = Constants.encode(patternText); final StringBuilder needle = new StringBuilder(b.length); for (int i = 0; i < b.length; i++) @@ -128,7 +128,7 @@ public abstract class PatternMatchRevFilter extends RevFilter { /** {@inheritDoc} */ @Override - public boolean include(final RevWalk walker, final RevCommit cmit) + public boolean include(RevWalk walker, RevCommit cmit) throws MissingObjectException, IncorrectObjectTypeException, IOException { return compiledPattern.reset(text(cmit)).matches(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFilter.java index 9068c57517..39f0d60166 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFilter.java @@ -103,7 +103,7 @@ public abstract class RevFilter { private static final class AllFilter extends RevFilter { @Override - public boolean include(final RevWalk walker, final RevCommit c) { + public boolean include(RevWalk walker, RevCommit c) { return true; } @@ -128,7 +128,7 @@ public abstract class RevFilter { private static final class NoneFilter extends RevFilter { @Override - public boolean include(final RevWalk walker, final RevCommit c) { + public boolean include(RevWalk walker, RevCommit c) { return false; } @@ -184,7 +184,7 @@ public abstract class RevFilter { private static final class NoMergesFilter extends RevFilter { @Override - public boolean include(final RevWalk walker, final RevCommit c) { + public boolean include(RevWalk walker, RevCommit c) { return c.getParentCount() < 2; } @@ -216,7 +216,7 @@ public abstract class RevFilter { private static final class MergeBaseFilter extends RevFilter { @Override - public boolean include(final RevWalk walker, final RevCommit c) { + public boolean include(RevWalk walker, RevCommit c) { throw new UnsupportedOperationException(JGitText.get().cannotBeCombined); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFlagFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFlagFilter.java index 8225e4d3e7..4d5690bb14 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFlagFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFlagFilter.java @@ -63,7 +63,7 @@ public abstract class RevFlagFilter extends RevFilter { * the flag to test. * @return filter that selects only commits with flag a. */ - public static RevFilter has(final RevFlag a) { + public static RevFilter has(RevFlag a) { final RevFlagSet s = new RevFlagSet(); s.add(a); return new HasAll(s); @@ -76,7 +76,7 @@ public abstract class RevFlagFilter extends RevFilter { * set of flags to test. * @return filter that selects only commits with all flags in a. */ - public static RevFilter hasAll(final RevFlag... a) { + public static RevFilter hasAll(RevFlag... a) { final RevFlagSet set = new RevFlagSet(); for (final RevFlag flag : a) set.add(flag); @@ -90,7 +90,7 @@ public abstract class RevFlagFilter extends RevFilter { * set of flags to test. * @return filter that selects only commits with all flags in a. */ - public static RevFilter hasAll(final RevFlagSet a) { + public static RevFilter hasAll(RevFlagSet a) { return new HasAll(new RevFlagSet(a)); } @@ -101,7 +101,7 @@ public abstract class RevFlagFilter extends RevFilter { * set of flags to test. * @return filter that selects only commits with any flag in a. */ - public static RevFilter hasAny(final RevFlag... a) { + public static RevFilter hasAny(RevFlag... a) { final RevFlagSet set = new RevFlagSet(); for (final RevFlag flag : a) set.add(flag); @@ -115,7 +115,7 @@ public abstract class RevFlagFilter extends RevFilter { * set of flags to test. * @return filter that selects only commits with any flag in a. */ - public static RevFilter hasAny(final RevFlagSet a) { + public static RevFilter hasAny(RevFlagSet a) { return new HasAny(new RevFlagSet(a)); } @@ -143,7 +143,7 @@ public abstract class RevFlagFilter extends RevFilter { } @Override - public boolean include(final RevWalk walker, final RevCommit c) + public boolean include(RevWalk walker, RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { return c.hasAll(flags); @@ -161,7 +161,7 @@ public abstract class RevFlagFilter extends RevFilter { } @Override - public boolean include(final RevWalk walker, final RevCommit c) + public boolean include(RevWalk walker, RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException { return c.hasAny(flags); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/SubStringRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/SubStringRevFilter.java index 3e6b1480e2..54650da0e0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/SubStringRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/SubStringRevFilter.java @@ -65,7 +65,7 @@ public abstract class SubStringRevFilter extends RevFilter { * if {@link org.eclipse.jgit.revwalk.filter.PatternMatchRevFilter} * must be used instead. */ - public static boolean safe(final String pattern) { + public static boolean safe(String pattern) { for (int i = 0; i < pattern.length(); i++) { final char c = pattern.charAt(i); switch (c) { @@ -96,13 +96,13 @@ public abstract class SubStringRevFilter extends RevFilter { * the {@link #safe(String)} as regular expression meta * characters are treated as literals. */ - protected SubStringRevFilter(final String patternText) { + protected SubStringRevFilter(String patternText) { pattern = new RawSubStringPattern(patternText); } /** {@inheritDoc} */ @Override - public boolean include(final RevWalk walker, final RevCommit cmit) + public boolean include(RevWalk walker, RevCommit cmit) throws MissingObjectException, IncorrectObjectTypeException, IOException { return pattern.match(text(cmit)) >= 0; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java index fcac80ce3c..4b272ba7a4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java @@ -254,7 +254,7 @@ public class FileBasedConfig extends StoredConfig { super.clear(); } - private static ObjectId hash(final byte[] rawText) { + private static ObjectId hash(byte[] rawText) { return ObjectId.fromRaw(Constants.newMessageDigest().digest(rawText)); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java index 19fc63e00b..c2e6a42001 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCacheConfig.java @@ -98,7 +98,7 @@ public class WindowCacheConfig { * maximum number of streams to open at a time. Open packs count * against the process limits */ - public void setPackedGitOpenFiles(final int fdLimit) { + public void setPackedGitOpenFiles(int fdLimit) { packedGitOpenFiles = fdLimit; } @@ -121,7 +121,7 @@ public class WindowCacheConfig { * maximum number bytes of heap memory to dedicate to caching * pack file data. */ - public void setPackedGitLimit(final long newLimit) { + public void setPackedGitLimit(long newLimit) { packedGitLimit = newLimit; } @@ -142,7 +142,7 @@ public class WindowCacheConfig { * @param newSize * size in bytes of a single window read in from the pack file. */ - public void setPackedGitWindowSize(final int newSize) { + public void setPackedGitWindowSize(int newSize) { packedGitWindowSize = newSize; } @@ -165,7 +165,7 @@ public class WindowCacheConfig { * for windows; false reads entire window into a byte[] with * standard read calls. */ - public void setPackedGitMMAP(final boolean usemmap) { + public void setPackedGitMMAP(boolean usemmap) { packedGitMMAP = usemmap; } @@ -189,7 +189,7 @@ public class WindowCacheConfig { * maximum number of bytes to cache in delta base cache for * inflated, recently accessed objects, without delta chains. */ - public void setDeltaBaseCacheLimit(final int newLimit) { + public void setDeltaBaseCacheLimit(int newLimit) { deltaBaseCacheLimit = newLimit; } @@ -211,7 +211,7 @@ public class WindowCacheConfig { * array, while objects bigger than this size require using an * {@link org.eclipse.jgit.lib.ObjectStream}. */ - public void setStreamFileThreshold(final int newLimit) { + public void setStreamFileThreshold(int newLimit) { streamFileThreshold = newLimit; } @@ -226,7 +226,7 @@ public class WindowCacheConfig { * @return {@code this}. * @since 3.0 */ - public WindowCacheConfig fromConfig(final Config rc) { + public WindowCacheConfig fromConfig(Config rc) { setPackedGitOpenFiles(rc.getInt( "core", null, "packedgitopenfiles", getPackedGitOpenFiles())); //$NON-NLS-1$ //$NON-NLS-2$ setPackedGitLimit(rc.getLong( diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java index 484cde29ee..256e41d22b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java @@ -1039,7 +1039,7 @@ public class PackConfig { * @param rc * configuration to read properties from. */ - public void fromConfig(final Config rc) { + public void fromConfig(Config rc) { setMaxDeltaDepth(rc.getInt("pack", "depth", getMaxDeltaDepth())); //$NON-NLS-1$ //$NON-NLS-2$ setDeltaSearchWindowSize(rc.getInt( "pack", "window", getDeltaSearchWindowSize())); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java index 211bbe8e54..ce8995ad8f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java @@ -371,7 +371,7 @@ public class SubmoduleWalk implements AutoCloseable { * the {@link org.eclipse.jgit.lib.Repository}. * @throws java.io.IOException */ - public SubmoduleWalk(final Repository repository) throws IOException { + public SubmoduleWalk(Repository repository) throws IOException { this.repository = repository; repoConfig = repository.getConfig(); walk = new TreeWalk(repository); @@ -388,7 +388,7 @@ public class SubmoduleWalk implements AutoCloseable { * .gitmodules config object * @return this generator */ - public SubmoduleWalk setModulesConfig(final Config config) { + public SubmoduleWalk setModulesConfig(Config config) { modulesConfig = config; loadPathNames(); return this; @@ -407,7 +407,7 @@ public class SubmoduleWalk implements AutoCloseable { * tree containing .gitmodules * @return this generator */ - public SubmoduleWalk setRootTree(final AbstractTreeIterator tree) { + public SubmoduleWalk setRootTree(AbstractTreeIterator tree) { rootTree = tree; modulesConfig = null; pathToName = null; @@ -428,7 +428,7 @@ public class SubmoduleWalk implements AutoCloseable { * @return this generator * @throws java.io.IOException */ - public SubmoduleWalk setRootTree(final AnyObjectId id) throws IOException { + public SubmoduleWalk setRootTree(AnyObjectId id) throws IOException { final CanonicalTreeParser p = new CanonicalTreeParser(); p.reset(walk.getObjectReader(), id); rootTree = p; @@ -562,7 +562,7 @@ public class SubmoduleWalk implements AutoCloseable { * @return this generator * @throws org.eclipse.jgit.errors.CorruptObjectException */ - public SubmoduleWalk setTree(final AbstractTreeIterator iterator) + public SubmoduleWalk setTree(AbstractTreeIterator iterator) throws CorruptObjectException { walk.addTree(iterator); return this; @@ -580,7 +580,7 @@ public class SubmoduleWalk implements AutoCloseable { * @throws MissingObjectException * if any. */ - public SubmoduleWalk setTree(final AnyObjectId treeId) throws IOException { + public SubmoduleWalk setTree(AnyObjectId treeId) throws IOException { walk.addTree(treeId); return this; } 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 740a284302..3df5bdb2c9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java @@ -128,12 +128,12 @@ public class AmazonS3 { SIGNED_HEADERS.add("date"); //$NON-NLS-1$ } - private static boolean isSignedHeader(final String name) { + private static boolean isSignedHeader(String name) { final String nameLC = StringUtils.toLowerCase(name); return SIGNED_HEADERS.contains(nameLC) || nameLC.startsWith("x-amz-"); //$NON-NLS-1$ } - private static String toCleanString(final List list) { + private static String toCleanString(List list) { final StringBuilder s = new StringBuilder(); for (final String v : list) { if (s.length() > 0) @@ -143,7 +143,7 @@ public class AmazonS3 { return s.toString(); } - private static String remove(final Map m, final String k) { + private static String remove(Map m, String k) { final String r = m.remove(k); return r != null ? r : ""; //$NON-NLS-1$ } @@ -283,7 +283,7 @@ public class AmazonS3 { * @throws java.io.IOException * sending the request was not possible. */ - public URLConnection get(final String bucket, final String key) + public URLConnection get(String bucket, String key) throws IOException { for (int curAttempt = 0; curAttempt < maxAttempts; curAttempt++) { final HttpURLConnection c = open("GET", bucket, key); //$NON-NLS-1$ @@ -312,7 +312,7 @@ public class AmazonS3 { * @throws java.io.IOException * decryption could not be configured. */ - public InputStream decrypt(final URLConnection u) throws IOException { + public InputStream decrypt(URLConnection u) throws IOException { return encryption.decrypt(u.getInputStream()); } @@ -336,7 +336,7 @@ public class AmazonS3 { * sending the request was not possible, or the response XML * document could not be parsed properly. */ - public List list(final String bucket, String prefix) + public List list(String bucket, String prefix) throws IOException { if (prefix.length() > 0 && !prefix.endsWith("/")) //$NON-NLS-1$ prefix += "/"; //$NON-NLS-1$ @@ -359,7 +359,7 @@ public class AmazonS3 { * @throws java.io.IOException * deletion failed due to communications error. */ - public void delete(final String bucket, final String key) + public void delete(String bucket, String key) throws IOException { for (int curAttempt = 0; curAttempt < maxAttempts; curAttempt++) { final HttpURLConnection c = open("DELETE", bucket, key); //$NON-NLS-1$ @@ -396,7 +396,7 @@ public class AmazonS3 { * @throws java.io.IOException * creation/updating failed due to communications error. */ - public void put(final String bucket, final String key, final byte[] data) + public void put(String bucket, String key, byte[] data) throws IOException { if (encryption != WalkEncryption.NONE) { // We have to copy to produce the cipher text anyway so use @@ -727,7 +727,7 @@ public class AmazonS3 { } @Override - public void characters(final char[] ch, final int s, final int n) + public void characters(char[] ch, int s, int n) throws SAXException { if (data != null) data.append(ch, s, n); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseConnection.java index c8d1d229b5..f6045f6fe6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseConnection.java @@ -85,7 +85,7 @@ public abstract class BaseConnection implements Connection { /** {@inheritDoc} */ @Override - public final Ref getRef(final String name) { + public final Ref getRef(String name) { return advertisedRefs.get(name); } @@ -132,7 +132,7 @@ public abstract class BaseConnection implements Connection { * will be wrapped in an unmodifiable way to protect it, but it * does not get copied. */ - protected void available(final Map all) { + protected void available(Map all) { advertisedRefs = Collections.unmodifiableMap(all); } 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 e9227e33a3..1bda914941 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java @@ -274,7 +274,7 @@ abstract class BasePackConnection extends BaseConnection { * option string * @return whether this option is supported */ - protected boolean isCapableOf(final String option) { + protected boolean isCapableOf(String option) { return remoteCapablities.contains(option); } @@ -287,7 +287,7 @@ abstract class BasePackConnection extends BaseConnection { * option we want * @return {@code true} if the requested option is supported */ - protected boolean wantCapability(final StringBuilder b, final String option) { + protected boolean wantCapability(StringBuilder b, String option) { if (!isCapableOf(option)) return false; b.append(' '); @@ -314,7 +314,7 @@ abstract class BasePackConnection extends BaseConnection { return UserAgent.getAgent(remoteCapablities, super.getPeerUserAgent()); } - private PackProtocolException duplicateAdvertisement(final String name) { + private PackProtocolException duplicateAdvertisement(String name) { return new PackProtocolException(uri, MessageFormat.format(JGitText.get().duplicateAdvertisementsOf, name)); } 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 96329d1f18..6e4b05fe21 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java @@ -255,7 +255,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection * @param packTransport * the transport. */ - public BasePackFetchConnection(final PackTransport packTransport) { + public BasePackFetchConnection(PackTransport packTransport) { super(packTransport); if (local != null) { @@ -339,7 +339,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection /** {@inheritDoc} */ @Override - public void setPackLockMessage(final String message) { + public void setPackLockMessage(String message) { lockMessage = message; } @@ -418,7 +418,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection return local.getConfig().get(FetchConfig::new); } - private int maxTimeWanted(final Collection wants) { + private int maxTimeWanted(Collection wants) { int maxTime = 0; for (final Ref r : wants) { try { @@ -435,7 +435,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection return maxTime; } - private void markReachable(final Set have, final int maxTime) + private void markReachable(Set have, int maxTime) throws IOException { for (Ref r : local.getRefDatabase().getRefs()) { ObjectId id = r.getPeeledObjectId(); @@ -489,7 +489,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection } } - private boolean sendWants(final Collection want) throws IOException { + private boolean sendWants(Collection want) throws IOException { final PacketLineOut p = statelessRPC ? pckState : pckOut; boolean first = true; for (final Ref r : want) { @@ -585,7 +585,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection return line.toString(); } - private void negotiate(final ProgressMonitor monitor) throws IOException, + private void negotiate(ProgressMonitor monitor) throws IOException, CancelledException { final MutableObjectId ackId = new MutableObjectId(); int resultsPending = 0; @@ -785,7 +785,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection } @Override - public boolean include(final RevWalk walker, final RevCommit c) { + public boolean include(RevWalk walker, RevCommit c) { final boolean remoteKnowsIsCommon = c.has(COMMON); if (c.has(ADVERTISED)) { // Remote advertised this, and we have it, hence common. @@ -813,7 +813,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection } } - private void markAdvertised(final AnyObjectId id) { + private void markAdvertised(AnyObjectId id) { try { walk.parseAny(id).add(ADVERTISED); } catch (IOException readError) { @@ -821,7 +821,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection } } - private void markCommon(final RevObject obj, final AckNackResult anr) + private void markCommon(RevObject obj, AckNackResult anr) throws IOException { if (statelessRPC && anr == AckNackResult.ACK_COMMON && !obj.has(STATE)) { StringBuilder s; 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 ee6f29ed0a..5624377b7a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java @@ -146,7 +146,7 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen * @param packTransport * the transport. */ - public BasePackPushConnection(final PackTransport packTransport) { + public BasePackPushConnection(PackTransport packTransport) { super(packTransport); thinPack = transport.isPushThin(); atomic = transport.isPushAtomic(); @@ -365,7 +365,7 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen } } - private void readStatusReport(final Map refUpdates) + private void readStatusReport(Map refUpdates) throws IOException { final String unpackLine = readStringLongTimeout(); if (!unpackLine.startsWith("unpack ")) //$NON-NLS-1$ 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 e97f71a488..d78751f894 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java @@ -306,7 +306,7 @@ public abstract class BaseReceivePack { * @param into * the destination repository. */ - protected BaseReceivePack(final Repository into) { + protected BaseReceivePack(Repository into) { db = into; walk = new RevWalk(db); @@ -548,7 +548,7 @@ public abstract class BaseReceivePack { * commands before writing output and does not perform the * initial advertising. */ - public void setBiDirectionalPipe(final boolean twoWay) { + public void setBiDirectionalPipe(boolean twoWay) { biDirectionalPipe = twoWay; } @@ -592,7 +592,7 @@ public abstract class BaseReceivePack { * assume all received objects are valid. * @see #setObjectChecker(ObjectChecker) */ - public void setCheckReceivedObjects(final boolean check) { + public void setCheckReceivedObjects(boolean check) { if (check && objectChecker == null) setObjectChecker(new ObjectChecker()); else if (!check && objectChecker != null) @@ -626,7 +626,7 @@ public abstract class BaseReceivePack { * @param canCreate * {@code true} to permit create ref commands to be processed. */ - public void setAllowCreates(final boolean canCreate) { + public void setAllowCreates(boolean canCreate) { allowCreates = canCreate; } @@ -645,7 +645,7 @@ public abstract class BaseReceivePack { * @param canDelete * {@code true} to permit delete ref commands to be processed. */ - public void setAllowDeletes(final boolean canDelete) { + public void setAllowDeletes(boolean canDelete) { allowAnyDeletes = canDelete; } @@ -691,7 +691,7 @@ public abstract class BaseReceivePack { * {@code true} to permit the client to ask for non-fast-forward * updates of an existing ref. */ - public void setAllowNonFastForwards(final boolean canRewind) { + public void setAllowNonFastForwards(boolean canRewind) { allowNonFastForwards = canRewind; } @@ -741,7 +741,7 @@ public abstract class BaseReceivePack { * automatically determined based on the repository * configuration. */ - public void setRefLogIdent(final PersonIdent pi) { + public void setRefLogIdent(PersonIdent pi) { refLogIdent = pi; } @@ -778,7 +778,7 @@ public abstract class BaseReceivePack { * @param advertiseRefsHook * the hook; may be null to show all refs. */ - public void setAdvertiseRefsHook(final AdvertiseRefsHook advertiseRefsHook) { + public void setAdvertiseRefsHook(AdvertiseRefsHook advertiseRefsHook) { if (advertiseRefsHook != null) this.advertiseRefsHook = advertiseRefsHook; else @@ -795,7 +795,7 @@ public abstract class BaseReceivePack { * @param refFilter * the filter; may be null to show all refs. */ - public void setRefFilter(final RefFilter refFilter) { + public void setRefFilter(RefFilter refFilter) { this.refFilter = refFilter != null ? refFilter : RefFilter.DEFAULT; } @@ -816,7 +816,7 @@ public abstract class BaseReceivePack { * before aborting an IO read or write operation with the * connected client. */ - public void setTimeout(final int seconds) { + public void setTimeout(int seconds) { timeout = seconds; } @@ -861,7 +861,7 @@ public abstract class BaseReceivePack { * @param limit * the Git object size limit. If zero then there is not limit. */ - public void setMaxObjectSizeLimit(final long limit) { + public void setMaxObjectSizeLimit(long limit) { maxObjectSizeLimit = limit; } @@ -874,7 +874,7 @@ public abstract class BaseReceivePack { * the pack size limit, in bytes * @since 3.3 */ - public void setMaxPackSizeLimit(final long limit) { + public void setMaxPackSizeLimit(long limit) { if (limit < 0) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().receivePackInvalidLimit, Long.valueOf(limit))); @@ -1031,7 +1031,7 @@ public abstract class BaseReceivePack { * string describing the problem identified by the hook. The * string must not end with an LF, and must not contain an LF. */ - public void sendError(final String what) { + public void sendError(String what) { if (refs == null) { if (advertiseError == null) advertiseError = new StringBuilder(); @@ -1064,7 +1064,7 @@ public abstract class BaseReceivePack { * string describing the problem identified by the hook. The * string must not end with an LF, and must not contain an LF. */ - public void sendMessage(final String what) { + public void sendMessage(String what) { msgOutWrapper.write(Constants.encode(what + "\n")); //$NON-NLS-1$ } @@ -1213,7 +1213,7 @@ public abstract class BaseReceivePack { * @throws org.eclipse.jgit.transport.ServiceMayNotContinueException * the hook denied advertisement. */ - public void sendAdvertisedRefs(final RefAdvertiser adv) + public void sendAdvertisedRefs(RefAdvertiser adv) throws IOException, ServiceMayNotContinueException { if (advertiseError != null) { adv.writeOne("ERR " + advertiseError); //$NON-NLS-1$ @@ -1761,7 +1761,7 @@ public abstract class BaseReceivePack { * @return a copy of the command list containing only those commands with the * desired status. */ - protected List filterCommands(final Result want) { + protected List filterCommands(Result want) { return ReceiveCommand.filter(commands, want); } 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 7cf10e95be..2002c9199e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java @@ -153,12 +153,12 @@ class BundleFetchConnection extends BaseFetchConnection { available(avail); } - private PackProtocolException duplicateAdvertisement(final String name) { + private PackProtocolException duplicateAdvertisement(String name) { return new PackProtocolException(transport.uri, MessageFormat.format(JGitText.get().duplicateAdvertisementsOf, name)); } - private String readLine(final byte[] hdrbuf) throws IOException { + private String readLine(byte[] hdrbuf) throws IOException { StringBuilder line = new StringBuilder(); boolean done = false; while (!done) { @@ -210,7 +210,7 @@ class BundleFetchConnection extends BaseFetchConnection { /** {@inheritDoc} */ @Override - public void setPackLockMessage(final String message) { + public void setPackLockMessage(String message) { lockMessage = message; } 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 35ac7792e6..5779b0d75e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java @@ -151,7 +151,7 @@ public class BundleWriter { * @param id * object to pack. Multiple refs may point to the same object. */ - public void include(final String name, final AnyObjectId id) { + public void include(String name, AnyObjectId id) { boolean validRefName = Repository.isValidRefName(name) || Constants.HEAD.equals(name); if (!validRefName) throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidRefName, name)); @@ -169,7 +169,7 @@ public class BundleWriter { * @param r * the ref to include. */ - public void include(final Ref r) { + public void include(Ref r) { include(r.getName(), r.getObjectId()); if (r.getPeeledObjectId() != null) @@ -192,7 +192,7 @@ public class BundleWriter { * parsed and not disposed in order to maximize the amount of * debugging information available in the bundle stream. */ - public void assume(final RevCommit c) { + public void assume(RevCommit c) { if (c != null) assume.add(c); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java index bcc5110e73..d4c514e636 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java @@ -95,7 +95,7 @@ public interface Connection extends AutoCloseable { * name of the ref to obtain. * @return the requested ref; null if the remote did not advertise this ref. */ - public Ref getRef(final String name); + public Ref getRef(String name); /** * {@inheritDoc} diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java index 2fc5eb2b51..2b2f257822 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java @@ -107,7 +107,7 @@ public class Daemon { * port will be chosen on all network interfaces. */ @SuppressWarnings("unchecked") - public Daemon(final InetSocketAddress addr) { + public Daemon(InetSocketAddress addr) { myAddress = addr; processors = new ThreadGroup("Git-Daemon"); //$NON-NLS-1$ @@ -224,7 +224,7 @@ public class Daemon { * before aborting an IO read or write operation with the * connected client. */ - public void setTimeout(final int seconds) { + public void setTimeout(int seconds) { timeout = seconds; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java index 712eb22152..1dc55beb15 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java @@ -96,7 +96,7 @@ public abstract class DaemonService { * {@code true} to allow this service to be used; {@code false} * to deny it. */ - public void setEnabled(final boolean on) { + public void setEnabled(boolean on) { enabled = on; } @@ -120,7 +120,7 @@ public abstract class DaemonService { * enabled state with the daemon.servicename config * setting. */ - public void setOverridable(final boolean on) { + public void setOverridable(boolean on) { overridable = on; } @@ -140,7 +140,7 @@ public abstract class DaemonService { * input line from the client. * @return true if this command can accept the given command line. */ - public boolean handles(final String commandLine) { + public boolean handles(String commandLine) { return command.length() + 1 < commandLine.length() && commandLine.charAt(command.length()) == ' ' && commandLine.startsWith(command); @@ -162,7 +162,7 @@ public abstract class DaemonService { } } - private boolean isEnabledFor(final Repository db) { + private boolean isEnabledFor(Repository db) { if (isOverridable()) return db.getConfig().get(configKey).enabled; return isEnabled(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DefaultSshSessionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DefaultSshSessionFactory.java index a749fbcaf0..5f74e72eaf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DefaultSshSessionFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DefaultSshSessionFactory.java @@ -61,7 +61,7 @@ import com.jcraft.jsch.Session; class DefaultSshSessionFactory extends JschConfigSessionFactory { /** {@inheritDoc} */ @Override - protected void configure(final OpenSshConfig.Host hc, final Session session) { + protected void configure(OpenSshConfig.Host hc, Session session) { // No additional configuration required. } } 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 fdb5adf94e..1ef1900571 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java @@ -239,7 +239,7 @@ class FetchProcess { } } - private void fetchObjects(final ProgressMonitor monitor) + private void fetchObjects(ProgressMonitor monitor) throws TransportException { try { conn.setPackLockMessage("jgit fetch " + transport.uri); //$NON-NLS-1$ @@ -253,7 +253,7 @@ class FetchProcess { JGitText.get().peerDidNotSupplyACompleteObjectGraph); } - private void closeConnection(final FetchResult result) { + private void closeConnection(FetchResult result) { if (conn != null) { conn.close(); result.addMessages(conn.getMessages()); @@ -293,7 +293,7 @@ class FetchProcess { } } - private void removeTrackingRefUpdate(final ObjectId want) { + private void removeTrackingRefUpdate(ObjectId want) { final Iterator i = localUpdates.iterator(); while (i.hasNext()) { final TrackingRefUpdate u = i.next(); @@ -302,7 +302,7 @@ class FetchProcess { } } - private void removeFetchHeadRecord(final ObjectId want) { + private void removeFetchHeadRecord(ObjectId want) { final Iterator i = fetchHeadUpdates.iterator(); while (i.hasNext()) { final FetchHeadRecord fh = i.next(); @@ -311,7 +311,7 @@ class FetchProcess { } } - private void updateFETCH_HEAD(final FetchResult result) throws IOException { + private void updateFETCH_HEAD(FetchResult result) throws IOException { File meta = transport.local.getDirectory(); if (meta == null) return; @@ -349,7 +349,7 @@ class FetchProcess { } } - private void expandWildcard(final RefSpec spec, final Set matched) + private void expandWildcard(RefSpec spec, Set matched) throws TransportException { for (final Ref src : conn.getRefs()) { if (spec.matchSource(src) && matched.add(src)) @@ -357,7 +357,7 @@ class FetchProcess { } } - private void expandSingle(final RefSpec spec, final Set matched) + private void expandSingle(RefSpec spec, Set matched) throws TransportException { String want = spec.getSource(); if (ObjectId.isId(want)) { @@ -416,12 +416,12 @@ class FetchProcess { } } - private void wantTag(final Ref r) throws TransportException { + private void wantTag(Ref r) throws TransportException { want(r, new RefSpec().setSource(r.getName()) .setDestination(r.getName()).setForceUpdate(true)); } - private void want(final Ref src, final RefSpec spec) + private void want(Ref src, RefSpec spec) throws TransportException { final ObjectId newId = src.getObjectId(); if (newId == null) { @@ -506,11 +506,11 @@ class FetchProcess { batch.addCommand(update.asReceiveCommand()); } - private static boolean isTag(final Ref r) { + private static boolean isTag(Ref r) { return isTag(r.getName()); } - private static boolean isTag(final String name) { + private static boolean isTag(String name) { return name.startsWith(Constants.R_TAGS); } 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 2a222fbc7b..ea2f4b1e3e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java @@ -309,7 +309,7 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory { * @throws com.jcraft.jsch.JSchException * the user configuration could not be created. */ - protected JSch getJSch(final OpenSshConfig.Host hc, FS fs) throws JSchException { + protected JSch getJSch(OpenSshConfig.Host hc, FS fs) throws JSchException { if (defaultJSch == null) { defaultJSch = createDefaultJSch(fs); if (defaultJSch.getConfigRepository() == null) { @@ -357,7 +357,7 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory { return jsch; } - private static void knownHosts(final JSch sch, FS fs) throws JSchException { + private static void knownHosts(JSch sch, FS fs) throws JSchException { final File home = fs.userHome(); if (home == null) return; @@ -371,7 +371,7 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory { } } - private static void identities(final JSch sch, FS fs) { + private static void identities(JSch sch, FS fs) { final File home = fs.userHome(); if (home == null) return; @@ -383,7 +383,7 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory { } } - private static void loadIdentity(final JSch sch, final File priv) { + private static void loadIdentity(JSch sch, File priv) { if (priv.isFile()) { try { sch.addIdentity(priv.getAbsolutePath()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java index 081d05748c..68757803c0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java @@ -82,7 +82,7 @@ public class JschSession implements RemoteSession { * @param uri * the URI information for the remote connection */ - public JschSession(final Session session, URIish uri) { + public JschSession(Session session, URIish uri) { sock = session; this.uri = uri; } 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 4660c40d98..4cb8393690 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java @@ -201,7 +201,7 @@ public class OpenSshConfig implements ConfigRepository { * configuration file. * @return r configuration for the requested name. Never null. */ - public Host lookup(final String hostName) { + public Host lookup(String hostName) { final State cache = refresh(); Host h = cache.hosts.get(hostName); if (h != null) { @@ -238,7 +238,7 @@ public class OpenSshConfig implements ConfigRepository { return state; } - private Map parse(final InputStream in) + private Map parse(InputStream in) throws IOException { final Map m = new LinkedHashMap<>(); final BufferedReader br = new BufferedReader(new InputStreamReader(in)); @@ -332,14 +332,14 @@ public class OpenSshConfig implements ConfigRepository { } } - private static String dequote(final String value) { + private static String dequote(String value) { if (value.startsWith("\"") && value.endsWith("\"") //$NON-NLS-1$ //$NON-NLS-2$ && value.length() > 1) return value.substring(1, value.length() - 1); return value; } - private static String nows(final String value) { + private static String nows(String value) { final StringBuilder b = new StringBuilder(); for (int i = 0; i < value.length(); i++) { if (!Character.isSpaceChar(value.charAt(i))) @@ -348,7 +348,7 @@ public class OpenSshConfig implements ConfigRepository { return b.toString(); } - private static Boolean yesno(final String value) { + private static Boolean yesno(String value) { if (StringUtils.equalsIgnoreCase("yes", value)) //$NON-NLS-1$ return Boolean.TRUE; return Boolean.FALSE; @@ -365,7 +365,7 @@ public class OpenSshConfig implements ConfigRepository { return new File(home, path); } - private static int positive(final String value) { + private static int positive(String value) { if (value != null) { try { return Integer.parseUnsignedInt(value); 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 42317984fe..0fc24ed9b0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java @@ -107,7 +107,7 @@ public abstract class OperationResult { * name of the ref to obtain. * @return the requested ref; null if the remote did not advertise this ref. */ - public final Ref getAdvertisedRef(final String name) { + public final Ref getAdvertisedRef(String name) { return advertisedRefs.get(name); } @@ -129,7 +129,7 @@ public abstract class OperationResult { * @return status of the local ref; null if this local ref was not touched * during this operation. */ - public TrackingRefUpdate getTrackingRefUpdate(final String localName) { + public TrackingRefUpdate getTrackingRefUpdate(String localName) { return updates.get(localName); } 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 8972955412..8ac7926dc7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java @@ -200,7 +200,7 @@ public abstract class PackParser { * @param src * the stream the parser will read. */ - protected PackParser(final ObjectDatabase odb, final InputStream src) { + protected PackParser(ObjectDatabase odb, InputStream src) { objectDatabase = odb.newCachedDatabase(); in = src; @@ -232,7 +232,7 @@ public abstract class PackParser { * @param allow * true to enable a thin pack. */ - public void setAllowThin(final boolean allow) { + public void setAllowThin(boolean allow) { allowThin = allow; } @@ -379,7 +379,7 @@ public abstract class PackParser { * @param oc * the checker instance; null to disable object checking. */ - public void setObjectChecker(final ObjectChecker oc) { + public void setObjectChecker(ObjectChecker oc) { objCheck = oc; } @@ -399,7 +399,7 @@ public abstract class PackParser { * @param on * true to enable the default checker; false to disable it. */ - public void setObjectChecking(final boolean on) { + public void setObjectChecking(boolean on) { setObjectChecker(on ? new ObjectChecker() : null); } @@ -629,7 +629,7 @@ public abstract class PackParser { resolving.endTask(); } - private void resolveDeltas(final ProgressMonitor progress) + private void resolveDeltas(ProgressMonitor progress) throws IOException { final int last = entryCount; for (int i = 0; i < last; i++) { @@ -819,7 +819,7 @@ public abstract class PackParser { return info; } - private UnresolvedDelta removeBaseById(final AnyObjectId id) { + private UnresolvedDelta removeBaseById(AnyObjectId id) { final DeltaChain d = baseById.get(id); return d != null ? d.remove() : null; } @@ -865,7 +865,7 @@ public abstract class PackParser { return first; } - private void resolveDeltasWithExternalBases(final ProgressMonitor progress) + private void resolveDeltasWithExternalBases(ProgressMonitor progress) throws IOException { growEntries(baseById.size()); @@ -1065,7 +1065,7 @@ public abstract class PackParser { } } - private void whole(final long pos, final int type, final long sz) + private void whole(long pos, int type, long sz) throws IOException { SHA1 objectDigest = objectHasher.reset(); objectDigest.update(Constants.encodedTypeString(type)); @@ -1224,7 +1224,7 @@ public abstract class PackParser { } // Consume exactly one byte from the buffer and return it. - private int readFrom(final Source src) throws IOException { + private int readFrom(Source src) throws IOException { if (bAvail == 0) fill(src, 1); bAvail--; @@ -1636,14 +1636,14 @@ public abstract class PackParser { public long size; } - private void inflateAndSkip(final Source src, final long inflatedSize) + private void inflateAndSkip(Source src, long inflatedSize) throws IOException { try (InputStream inf = inflate(src, inflatedSize)) { IO.skipFully(inf, inflatedSize); } } - private byte[] inflateAndReturn(final Source src, final long inflatedSize) + private byte[] inflateAndReturn(Source src, long inflatedSize) throws IOException { final byte[] dst = new byte[(int) inflatedSize]; try (InputStream inf = inflate(src, inflatedSize)) { @@ -1652,7 +1652,7 @@ public abstract class PackParser { return dst; } - private InputStream inflate(final Source src, final long inflatedSize) + private InputStream inflate(Source src, long inflatedSize) throws IOException { inflater.open(src, inflatedSize); return inflater; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java index 80fc0b42ad..59d1b7885b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java @@ -75,7 +75,7 @@ public class PackedObjectInfo extends ObjectIdOwnerMap.Entry { * @param id * the identity of the object the new instance tracks. */ - public PackedObjectInfo(final AnyObjectId id) { + public PackedObjectInfo(AnyObjectId id) { super(id); } @@ -95,7 +95,7 @@ public class PackedObjectInfo extends ObjectIdOwnerMap.Entry { * @param offset * offset where written object starts */ - public void setOffset(final long offset) { + public void setOffset(long offset) { this.offset = offset; } @@ -116,7 +116,7 @@ public class PackedObjectInfo extends ObjectIdOwnerMap.Entry { * inflated length and delta base reference) as computed by * {@link java.util.zip.CRC32}. */ - public void setCRC(final int crc) { + public void setCRC(int crc) { this.crc = crc; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineOut.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineOut.java index 0cb3b0ff0b..a26d1d77d6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineOut.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineOut.java @@ -78,7 +78,7 @@ public class PacketLineOut { * @param outputStream * stream. */ - public PacketLineOut(final OutputStream outputStream) { + public PacketLineOut(OutputStream outputStream) { out = outputStream; lenbuffer = new byte[5]; flushOnEnd = true; @@ -104,7 +104,7 @@ public class PacketLineOut { * the packet could not be written, the stream is corrupted as * the packet may have been only partially written. */ - public void writeString(final String s) throws IOException { + public void writeString(String s) throws IOException { writePacket(Constants.encode(s)); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java index 36d660234d..7f5a3408e3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java @@ -192,7 +192,7 @@ public class PushCertificateStore implements AutoCloseable { * @return iterable over certificates; must be fully iterated in order to * close resources. */ - public Iterable getAll(final String refName) { + public Iterable getAll(String refName) { return new Iterable() { @Override public Iterator iterator() { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushResult.java index 8bae5a5e09..54527048f8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushResult.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushResult.java @@ -82,7 +82,7 @@ public class PushResult extends OperationResult { * remote ref name * @return status of remote ref update */ - public RemoteRefUpdate getRemoteUpdate(final String refName) { + public RemoteRefUpdate getRemoteUpdate(String refName) { return remoteUpdates.get(refName); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java index e14d18f3a6..5c52f2c3ed 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java @@ -713,7 +713,7 @@ public class ReceiveCommand { * @param s * the new status code for this command. */ - public void setResult(final Result s) { + public void setResult(Result s) { setResult(s, null); } @@ -725,7 +725,7 @@ public class ReceiveCommand { * @param m * optional message explaining the new status. */ - public void setResult(final Result s, final String m) { + public void setResult(Result s, String m) { status = s; message = m; } @@ -770,7 +770,7 @@ public class ReceiveCommand { * receive-pack session. * @since 2.0 */ - public void execute(final BaseReceivePack rp) { + public void execute(BaseReceivePack rp) { try { String expTarget = getOldSymref(); boolean detach = getNewSymref() != null diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java index 7c5f32ac0d..31b75b07f5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java @@ -88,7 +88,7 @@ public class ReceivePack extends BaseReceivePack { * @param into * the destination repository. */ - public ReceivePack(final Repository into) { + public ReceivePack(Repository into) { super(into); preReceive = PreReceiveHook.NULL; postReceive = PostReceiveHook.NULL; @@ -154,7 +154,7 @@ public class ReceivePack extends BaseReceivePack { * @param h * the hook instance; may be null to disable the hook. */ - public void setPreReceiveHook(final PreReceiveHook h) { + public void setPreReceiveHook(PreReceiveHook h) { preReceive = h != null ? h : PreReceiveHook.NULL; } @@ -178,7 +178,7 @@ public class ReceivePack extends BaseReceivePack { * @param h * the hook instance; may be null to disable the hook. */ - public void setPostReceiveHook(final PostReceiveHook h) { + public void setPostReceiveHook(PostReceiveHook h) { postReceive = h != null ? h : PostReceiveHook.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 07d0bfdc0a..859ef2c976 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java @@ -153,7 +153,7 @@ public abstract class RefAdvertiser { } @Override - protected void writeOne(final CharSequence line) throws IOException { + protected void writeOne(CharSequence line) throws IOException { pckOut.writeString(line.toString()); } @@ -215,7 +215,7 @@ public abstract class RefAdvertiser { * true to show the dereferenced value of a tag as the special * ref $tag^{} ; false to omit it from the output. */ - public void setDerefTags(final boolean deref) { + public void setDerefTags(boolean deref) { derefTags = deref; } @@ -365,13 +365,13 @@ public abstract class RefAdvertiser { return first; } - private void advertiseAnyOnce(AnyObjectId obj, final String refName) + private void advertiseAnyOnce(AnyObjectId obj, String refName) throws IOException { if (!sent.contains(obj)) advertiseAny(obj, refName); } - private void advertiseAny(AnyObjectId obj, final String refName) + private void advertiseAny(AnyObjectId obj, String refName) throws IOException { sent.add(obj.toObjectId()); advertiseId(obj, refName); @@ -392,7 +392,7 @@ public abstract class RefAdvertiser { * the underlying output stream failed to write out an * advertisement record. */ - public void advertiseId(final AnyObjectId id, final String refName) + public void advertiseId(AnyObjectId id, String refName) throws IOException { tmpLine.setLength(0); id.copyTo(tmpId, tmpLine); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java index bbe4f84bc8..992ddc6e53 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java @@ -63,7 +63,7 @@ public interface RefFilter { */ public static final RefFilter DEFAULT = new RefFilter() { @Override - public Map filter (final Map refs) { + public Map filter (Map refs) { return refs; } }; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java index e1b306ea90..afd3adaacc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java @@ -72,7 +72,7 @@ public class RefSpec implements Serializable { * ref spec component - string to test. Can be null. * @return true if provided string is a wildcard ref spec component. */ - public static boolean isWildcard(final String s) { + public static boolean isWildcard(String s) { return s != null && s.contains("*"); //$NON-NLS-1$ } @@ -222,11 +222,11 @@ public class RefSpec implements Serializable { * @throws java.lang.IllegalArgumentException * the specification is invalid. */ - public RefSpec(final String spec) { + public RefSpec(String spec) { this(spec, WildcardMode.REQUIRE_MATCH); } - private RefSpec(final RefSpec p) { + private RefSpec(RefSpec p) { force = p.isForceUpdate(); wildcard = p.isWildcard(); srcName = p.getSource(); @@ -250,7 +250,7 @@ public class RefSpec implements Serializable { * new value for force update in the returned instance. * @return a new RefSpec with force update as specified. */ - public RefSpec setForceUpdate(final boolean forceUpdate) { + public RefSpec setForceUpdate(boolean forceUpdate) { final RefSpec r = new RefSpec(this); r.force = forceUpdate; return r; @@ -293,7 +293,7 @@ public class RefSpec implements Serializable { * status of the existing destination disagrees with the * wildcard status of the new source. */ - public RefSpec setSource(final String source) { + public RefSpec setSource(String source) { final RefSpec r = new RefSpec(this); r.srcName = checkValid(source); if (isWildcard(r.srcName) && r.dstName == null) @@ -332,7 +332,7 @@ public class RefSpec implements Serializable { * of the existing source disagrees with the wildcard status of * the new destination. */ - public RefSpec setDestination(final String destination) { + public RefSpec setDestination(String destination) { final RefSpec r = new RefSpec(this); r.dstName = checkValid(destination); if (isWildcard(r.dstName) && r.srcName == null) @@ -372,7 +372,7 @@ public class RefSpec implements Serializable { * ref name that should be tested. * @return true if the names match; false otherwise. */ - public boolean matchSource(final String r) { + public boolean matchSource(String r) { return match(r, getSource()); } @@ -383,7 +383,7 @@ public class RefSpec implements Serializable { * ref whose name should be tested. * @return true if the names match; false otherwise. */ - public boolean matchSource(final Ref r) { + public boolean matchSource(Ref r) { return match(r.getName(), getSource()); } @@ -394,7 +394,7 @@ public class RefSpec implements Serializable { * ref name that should be tested. * @return true if the names match; false otherwise. */ - public boolean matchDestination(final String r) { + public boolean matchDestination(String r) { return match(r, getDestination()); } @@ -405,7 +405,7 @@ public class RefSpec implements Serializable { * ref whose name should be tested. * @return true if the names match; false otherwise. */ - public boolean matchDestination(final Ref r) { + public boolean matchDestination(Ref r) { return match(r.getName(), getDestination()); } @@ -425,7 +425,7 @@ public class RefSpec implements Serializable { * when the RefSpec was constructed with wildcard mode that * doesn't require matching wildcards. */ - public RefSpec expandFromSource(final String r) { + public RefSpec expandFromSource(String r) { if (allowMismatchedWildcards != WildcardMode.REQUIRE_MATCH) { throw new IllegalStateException( JGitText.get().invalidExpandWildcard); @@ -433,7 +433,7 @@ public class RefSpec implements Serializable { return isWildcard() ? new RefSpec(this).expandFromSourceImp(r) : this; } - private RefSpec expandFromSourceImp(final String name) { + private RefSpec expandFromSourceImp(String name) { final String psrc = srcName, pdst = dstName; wildcard = false; srcName = name; @@ -457,7 +457,7 @@ public class RefSpec implements Serializable { * when the RefSpec was constructed with wildcard mode that * doesn't require matching wildcards. */ - public RefSpec expandFromSource(final Ref r) { + public RefSpec expandFromSource(Ref r) { return expandFromSource(r.getName()); } @@ -477,7 +477,7 @@ public class RefSpec implements Serializable { * when the RefSpec was constructed with wildcard mode that * doesn't require matching wildcards. */ - public RefSpec expandFromDestination(final String r) { + public RefSpec expandFromDestination(String r) { if (allowMismatchedWildcards != WildcardMode.REQUIRE_MATCH) { throw new IllegalStateException( JGitText.get().invalidExpandWildcard); @@ -485,7 +485,7 @@ public class RefSpec implements Serializable { return isWildcard() ? new RefSpec(this).expandFromDstImp(r) : this; } - private RefSpec expandFromDstImp(final String name) { + private RefSpec expandFromDstImp(String name) { final String psrc = srcName, pdst = dstName; wildcard = false; srcName = expandWildcard(name, pdst, psrc); @@ -508,11 +508,11 @@ public class RefSpec implements Serializable { * when the RefSpec was constructed with wildcard mode that * doesn't require matching wildcards. */ - public RefSpec expandFromDestination(final Ref r) { + public RefSpec expandFromDestination(Ref r) { return expandFromDestination(r.getName()); } - private boolean match(final String name, final String s) { + private boolean match(String name, String s) { if (s == null) return false; if (isWildcard(s)) { @@ -541,7 +541,7 @@ public class RefSpec implements Serializable { return spec; } - private static boolean isValid(final String s) { + private static boolean isValid(String s) { if (s.startsWith("/")) //$NON-NLS-1$ return false; if (s.contains("//")) //$NON-NLS-1$ @@ -569,7 +569,7 @@ public class RefSpec implements Serializable { /** {@inheritDoc} */ @Override - public boolean equals(final Object obj) { + public boolean equals(Object obj) { if (!(obj instanceof RefSpec)) return false; final RefSpec b = (RefSpec) obj; @@ -584,7 +584,7 @@ public class RefSpec implements Serializable { return true; } - private static boolean eq(final String a, final String b) { + private static boolean eq(String a, String b) { if (a == b) return true; if (a == null || b == null) 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 7b882ec8d5..3569761175 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java @@ -112,7 +112,7 @@ public class RemoteConfig implements Serializable { * @throws java.net.URISyntaxException * one of the URIs within the remote's configuration is invalid. */ - public static List getAllRemoteConfigs(final Config rc) + public static List getAllRemoteConfigs(Config rc) throws URISyntaxException { final List names = new ArrayList<>(rc .getSubsections(SECTION)); @@ -160,7 +160,7 @@ public class RemoteConfig implements Serializable { * @throws java.net.URISyntaxException * one of the URIs within the remote's configuration is invalid. */ - public RemoteConfig(final Config rc, final String remoteName) + public RemoteConfig(Config rc, String remoteName) throws URISyntaxException { name = remoteName; @@ -223,7 +223,7 @@ public class RemoteConfig implements Serializable { * @param rc * the configuration file to store ourselves into. */ - public void update(final Config rc) { + public void update(Config rc) { final List vlst = new ArrayList<>(); vlst.clear(); @@ -277,7 +277,7 @@ public class RemoteConfig implements Serializable { rc.setInt(SECTION, getName(), key, currentValue); } - private void unset(final Config rc, final String key) { + private void unset(Config rc, String key) { rc.unset(SECTION, getName(), key); } @@ -335,7 +335,7 @@ public class RemoteConfig implements Serializable { * the new URI to add to this remote. * @return true if the URI was added; false if it already exists. */ - public boolean addURI(final URIish toAdd) { + public boolean addURI(URIish toAdd) { if (uris.contains(toAdd)) return false; return uris.add(toAdd); @@ -348,7 +348,7 @@ public class RemoteConfig implements Serializable { * the URI to remove from this remote. * @return true if the URI was added; false if it already exists. */ - public boolean removeURI(final URIish toRemove) { + public boolean removeURI(URIish toRemove) { return uris.remove(toRemove); } @@ -368,7 +368,7 @@ public class RemoteConfig implements Serializable { * the new URI to add to this remote. * @return true if the URI was added; false if it already exists. */ - public boolean addPushURI(final URIish toAdd) { + public boolean addPushURI(URIish toAdd) { if (pushURIs.contains(toAdd)) return false; return pushURIs.add(toAdd); @@ -381,7 +381,7 @@ public class RemoteConfig implements Serializable { * the URI to remove from this remote. * @return true if the URI was added; false if it already exists. */ - public boolean removePushURI(final URIish toRemove) { + public boolean removePushURI(URIish toRemove) { return pushURIs.remove(toRemove); } @@ -401,7 +401,7 @@ public class RemoteConfig implements Serializable { * the new specification to add. * @return true if the specification was added; false if it already exists. */ - public boolean addFetchRefSpec(final RefSpec s) { + public boolean addFetchRefSpec(RefSpec s) { if (fetch.contains(s)) return false; return fetch.add(s); @@ -414,7 +414,7 @@ public class RemoteConfig implements Serializable { * list of fetch specifications to set. List is copied, it can be * modified after this call. */ - public void setFetchRefSpecs(final List specs) { + public void setFetchRefSpecs(List specs) { fetch.clear(); fetch.addAll(specs); } @@ -426,7 +426,7 @@ public class RemoteConfig implements Serializable { * list of push specifications to set. List is copied, it can be * modified after this call. */ - public void setPushRefSpecs(final List specs) { + public void setPushRefSpecs(List specs) { push.clear(); push.addAll(specs); } @@ -438,7 +438,7 @@ public class RemoteConfig implements Serializable { * the specification to remove. * @return true if the specification existed and was removed. */ - public boolean removeFetchRefSpec(final RefSpec s) { + public boolean removeFetchRefSpec(RefSpec s) { return fetch.remove(s); } @@ -458,7 +458,7 @@ public class RemoteConfig implements Serializable { * the new specification to add. * @return true if the specification was added; false if it already exists. */ - public boolean addPushRefSpec(final RefSpec s) { + public boolean addPushRefSpec(RefSpec s) { if (push.contains(s)) return false; return push.add(s); @@ -471,7 +471,7 @@ public class RemoteConfig implements Serializable { * the specification to remove. * @return true if the specification existed and was removed. */ - public boolean removePushRefSpec(final RefSpec s) { + public boolean removePushRefSpec(RefSpec s) { return push.remove(s); } @@ -520,7 +520,7 @@ public class RemoteConfig implements Serializable { * @param option * method to use when handling annotated tags. */ - public void setTagOpt(final TagOpt option) { + public void setTagOpt(TagOpt option) { tagopt = option != null ? option : TagOpt.AUTO_FOLLOW; } @@ -541,7 +541,7 @@ public class RemoteConfig implements Serializable { * @param m * true to automatically delete remote refs during push. */ - public void setMirror(final boolean m) { + public void setMirror(boolean m) { mirror = m; } @@ -562,7 +562,7 @@ public class RemoteConfig implements Serializable { * before aborting an IO read or write operation with this * remote. A timeout of 0 will block indefinitely. */ - public void setTimeout(final int seconds) { + public void setTimeout(int seconds) { timeout = seconds; } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java index 3e9b16ee49..2849afe20d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java @@ -501,7 +501,7 @@ public class RemoteRefUpdate { * @throws java.io.IOException * when I/O error occurred during update */ - protected void updateTrackingRef(final RevWalk walk) throws IOException { + protected void updateTrackingRef(RevWalk walk) throws IOException { if (isDelete()) trackingRefUpdate.setResult(localUpdate.delete(walk)); else diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandInputStream.java index 15338a3a3a..3100cb444a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandInputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandInputStream.java @@ -133,7 +133,7 @@ public class SideBandInputStream extends InputStream { /** {@inheritDoc} */ @Override - public int read(final byte[] b, int off, int len) throws IOException { + public int read(byte[] b, int off, int len) throws IOException { int r = 0; while (len > 0) { needDataPacket(); @@ -203,7 +203,7 @@ public class SideBandInputStream extends InputStream { progressBuffer = pkt; } - private void doProgressLine(final String msg) throws IOException { + private void doProgressLine(String msg) throws IOException { Matcher matcher; matcher = P_BOUNDED.matcher(msg); @@ -239,7 +239,7 @@ public class SideBandInputStream extends InputStream { out.write(msg.getBytes()); } - private void beginTask(final int totalWorkUnits) { + private void beginTask(int totalWorkUnits) { monitor.beginTask(remote(currentTask), totalWorkUnits); } @@ -254,7 +254,7 @@ public class SideBandInputStream extends InputStream { return r.toString(); } - private String readString(final int len) throws IOException { + private String readString(int len) throws IOException { final byte[] raw = new byte[len]; IO.readFully(rawIn, raw, 0, len); return RawParseUtils.decode(Constants.CHARSET, raw, 0, len); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandOutputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandOutputStream.java index af65827ca6..b2cc1b6d9e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandOutputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandOutputStream.java @@ -102,7 +102,7 @@ public class SideBandOutputStream extends OutputStream { * stream that the packets are written onto. This stream should * be attached to a SideBandInputStream on the remote side. */ - public SideBandOutputStream(final int chan, final int sz, final OutputStream os) { + public SideBandOutputStream(int chan, int sz, OutputStream os) { if (chan <= 0 || chan > 255) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().channelMustBeInRange1_255, @@ -136,7 +136,7 @@ public class SideBandOutputStream extends OutputStream { /** {@inheritDoc} */ @Override - public void write(final byte[] b, int off, int len) throws IOException { + public void write(byte[] b, int off, int len) throws IOException { while (0 < len) { int capacity = buffer.length - cnt; if (cnt == HDR_SIZE && capacity < len) { @@ -163,7 +163,7 @@ public class SideBandOutputStream extends OutputStream { /** {@inheritDoc} */ @Override - public void write(final int b) throws IOException { + public void write(int b) throws IOException { if (cnt == buffer.length) writeBuffer(); buffer[cnt++] = (byte) b; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java index e0022333ef..ae357dfb75 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java @@ -80,7 +80,7 @@ public abstract class SshSessionFactory { * factory for future sessions to be created through. If null the * default factory will be restored.s */ - public static void setInstance(final SshSessionFactory newFactory) { + public static void setInstance(SshSessionFactory newFactory) { if (newFactory != null) INSTANCE = newFactory; else @@ -121,7 +121,7 @@ public abstract class SshSessionFactory { * {@link #getSession(URIish, CredentialsProvider, FS, int)} * method. */ - public void releaseSession(final RemoteSession session) { + public void releaseSession(RemoteSession session) { session.disconnect(); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java index e1134e8fa8..eae8aa06d7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java @@ -84,7 +84,7 @@ public enum TagOpt { private final String option; - private TagOpt(final String o) { + private TagOpt(String o) { option = o; } @@ -104,7 +104,7 @@ public enum TagOpt { * the configuration file text value. * @return the option that matches the passed parameter. */ - public static TagOpt fromOption(final String o) { + public static TagOpt fromOption(String o) { if (o == null || o.length() == 0) return AUTO_FOLLOW; for (final TagOpt tagopt : values()) { 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 77a4d92ab3..0336f47731 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java @@ -271,7 +271,7 @@ public abstract class Transport implements AutoCloseable { * @throws org.eclipse.jgit.errors.TransportException * the transport cannot open this URI. */ - public static Transport open(final Repository local, final String remote) + public static Transport open(Repository local, String remote) throws NotSupportedException, URISyntaxException, TransportException { return open(local, remote, Operation.FETCH); @@ -393,7 +393,7 @@ public abstract class Transport implements AutoCloseable { * if provided remote configuration doesn't have any URI * associated. */ - public static Transport open(final Repository local, final RemoteConfig cfg) + public static Transport open(Repository local, RemoteConfig cfg) throws NotSupportedException, TransportException { return open(local, cfg, Operation.FETCH); } @@ -502,7 +502,7 @@ public abstract class Transport implements AutoCloseable { } } - private static boolean doesNotExist(final RemoteConfig cfg) { + private static boolean doesNotExist(RemoteConfig cfg) { return cfg.getURIs().isEmpty() && cfg.getPushURIs().isEmpty(); } @@ -519,7 +519,7 @@ public abstract class Transport implements AutoCloseable { * @throws org.eclipse.jgit.errors.TransportException * the transport cannot open this URI. */ - public static Transport open(final Repository local, final URIish uri) + public static Transport open(Repository local, URIish uri) throws NotSupportedException, TransportException { return open(local, uri, null); } @@ -818,7 +818,7 @@ public abstract class Transport implements AutoCloseable { * the URI used to access the remote repository. This must be the * URI passed to {@link #open(Repository, URIish)}. */ - protected Transport(final Repository local, final URIish uri) { + protected Transport(Repository local, URIish uri) { final TransferConfig tc = local.getConfig().get(TransferConfig.KEY); this.local = local; this.uri = uri; @@ -833,7 +833,7 @@ public abstract class Transport implements AutoCloseable { * @param uri * a {@link org.eclipse.jgit.transport.URIish} object. */ - protected Transport(final URIish uri) { + protected Transport(URIish uri) { this.uri = uri; this.local = null; this.objectChecker = new ObjectChecker(); @@ -866,7 +866,7 @@ public abstract class Transport implements AutoCloseable { * @param where * name of the executable. */ - public void setOptionUploadPack(final String where) { + public void setOptionUploadPack(String where) { if (where != null && where.length() > 0) optionUploadPack = where; else @@ -888,7 +888,7 @@ public abstract class Transport implements AutoCloseable { * @param option * method to use when handling annotated tags. */ - public void setTagOpt(final TagOpt option) { + public void setTagOpt(TagOpt option) { tagopt = option != null ? option : TagOpt.AUTO_FOLLOW; } @@ -912,7 +912,7 @@ public abstract class Transport implements AutoCloseable { * when it shouldn't * @see PackTransport */ - public void setFetchThin(final boolean fetchThin) { + public void setFetchThin(boolean fetchThin) { this.fetchThin = fetchThin; } @@ -935,7 +935,7 @@ public abstract class Transport implements AutoCloseable { * received objects are valid. * @see #setObjectChecker(ObjectChecker) */ - public void setCheckFetchedObjects(final boolean check) { + public void setCheckFetchedObjects(boolean check) { if (check && objectChecker == null) setObjectChecker(new ObjectChecker()); else if (!check && objectChecker != null) @@ -1010,7 +1010,7 @@ public abstract class Transport implements AutoCloseable { * false when it shouldn't * @see PackTransport */ - public void setPushThin(final boolean pushThin) { + public void setPushThin(boolean pushThin) { this.pushThin = pushThin; } @@ -1035,7 +1035,7 @@ public abstract class Transport implements AutoCloseable { * @see PackTransport * @since 4.2 */ - public void setPushAtomic(final boolean atomic) { + public void setPushAtomic(boolean atomic) { this.pushAtomic = atomic; } @@ -1062,7 +1062,7 @@ public abstract class Transport implements AutoCloseable { * * @param remove true to remove refs that no longer exist. */ - public void setRemoveDeletedRefs(final boolean remove) { + public void setRemoveDeletedRefs(boolean remove) { removeDeletedRefs = remove; } @@ -1079,7 +1079,7 @@ public abstract class Transport implements AutoCloseable { * @param bytes exclude blobs of size greater than this * @since 5.0 */ - public void setFilterBlobLimit(final long bytes) { + public void setFilterBlobLimit(long bytes) { filterBlobLimit = bytes; } @@ -1089,7 +1089,7 @@ public abstract class Transport implements AutoCloseable { * @param cfg * configuration to apply on this transport. */ - public void applyConfig(final RemoteConfig cfg) { + public void applyConfig(RemoteConfig cfg) { setOptionUploadPack(cfg.getUploadPack()); setOptionReceivePack(cfg.getReceivePack()); setTagOpt(cfg.getTagOpt()); @@ -1118,7 +1118,7 @@ public abstract class Transport implements AutoCloseable { * and not really update remote refs, false otherwise - when push * should act normally. */ - public void setDryRun(final boolean dryRun) { + public void setDryRun(boolean dryRun) { this.dryRun = dryRun; } @@ -1139,7 +1139,7 @@ public abstract class Transport implements AutoCloseable { * before aborting an IO read or write operation with this * remote. */ - public void setTimeout(final int seconds) { + public void setTimeout(int seconds) { timeout = seconds; } @@ -1206,7 +1206,7 @@ public abstract class Transport implements AutoCloseable { * null if push options are unsupported * @since 4.5 */ - public void setPushOptions(final List pushOptions) { + public void setPushOptions(List pushOptions) { this.pushOptions = pushOptions; } 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 ac68ba2fdd..9ddfc46667 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java @@ -323,7 +323,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { return avail; } - private void readLooseRefs(final TreeMap avail) + private void readLooseRefs(TreeMap avail) throws TransportException { try { for (final String n : s3.list(bucket, resolveKey(ROOT_DIR @@ -334,7 +334,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { } } - private Ref readRef(final TreeMap avail, final String rn) + private Ref readRef(TreeMap avail, String rn) throws TransportException { final String s; String ref = ROOT_DIR + rn; @@ -374,7 +374,7 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { throw new TransportException(getURI(), MessageFormat.format(JGitText.get().transportExceptionBadRef, rn, s)); } - private Storage loose(final Ref r) { + private Storage loose(Ref r) { if (r != null && r.getStorage() == Storage.PACKED) return Storage.LOOSE_PACKED; return Storage.LOOSE; 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 87c328f452..7fb206003c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java @@ -298,7 +298,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, * @throws org.eclipse.jgit.errors.NotSupportedException * @since 4.9 */ - protected void setURI(final URIish uri) throws NotSupportedException { + protected void setURI(URIish uri) throws NotSupportedException { try { currentUri = uri; baseUrl = toURL(uri); @@ -332,7 +332,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, * @param on * if {@code true} (default), smart HTTP is enabled. */ - public void setUseSmartHttp(final boolean on) { + public void setUseSmartHttp(boolean on) { useSmartHttp = on; } @@ -483,7 +483,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, this.headers = headers; } - private HttpConnection connect(final String service) + private HttpConnection connect(String service) throws TransportException, NotSupportedException { URL u = getServiceURL(service); int authAttempts = 1; @@ -775,7 +775,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, return true; } - private URL getServiceURL(final String service) + private URL getServiceURL(String service) throws NotSupportedException { try { final StringBuilder b = new StringBuilder(); @@ -861,18 +861,18 @@ public class TransportHttp extends HttpTransport implements WalkTransport, return new TransportException(uri, why); } - private boolean isSmartHttp(final HttpConnection c, final String service) { + private boolean isSmartHttp(HttpConnection c, String service) { final String expType = "application/x-" + service + "-advertisement"; //$NON-NLS-1$ //$NON-NLS-2$ final String actType = c.getContentType(); return expType.equals(actType); } - private boolean isGzipContent(final HttpConnection c) { + private boolean isGzipContent(HttpConnection c) { return ENCODING_GZIP.equals(c.getHeaderField(HDR_CONTENT_ENCODING)) || ENCODING_X_GZIP.equals(c.getHeaderField(HDR_CONTENT_ENCODING)); } - private void readSmartHeaders(final InputStream in, final String service) + private void readSmartHeaders(InputStream in, String service) throws IOException { // A smart reply will have a '#' after the first 4 bytes, but // a dumb reply cannot contain a '#' until after byte 41. Do a @@ -1030,15 +1030,15 @@ public class TransportHttp extends HttpTransport implements WalkTransport, return avail; } - private PackProtocolException outOfOrderAdvertisement(final String n) { + private PackProtocolException outOfOrderAdvertisement(String n) { return new PackProtocolException(MessageFormat.format(JGitText.get().advertisementOfCameBefore, n, n)); } - private PackProtocolException invalidAdvertisement(final String n) { + private PackProtocolException invalidAdvertisement(String n) { return new PackProtocolException(MessageFormat.format(JGitText.get().invalidAdvertisementOf, n)); } - private PackProtocolException duplicateAdvertisement(final String n) { + private PackProtocolException duplicateAdvertisement(String n) { return new PackProtocolException(MessageFormat.format(JGitText.get().duplicateAdvertisementsOf, n)); } 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 4f1880b7ef..648eaa3cfa 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java @@ -229,7 +229,7 @@ class TransportLocal extends Transport implements PackTransport { * @throws org.eclipse.jgit.errors.TransportException * if any. */ - protected Process spawn(final String cmd) + protected Process spawn(String cmd) throws TransportException { try { String[] args = { "." }; //$NON-NLS-1$ 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 09cd67b515..aa5ee7a3d5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java @@ -261,7 +261,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { Collections.sort(packs, new Comparator() { @Override - public int compare(final String o1, final String o2) { + public int compare(String o1, String o2) { return mtimes.get(o2).intValue() - mtimes.get(o1).intValue(); } @@ -464,7 +464,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { MessageFormat.format(JGitText.get().badRef, name, line)); } - private Storage loose(final Ref r) { + private Storage loose(Ref r) { if (r != null && r.getStorage() == Storage.PACKED) return Storage.LOOSE_PACKED; return Storage.LOOSE; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java index a048fe30f2..026fd819c4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java @@ -387,7 +387,7 @@ public class URIish implements Serializable { * @param u * the source URL to convert from. */ - public URIish(final URL u) { + public URIish(URL u) { scheme = u.getProtocol(); path = u.getPath(); path = cleanLeadingSlashes(path, scheme); @@ -416,7 +416,7 @@ public class URIish implements Serializable { // Configure nothing. } - private URIish(final URIish u) { + private URIish(URIish u) { this.scheme = u.scheme; this.rawPath = u.rawPath; this.path = u.path; @@ -451,7 +451,7 @@ public class URIish implements Serializable { * the new value for host. * @return a new URI with the updated value. */ - public URIish setHost(final String n) { + public URIish setHost(String n) { final URIish r = new URIish(this); r.host = n; return r; @@ -473,7 +473,7 @@ public class URIish implements Serializable { * the new value for scheme. * @return a new URI with the updated value. */ - public URIish setScheme(final String n) { + public URIish setScheme(String n) { final URIish r = new URIish(this); r.scheme = n; return r; @@ -504,7 +504,7 @@ public class URIish implements Serializable { * the new value for path. * @return a new URI with the updated value. */ - public URIish setPath(final String n) { + public URIish setPath(String n) { final URIish r = new URIish(this); r.path = n; r.rawPath = n; @@ -519,7 +519,7 @@ public class URIish implements Serializable { * @return a new URI with the updated value. * @throws java.net.URISyntaxException */ - public URIish setRawPath(final String n) throws URISyntaxException { + public URIish setRawPath(String n) throws URISyntaxException { final URIish r = new URIish(this); r.path = unescape(n); r.rawPath = n; @@ -542,7 +542,7 @@ public class URIish implements Serializable { * the new value for user. * @return a new URI with the updated value. */ - public URIish setUser(final String n) { + public URIish setUser(String n) { final URIish r = new URIish(this); r.user = n; return r; @@ -564,7 +564,7 @@ public class URIish implements Serializable { * the new value for password. * @return a new URI with the updated value. */ - public URIish setPass(final String n) { + public URIish setPass(String n) { final URIish r = new URIish(this); r.pass = n; return r; @@ -586,7 +586,7 @@ public class URIish implements Serializable { * the new value for port. * @return a new URI with the updated value. */ - public URIish setPort(final int n) { + public URIish setPort(int n) { final URIish r = new URIish(this); r.port = n > 0 ? n : -1; return r; @@ -613,7 +613,7 @@ public class URIish implements Serializable { /** {@inheritDoc} */ @Override - public boolean equals(final Object obj) { + public boolean equals(Object obj) { if (!(obj instanceof URIish)) return false; final URIish b = (URIish) obj; @@ -632,7 +632,7 @@ public class URIish implements Serializable { return true; } - private static boolean eq(final String a, final String b) { + private static boolean eq(String a, String b) { if (a == b) return true; if (StringUtils.isEmptyOrNull(a) && StringUtils.isEmptyOrNull(b)) @@ -657,7 +657,7 @@ public class URIish implements Serializable { return format(false, false); } - private String format(final boolean includePassword, boolean escapeNonAscii) { + private String format(boolean includePassword, boolean escapeNonAscii) { final StringBuilder r = new StringBuilder(); if (getScheme() != null) { r.append(getScheme()); 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 b1832fd026..393b3aa1a7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -344,7 +344,7 @@ public class UploadPack { * @param copyFrom * the source repository. */ - public UploadPack(final Repository copyFrom) { + public UploadPack(Repository copyFrom) { db = copyFrom; walk = new RevWalk(db); walk.setRetainBody(false); @@ -433,7 +433,7 @@ public class UploadPack { * before aborting an IO read or write operation with the * connected client. */ - public void setTimeout(final int seconds) { + public void setTimeout(int seconds) { timeout = seconds; } @@ -460,7 +460,7 @@ public class UploadPack { * commands before writing output and does not perform the * initial advertising. */ - public void setBiDirectionalPipe(final boolean twoWay) { + public void setBiDirectionalPipe(boolean twoWay) { biDirectionalPipe = twoWay; } @@ -563,7 +563,7 @@ public class UploadPack { * @param advertiseRefsHook * the hook; may be null to show all refs. */ - public void setAdvertiseRefsHook(final AdvertiseRefsHook advertiseRefsHook) { + public void setAdvertiseRefsHook(AdvertiseRefsHook advertiseRefsHook) { if (advertiseRefsHook != null) this.advertiseRefsHook = advertiseRefsHook; else @@ -582,7 +582,7 @@ public class UploadPack { * @param refFilter * the filter; may be null to show all refs. */ - public void setRefFilter(final RefFilter refFilter) { + public void setRefFilter(RefFilter refFilter) { this.refFilter = refFilter != null ? refFilter : RefFilter.DEFAULT; } @@ -1140,7 +1140,7 @@ public class UploadPack { * @throws org.eclipse.jgit.transport.ServiceMayNotContinueException * the hook denied advertisement. */ - public void sendAdvertisedRefs(final RefAdvertiser adv) throws IOException, + public void sendAdvertisedRefs(RefAdvertiser adv) throws IOException, ServiceMayNotContinueException { try { advertiseRefsHook.advertiseRefs(this); @@ -1684,7 +1684,7 @@ public class UploadPack { } } - private void addCommonBase(final RevObject o) { + private void addCommonBase(RevObject o) { if (!o.has(COMMON)) { o.add(COMMON); commonBase.add(o); @@ -1713,7 +1713,7 @@ public class UploadPack { } } - private boolean wantSatisfied(final RevObject want) throws IOException { + private boolean wantSatisfied(RevObject want) throws IOException { if (want.has(SATISFIED)) return true; 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 b8f8d97beb..9b6f458994 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java @@ -256,7 +256,7 @@ class WalkFetchConnection extends BaseFetchConnection { /** {@inheritDoc} */ @Override - public void setPackLockMessage(final String message) { + public void setPackLockMessage(String message) { lockMessage = message; } @@ -273,7 +273,7 @@ class WalkFetchConnection extends BaseFetchConnection { r.close(); } - private void queueWants(final Collection want) + private void queueWants(Collection want) throws TransportException { final HashSet inWorkQueue = new HashSet<>(); for (final Ref r : want) { @@ -299,7 +299,7 @@ class WalkFetchConnection extends BaseFetchConnection { } } - private void process(final ObjectId id) throws TransportException { + private void process(ObjectId id) throws TransportException { final RevObject obj; try { if (id instanceof RevObject) { @@ -339,7 +339,7 @@ class WalkFetchConnection extends BaseFetchConnection { fetchErrors.remove(id); } - private void processBlob(final RevObject obj) throws TransportException { + private void processBlob(RevObject obj) throws TransportException { try { if (reader.has(obj, Constants.OBJ_BLOB)) obj.add(COMPLETE); @@ -353,7 +353,7 @@ class WalkFetchConnection extends BaseFetchConnection { } } - private void processTree(final RevObject obj) throws TransportException { + private void processTree(RevObject obj) throws TransportException { try { treeWalk.reset(obj); while (treeWalk.next()) { @@ -381,7 +381,7 @@ class WalkFetchConnection extends BaseFetchConnection { obj.add(COMPLETE); } - private void processCommit(final RevObject obj) throws TransportException { + private void processCommit(RevObject obj) throws TransportException { final RevCommit commit = (RevCommit) obj; markLocalCommitsComplete(commit.getCommitTime()); needs(commit.getTree()); @@ -390,13 +390,13 @@ class WalkFetchConnection extends BaseFetchConnection { obj.add(COMPLETE); } - private void processTag(final RevObject obj) { + private void processTag(RevObject obj) { final RevTag tag = (RevTag) obj; needs(tag.getObject()); obj.add(COMPLETE); } - private void needs(final RevObject obj) { + private void needs(RevObject obj) { if (obj.has(COMPLETE)) return; if (!obj.has(IN_WORK_QUEUE)) { @@ -405,7 +405,7 @@ class WalkFetchConnection extends BaseFetchConnection { } } - private void downloadObject(final ProgressMonitor pm, final AnyObjectId id) + private void downloadObject(ProgressMonitor pm, AnyObjectId id) throws TransportException { if (alreadyHave(id)) return; @@ -495,7 +495,7 @@ class WalkFetchConnection extends BaseFetchConnection { } } - private boolean alreadyHave(final AnyObjectId id) throws TransportException { + private boolean alreadyHave(AnyObjectId id) throws TransportException { try { return reader.has(id); } catch (IOException error) { @@ -686,7 +686,7 @@ class WalkFetchConnection extends BaseFetchConnection { return null; } - private void markLocalRefsComplete(final Set have) throws TransportException { + private void markLocalRefsComplete(Set have) throws TransportException { List refs; try { refs = local.getRefDatabase().getRefs(); @@ -729,7 +729,7 @@ class WalkFetchConnection extends BaseFetchConnection { } } - private void markLocalCommitsComplete(final int until) + private void markLocalCommitsComplete(int until) throws TransportException { try { for (;;) { @@ -747,7 +747,7 @@ class WalkFetchConnection extends BaseFetchConnection { } } - private void pushLocalCommit(final RevCommit p) + private void pushLocalCommit(RevCommit p) throws MissingObjectException, IOException { if (p.has(LOCALLY_SEEN)) return; @@ -758,7 +758,7 @@ class WalkFetchConnection extends BaseFetchConnection { localCommitQueue.add(p); } - private void markTreeComplete(final RevTree tree) throws IOException { + private void markTreeComplete(RevTree tree) throws IOException { if (tree.has(COMPLETE)) return; tree.add(COMPLETE); @@ -792,7 +792,7 @@ class WalkFetchConnection extends BaseFetchConnection { } } - private void recordError(final AnyObjectId id, final Throwable what) { + private void recordError(AnyObjectId id, Throwable what) { final ObjectId objId = id.copy(); List errors = fetchErrors.get(objId); if (errors == null) { 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 cf50c51d5d..5cc616ed3b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java @@ -295,7 +295,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { } } - private void safeDelete(final String path) { + private void safeDelete(String path) { if (path != null) { try { dest.deleteFile(path); @@ -307,7 +307,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { } } - private void deleteCommand(final RemoteRefUpdate u) { + private void deleteCommand(RemoteRefUpdate u) { final Ref r = newRefs.remove(u.getRemoteName()); if (r == null) { // Already gone. @@ -337,7 +337,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { } } - private void updateCommand(final RemoteRefUpdate u) { + private void updateCommand(RemoteRefUpdate u) { try { dest.writeRef(u.getRemoteName(), u.getNewObjectId()); newRefs.put(u.getRemoteName(), new ObjectIdRef.Unpeeled( @@ -354,7 +354,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { && packNames.isEmpty(); } - private void createNewRepository(final List updates) + private void createNewRepository(List updates) throws TransportException { try { final String ref = "ref: " + pickHEAD(updates) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ @@ -374,7 +374,7 @@ class WalkPushConnection extends BaseConnection implements PushConnection { } } - private static String pickHEAD(final List updates) { + private static String pickHEAD(List updates) { // Try to use master if the user is pushing that, it is the // default branch and is likely what they want to remain as // the default on the new remote. 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 965be509cd..dde7b08154 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java @@ -414,7 +414,7 @@ abstract class WalkRemoteObjectDatabase { * @throws org.eclipse.jgit.errors.TransportException * an error occurred reading from the packed refs file. */ - protected void readPackedRefs(final Map avail) + protected void readPackedRefs(Map avail) throws TransportException { try (BufferedReader br = openReader(ROOT_DIR + Constants.PACKED_REFS)) { readPackedRefsImpl(avail, br); 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 16a6f4ab73..60acd2f8ae 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 @@ -87,7 +87,7 @@ public class FileResolver implements RepositoryResolver { * if true, exports all repositories, ignoring the check for the * {@code git-daemon-export-ok} files. */ - public FileResolver(final File basePath, final boolean exportAll) { + public FileResolver(File basePath, boolean exportAll) { this(); exportDirectory(basePath); setExportAll(exportAll); @@ -95,7 +95,7 @@ public class FileResolver implements RepositoryResolver { /** {@inheritDoc} */ @Override - public Repository open(final C req, final String name) + public Repository open(C req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { if (isUnreasonableName(name)) throw new RepositoryNotFoundException(name); @@ -175,7 +175,7 @@ public class FileResolver implements RepositoryResolver { * * @param export a boolean. */ - public void setExportAll(final boolean export) { + public void setExportAll(boolean export) { exportAll = export; } @@ -202,7 +202,7 @@ public class FileResolver implements RepositoryResolver { * git repository, but any directory below it which has a file * named git-daemon-export-ok will be published. */ - public void exportDirectory(final File dir) { + public void exportDirectory(File dir) { exportBase.add(dir); } @@ -240,7 +240,7 @@ public class FileResolver implements RepositoryResolver { return name + Constants.DOT_GIT_EXT; } - private static boolean isUnreasonableName(final String name) { + private static boolean isUnreasonableName(String name) { if (name.length() == 0) return true; // no empty paths diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java index a7900f0b67..ad409f6d6f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java @@ -176,7 +176,7 @@ public abstract class AbstractTreeIterator { * root of the repository. A trailing slash ('/') is * automatically appended if the prefix does not end in '/'. */ - protected AbstractTreeIterator(final String prefix) { + protected AbstractTreeIterator(String prefix) { parent = null; if (prefix != null && prefix.length() > 0) { @@ -210,7 +210,7 @@ public abstract class AbstractTreeIterator { * root of the repository. A trailing slash ('/') is * automatically appended if the prefix does not end in '/'. */ - protected AbstractTreeIterator(final byte[] prefix) { + protected AbstractTreeIterator(byte[] prefix) { parent = null; if (prefix != null && prefix.length > 0) { @@ -232,7 +232,7 @@ public abstract class AbstractTreeIterator { * @param p * parent tree iterator. */ - protected AbstractTreeIterator(final AbstractTreeIterator p) { + protected AbstractTreeIterator(AbstractTreeIterator p) { parent = p; path = p.path; pathOffset = p.pathLen + 1; @@ -275,7 +275,7 @@ public abstract class AbstractTreeIterator { * number of live bytes in the path buffer. This many bytes will * be moved into the larger buffer. */ - protected void growPath(final int len) { + protected void growPath(int len) { setPathCapacity(path.length << 1, len); } @@ -287,7 +287,7 @@ public abstract class AbstractTreeIterator { * @param len * the amount of live bytes in path buffer */ - protected void ensurePathCapacity(final int capacity, final int len) { + protected void ensurePathCapacity(int capacity, int len) { if (path.length >= capacity) return; final byte[] o = path; @@ -322,7 +322,7 @@ public abstract class AbstractTreeIterator { * @return -1 if this entry sorts first; 0 if the entries are equal; 1 if * p's entry sorts first. */ - public int pathCompare(final AbstractTreeIterator p) { + public int pathCompare(AbstractTreeIterator p) { return pathCompare(p, p.mode); } @@ -420,7 +420,7 @@ public abstract class AbstractTreeIterator { * the other iterator to test against. * @return true if both iterators have the same object id; false otherwise. */ - public boolean idEqual(final AbstractTreeIterator otherIterator) { + public boolean idEqual(AbstractTreeIterator otherIterator) { return ObjectId.equals(idBuffer(), idOffset(), otherIterator.idBuffer(), otherIterator.idOffset()); } @@ -447,7 +447,7 @@ public abstract class AbstractTreeIterator { * @param out * buffer to copy the object id into. */ - public void getEntryObjectId(final MutableObjectId out) { + public void getEntryObjectId(MutableObjectId out) { out.fromRaw(idBuffer(), idOffset()); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java index 71113a661a..019968875d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java @@ -119,7 +119,7 @@ public class CanonicalTreeParser extends AbstractTreeIterator { reset(reader, treeId); } - private CanonicalTreeParser(final CanonicalTreeParser p) { + private CanonicalTreeParser(CanonicalTreeParser p) { super(p); } @@ -140,7 +140,7 @@ public class CanonicalTreeParser extends AbstractTreeIterator { * @param treeData * the raw tree content. */ - public void reset(final byte[] treeData) { + public void reset(byte[] treeData) { attributesNode = null; raw = treeData; prevPtr = -1; @@ -219,7 +219,7 @@ public class CanonicalTreeParser extends AbstractTreeIterator { * @throws java.io.IOException * a loose object or pack file could not be read. */ - public void reset(final ObjectReader reader, final AnyObjectId id) + public void reset(ObjectReader reader, AnyObjectId id) throws IncorrectObjectTypeException, IOException { reset(reader.open(id, OBJ_TREE).getCachedBytes()); } @@ -262,7 +262,7 @@ public class CanonicalTreeParser extends AbstractTreeIterator { /** {@inheritDoc} */ @Override - public CanonicalTreeParser createSubtreeIterator(final ObjectReader reader) + public CanonicalTreeParser createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException { return createSubtreeIterator(reader, new MutableObjectId()); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java index 596d3d0835..0639b0dbdd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java @@ -92,7 +92,7 @@ public class EmptyTreeIterator extends AbstractTreeIterator { /** {@inheritDoc} */ @Override - public AbstractTreeIterator createSubtreeIterator(final ObjectReader reader) + public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException { return new EmptyTreeIterator(this); } @@ -141,13 +141,13 @@ public class EmptyTreeIterator extends AbstractTreeIterator { /** {@inheritDoc} */ @Override - public void next(final int delta) throws CorruptObjectException { + public void next(int delta) throws CorruptObjectException { // Do nothing. } /** {@inheritDoc} */ @Override - public void back(final int delta) throws CorruptObjectException { + public void back(int delta) throws CorruptObjectException { // Do nothing. } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java index 06f53c2f3b..ccd5e70912 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java @@ -130,7 +130,7 @@ public class FileTreeIterator extends WorkingTreeIterator { * @param options * working tree options to be used */ - public FileTreeIterator(final File root, FS fs, WorkingTreeOptions options) { + public FileTreeIterator(File root, FS fs, WorkingTreeOptions options) { this(root, fs, options, DefaultFileModeStrategy.INSTANCE); } @@ -205,7 +205,7 @@ public class FileTreeIterator extends WorkingTreeIterator { /** {@inheritDoc} */ @Override - public AbstractTreeIterator createSubtreeIterator(final ObjectReader reader) + public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException { return new FileTreeIterator(this, ((FileEntry) current()).getFile(), fs, fileModeStrategy); } @@ -422,7 +422,7 @@ public class FileTreeIterator extends WorkingTreeIterator { /** {@inheritDoc} */ @Override - protected byte[] idSubmodule(final Entry e) { + protected byte[] idSubmodule(Entry e) { return idSubmodule(getDirectory(), e); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java index 5560f7750c..b0509705dd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java @@ -99,7 +99,7 @@ public class NameConflictTreeWalk extends TreeWalk { * @param repo * the repository the walker will obtain data from. */ - public NameConflictTreeWalk(final Repository repo) { + public NameConflictTreeWalk(Repository repo) { super(repo); } @@ -112,7 +112,7 @@ public class NameConflictTreeWalk extends TreeWalk { * the reader the walker will obtain tree data from. * @since 4.3 */ - public NameConflictTreeWalk(@Nullable Repository repo, final ObjectReader or) { + public NameConflictTreeWalk(@Nullable Repository repo, ObjectReader or) { super(repo, or); } @@ -122,7 +122,7 @@ public class NameConflictTreeWalk extends TreeWalk { * @param or * the reader the walker will obtain tree data from. */ - public NameConflictTreeWalk(final ObjectReader or) { + public NameConflictTreeWalk(ObjectReader or) { super(or); } @@ -222,11 +222,11 @@ public class NameConflictTreeWalk extends TreeWalk { return FileMode.GITLINK.equals(p.mode); } - private static boolean isTree(final AbstractTreeIterator p) { + private static boolean isTree(AbstractTreeIterator p) { return FileMode.TREE.equals(p.mode); } - private boolean skipEntry(final AbstractTreeIterator minRef) + private boolean skipEntry(AbstractTreeIterator minRef) throws CorruptObjectException { // A tree D/F may have been handled earlier. We need to // not report this path if it has already been reported. @@ -260,7 +260,7 @@ public class NameConflictTreeWalk extends TreeWalk { return false; } - private AbstractTreeIterator combineDF(final AbstractTreeIterator minRef) + private AbstractTreeIterator combineDF(AbstractTreeIterator minRef) throws CorruptObjectException { // Look for a possible D/F conflict forward in the tree(s) // as there may be a "$path/" which matches "$path". Make 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 41c016cff8..8db95da344 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java @@ -332,7 +332,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * ObjectReader will be created by the walker, and will be closed * when the walker is closed. */ - public TreeWalk(final Repository repo) { + public TreeWalk(Repository repo) { this(repo, repo.newObjectReader(), true); } @@ -348,7 +348,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * is not closed when the walker is closed. * @since 4.3 */ - public TreeWalk(final @Nullable Repository repo, final ObjectReader or) { + public TreeWalk(@Nullable Repository repo, ObjectReader or) { this(repo, or, false); } @@ -359,7 +359,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * the reader the walker will obtain tree data from. The reader * is not closed when the walker is closed. */ - public TreeWalk(final ObjectReader or) { + public TreeWalk(ObjectReader or) { this(null, or, false); } @@ -447,7 +447,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * @see org.eclipse.jgit.treewalk.filter.AndTreeFilter * @see org.eclipse.jgit.treewalk.filter.OrTreeFilter */ - public void setFilter(final TreeFilter newFilter) { + public void setFilter(TreeFilter newFilter) { filter = newFilter != null ? newFilter : TreeFilter.ALL; } @@ -475,7 +475,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * @param b * true to skip subtree nodes and only obtain files nodes. */ - public void setRecursive(final boolean b) { + public void setRecursive(boolean b) { recursive = b; } @@ -505,7 +505,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * true to get trees after their children. * @see #isPostOrderTraversal() */ - public void setPostOrderTraversal(final boolean b) { + public void setPostOrderTraversal(boolean b) { postOrderTraversal = b; } @@ -661,7 +661,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * @throws java.io.IOException * a loose object or pack file could not be read. */ - public void reset(final AnyObjectId id) throws MissingObjectException, + public void reset(AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { if (trees.length == 1) { AbstractTreeIterator o = trees[0]; @@ -702,7 +702,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * @throws java.io.IOException * a loose object or pack file could not be read. */ - public void reset(final AnyObjectId... ids) throws MissingObjectException, + public void reset(AnyObjectId... ids) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { final int oldLen = trees.length; final int newLen = ids.length; @@ -757,7 +757,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * @throws java.io.IOException * a loose object or pack file could not be read. */ - public int addTree(final AnyObjectId id) throws MissingObjectException, + public int addTree(AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { return addTree(parserFor(id)); } @@ -920,7 +920,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * @return mode bits for the current entry of the nth tree. * @see FileMode#fromBits(int) */ - public int getRawMode(final int nth) { + public int getRawMode(int nth) { final AbstractTreeIterator t = trees[nth]; return t.matches == currentHead ? t.mode : 0; } @@ -936,7 +936,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * tree to obtain the mode from. * @return mode for the current entry of the nth tree. */ - public FileMode getFileMode(final int nth) { + public FileMode getFileMode(int nth) { return FileMode.fromBits(getRawMode(nth)); } @@ -971,7 +971,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * @see #getObjectId(MutableObjectId, int) * @see #idEqual(int, int) */ - public ObjectId getObjectId(final int nth) { + public ObjectId getObjectId(int nth) { final AbstractTreeIterator t = trees[nth]; return t.matches == currentHead ? t.getEntryObjectId() : ObjectId .zeroId(); @@ -993,7 +993,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * tree to obtain the object identifier from. * @see #idEqual(int, int) */ - public void getObjectId(final MutableObjectId out, final int nth) { + public void getObjectId(MutableObjectId out, int nth) { final AbstractTreeIterator t = trees[nth]; if (t.matches == currentHead) t.getEntryObjectId(out); @@ -1012,7 +1012,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * getObjectId(nthA).equals(getObjectId(nthB)). * @see #getObjectId(int) */ - public boolean idEqual(final int nthA, final int nthB) { + public boolean idEqual(int nthA, int nthB) { final AbstractTreeIterator ch = currentHead; final AbstractTreeIterator a = trees[nthA]; final AbstractTreeIterator b = trees[nthB]; @@ -1110,7 +1110,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * again on this tree walk. * @since 4.7 */ - public int isPathMatch(final byte[] p, final int pLen) { + public int isPathMatch(byte[] p, int pLen) { final AbstractTreeIterator t = currentHead; final byte[] c = t.path; final int cLen = t.pathLen; @@ -1163,7 +1163,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * path; 1 if the current path is past p and p will never match * again on this tree walk. */ - public int isPathPrefix(final byte[] p, final int pLen) { + public int isPathPrefix(byte[] p, int pLen) { final AbstractTreeIterator t = currentHead; final byte[] c = t.path; final int cLen = t.pathLen; @@ -1213,7 +1213,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * @return true if p is suffix of the current path; * false if otherwise */ - public boolean isPathSuffix(final byte[] p, final int pLen) { + public boolean isPathSuffix(byte[] p, int pLen) { final AbstractTreeIterator t = currentHead; final byte[] c = t.path; final int cLen = t.pathLen; @@ -1370,7 +1370,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { currentHead = minRef; } - private CanonicalTreeParser parserFor(final AnyObjectId id) + private CanonicalTreeParser parserFor(AnyObjectId id) throws IncorrectObjectTypeException, IOException { final CanonicalTreeParser p = new CanonicalTreeParser(); p.reset(reader, id); 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 cb68cee7bd..44385eacb2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java @@ -211,7 +211,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { * @param p * parent tree iterator. */ - protected WorkingTreeIterator(final WorkingTreeIterator p) { + protected WorkingTreeIterator(WorkingTreeIterator p) { super(p); state = p.state; repository = p.repository; @@ -364,7 +364,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { private static final byte[] hblob = Constants .encodedTypeString(Constants.OBJ_BLOB); - private byte[] idBufferBlob(final Entry e) { + private byte[] idBufferBlob(Entry e) { try { final InputStream is = e.openInputStream(); if (is == null) @@ -422,7 +422,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { return filterClean(is, opType); } - private static void safeClose(final InputStream in) { + private static void safeClose(InputStream in) { try { in.close(); } catch (IOException err2) { @@ -540,7 +540,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { /** {@inheritDoc} */ @Override - public void next(final int delta) throws CorruptObjectException { + public void next(int delta) throws CorruptObjectException { ptr += delta; if (!eof()) { parseEntry(); @@ -549,7 +549,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { /** {@inheritDoc} */ @Override - public void back(final int delta) throws CorruptObjectException { + public void back(int delta) throws CorruptObjectException { ptr -= delta; parseEntry(); } @@ -654,7 +654,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { * @throws java.io.IOException * a relevant ignore rule file exists but cannot be read. */ - protected boolean isEntryIgnored(final int pLen) throws IOException { + protected boolean isEntryIgnored(int pLen) throws IOException { return isEntryIgnored(pLen, mode); } @@ -669,7 +669,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { * @throws IOException * a relevant ignore rule file exists but cannot be read. */ - private boolean isEntryIgnored(final int pLen, int fileMode) + private boolean isEntryIgnored(int pLen, int fileMode) throws IOException { // The ignore code wants path to start with a '/' if possible. // If we have the '/' in our path buffer because we are inside @@ -748,7 +748,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { * files in the subtree of the work tree this iterator operates * on */ - protected void init(final Entry[] list) { + protected void init(Entry[] list) { // Filter out nulls, . and .. as these are not valid tree entries, // also cache the encoded forms of the path names for efficient use // later on during sorting and iteration. @@ -830,7 +830,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { * an int. * @return true if different, false otherwise */ - public boolean isModeDifferent(final int rawMode) { + public boolean isModeDifferent(int rawMode) { // Determine difference in mode-bits of file and index-entry. In the // bitwise presentation of modeDiff we'll have a '1' when the two modes // differ at this position. @@ -984,7 +984,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { * available at this iterator's current entry * @return index file mode */ - public FileMode getIndexFileMode(final DirCacheIterator indexIter) { + public FileMode getIndexFileMode(DirCacheIterator indexIter) { final FileMode wtMode = getEntryFileMode(); if (indexIter == null) { return wtMode; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeOptions.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeOptions.java index 2dfb2033d0..846fb6e342 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeOptions.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeOptions.java @@ -74,7 +74,7 @@ public class WorkingTreeOptions { private final boolean dirNoGitLinks; - private WorkingTreeOptions(final Config rc) { + private WorkingTreeOptions(Config rc) { fileMode = rc.getBoolean(ConfigConstants.CONFIG_CORE_SECTION, ConfigConstants.CONFIG_KEY_FILEMODE, true); autoCRLF = rc.getEnum(ConfigConstants.CONFIG_CORE_SECTION, null, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java index 6d40a4eb51..62a5440aa2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java @@ -71,7 +71,7 @@ public abstract class AndTreeFilter extends TreeFilter { * second filter to test. * @return a filter that must match both input filters. */ - public static TreeFilter create(final TreeFilter a, final TreeFilter b) { + public static TreeFilter create(TreeFilter a, TreeFilter b) { if (a == ALL) return b; if (b == ALL) @@ -87,7 +87,7 @@ public abstract class AndTreeFilter extends TreeFilter { * filters. * @return a filter that must match all input filters. */ - public static TreeFilter create(final TreeFilter[] list) { + public static TreeFilter create(TreeFilter[] list) { if (list.length == 2) return create(list[0], list[1]); if (list.length < 2) @@ -105,7 +105,7 @@ public abstract class AndTreeFilter extends TreeFilter { * filters. * @return a filter that must match all input filters. */ - public static TreeFilter create(final Collection list) { + public static TreeFilter create(Collection list) { if (list.size() < 2) throw new IllegalArgumentException(JGitText.get().atLeastTwoFiltersNeeded); final TreeFilter[] subfilters = new TreeFilter[list.size()]; @@ -126,7 +126,7 @@ public abstract class AndTreeFilter extends TreeFilter { } @Override - public boolean include(final TreeWalk walker) + public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { return matchFilter(walker) <= 0; @@ -175,7 +175,7 @@ public abstract class AndTreeFilter extends TreeFilter { } @Override - public boolean include(final TreeWalk walker) + public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { return matchFilter(walker) <= 0; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java index 653786b7ae..0a3b7d02d4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java @@ -77,7 +77,7 @@ class ByteArraySet { initTable(1 << Integer.highestOneBit((capacity * 2) - 1)); } - private byte[] get(final byte[] toFind, int length, int hash) { + private byte[] get(byte[] toFind, int length, int hash) { final int msk = mask; int i = hash & msk; final byte[][] tbl = table; @@ -180,7 +180,7 @@ class ByteArraySet { return size == 0; } - private void insert(final byte[] newValue, int hash) { + private void insert(byte[] newValue, int hash) { final int msk = mask; int j = hash & msk; final byte[][] tbl = table; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilter.java index 81b8e6d148..338ee2b27a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilter.java @@ -63,7 +63,7 @@ public final class InterIndexDiffFilter extends TreeFilter { /** {@inheritDoc} */ @Override - public boolean include(final TreeWalk walker) { + public boolean include(TreeWalk walker) { final int n = walker.getTreeCount(); if (n == 1) // Assume they meant difference to empty tree. return true; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotIgnoredFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotIgnoredFilter.java index 3403c78578..6090508a44 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotIgnoredFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotIgnoredFilter.java @@ -62,7 +62,7 @@ public class NotIgnoredFilter extends TreeFilter { * @param workdirTreeIndex * index of the workdir tree in the tree walk */ - public NotIgnoredFilter(final int workdirTreeIndex) { + public NotIgnoredFilter(int workdirTreeIndex) { this.index = workdirTreeIndex; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotTreeFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotTreeFilter.java index 2e023d0698..d315526e08 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotTreeFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/NotTreeFilter.java @@ -61,13 +61,13 @@ public class NotTreeFilter extends TreeFilter { * filter to negate. * @return a filter that does the reverse of a. */ - public static TreeFilter create(final TreeFilter a) { + public static TreeFilter create(TreeFilter a) { return new NotTreeFilter(a); } private final TreeFilter a; - private NotTreeFilter(final TreeFilter one) { + private NotTreeFilter(TreeFilter one) { a = one; } @@ -79,7 +79,7 @@ public class NotTreeFilter extends TreeFilter { /** {@inheritDoc} */ @Override - public boolean include(final TreeWalk walker) + public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { return matchFilter(walker) == 0; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java index dbb062b973..07c6bfcfc4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java @@ -71,7 +71,7 @@ public abstract class OrTreeFilter extends TreeFilter { * second filter to test. * @return a filter that must match at least one input filter. */ - public static TreeFilter create(final TreeFilter a, final TreeFilter b) { + public static TreeFilter create(TreeFilter a, TreeFilter b) { if (a == ALL || b == ALL) return ALL; return new Binary(a, b); @@ -85,7 +85,7 @@ public abstract class OrTreeFilter extends TreeFilter { * filters. * @return a filter that must match at least one input filter. */ - public static TreeFilter create(final TreeFilter[] list) { + public static TreeFilter create(TreeFilter[] list) { if (list.length == 2) return create(list[0], list[1]); if (list.length < 2) @@ -103,7 +103,7 @@ public abstract class OrTreeFilter extends TreeFilter { * filters. * @return a filter that must match at least one input filter. */ - public static TreeFilter create(final Collection list) { + public static TreeFilter create(Collection list) { if (list.size() < 2) throw new IllegalArgumentException(JGitText.get().atLeastTwoFiltersNeeded); final TreeFilter[] subfilters = new TreeFilter[list.size()]; @@ -124,7 +124,7 @@ public abstract class OrTreeFilter extends TreeFilter { } @Override - public boolean include(final TreeWalk walker) + public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { return matchFilter(walker) <= 0; @@ -173,7 +173,7 @@ public abstract class OrTreeFilter extends TreeFilter { } @Override - public boolean include(final TreeWalk walker) + public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { return matchFilter(walker) <= 0; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java index 2f7f5cdc57..66b3c84073 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java @@ -86,7 +86,7 @@ public class PathFilter extends TreeFilter { final byte[] pathRaw; - private PathFilter(final String s) { + private PathFilter(String s) { pathStr = s; pathRaw = Constants.encode(pathStr); } @@ -102,13 +102,13 @@ public class PathFilter extends TreeFilter { /** {@inheritDoc} */ @Override - public boolean include(final TreeWalk walker) { + public boolean include(TreeWalk walker) { return matchFilter(walker) <= 0; } /** {@inheritDoc} */ @Override - public int matchFilter(final TreeWalk walker) { + public int matchFilter(TreeWalk walker) { return walker.isPathMatch(pathRaw, pathRaw.length); } @@ -143,7 +143,7 @@ public class PathFilter extends TreeFilter { * @return {@code true} if the path length of this filter matches the length * of the current path of the supplied TreeWalk. */ - public boolean isDone(final TreeWalk walker) { + public boolean isDone(TreeWalk walker) { return pathRaw.length == walker.getPathLength(); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java index 0652288b63..26cf8857bd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java @@ -82,7 +82,7 @@ public class PathFilterGroup { * the paths to test against. Must have at least one entry. * @return a new filter for the list of paths supplied. */ - public static TreeFilter createFromStrings(final Collection paths) { + public static TreeFilter createFromStrings(Collection paths) { if (paths.isEmpty()) throw new IllegalArgumentException( JGitText.get().atLeastOnePathIsRequired); @@ -109,7 +109,7 @@ public class PathFilterGroup { * the paths to test against. Must have at least one entry. * @return a new filter for the paths supplied. */ - public static TreeFilter createFromStrings(final String... paths) { + public static TreeFilter createFromStrings(String... paths) { if (paths.length == 0) throw new IllegalArgumentException( JGitText.get().atLeastOnePathIsRequired); @@ -131,7 +131,7 @@ public class PathFilterGroup { * the paths to test against. Must have at least one entry. * @return a new filter for the list of paths supplied. */ - public static TreeFilter create(final Collection paths) { + public static TreeFilter create(Collection paths) { if (paths.isEmpty()) throw new IllegalArgumentException( JGitText.get().atLeastOnePathIsRequired); @@ -140,7 +140,7 @@ public class PathFilterGroup { return create(p); } - private static TreeFilter create(final PathFilter[] p) { + private static TreeFilter create(PathFilter[] p) { if (p.length == 1) return new Single(p[0]); return new Group(p); @@ -151,13 +151,13 @@ public class PathFilterGroup { private final byte[] raw; - private Single(final PathFilter p) { + private Single(PathFilter p) { path = p; raw = path.pathRaw; } @Override - public boolean include(final TreeWalk walker) { + public boolean include(TreeWalk walker) { final int cmp = walker.isPathPrefix(raw, raw.length); if (cmp > 0) throw StopWalkException.INSTANCE; @@ -188,7 +188,7 @@ public class PathFilterGroup { private byte[] max; - private Group(final PathFilter[] pathFilters) { + private Group(PathFilter[] pathFilters) { fullpaths = new ByteArraySet(pathFilters.length); prefixes = new ByteArraySet(pathFilters.length / 5); // 5 is an empirically derived ratio of #paths/#prefixes from: @@ -239,7 +239,7 @@ public class PathFilterGroup { } @Override - public boolean include(final TreeWalk walker) { + public boolean include(TreeWalk walker) { byte[] rp = walker.getRawPath(); Hasher hasher = new Hasher(rp, walker.getPathLength()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathSuffixFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathSuffixFilter.java index 553e6bdd63..3d9f875e99 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathSuffixFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathSuffixFilter.java @@ -84,7 +84,7 @@ public class PathSuffixFilter extends TreeFilter { final String pathStr; final byte[] pathRaw; - private PathSuffixFilter(final String s) { + private PathSuffixFilter(String s) { pathStr = s; pathRaw = Constants.encode(pathStr); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java index f0a76324b2..11ad465538 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java @@ -91,7 +91,7 @@ public abstract class TreeFilter { private static final class AllFilter extends TreeFilter { @Override - public boolean include(final TreeWalk walker) { + public boolean include(TreeWalk walker) { return true; } @@ -133,7 +133,7 @@ public abstract class TreeFilter { private static final int baseTree = 0; @Override - public boolean include(final TreeWalk walker) { + public boolean include(TreeWalk walker) { final int n = walker.getTreeCount(); if (n == 1) // Assume they meant difference to empty tree. return true; @@ -221,7 +221,7 @@ public abstract class TreeFilter { * as thrown by {@link #include(TreeWalk)} * @since 4.7 */ - public int matchFilter(final TreeWalk walker) + public int matchFilter(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { 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 9915bdf49b..25e9aafe14 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java @@ -61,7 +61,7 @@ public abstract class CachedAuthenticator extends Authenticator { * @param ca * the information we should remember. */ - public static void add(final CachedAuthentication ca) { + public static void add(CachedAuthentication ca) { cached.add(ca); } 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 27a437f4f5..0681a3f68e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -390,7 +390,7 @@ public abstract class FS { * @return the translated path. new File(dir,name) if this * platform does not require path name translation. */ - public File resolve(final File dir, final String name) { + public File resolve(File dir, String name) { final File abspn = new File(name); if (abspn.isAbsolute()) return abspn; @@ -466,7 +466,7 @@ public abstract class FS { * @return the first match found, or null * @since 3.0 */ - protected static File searchPath(final String path, final String... lookFor) { + protected static File searchPath(String path, String... lookFor) { if (path == null) return null; @@ -1057,7 +1057,7 @@ public abstract class FS { * exists in the given repository, null otherwise. * @since 4.0 */ - public File findHook(Repository repository, final String hookName) { + public File findHook(Repository repository, String hookName) { File gitDir = repository.getDirectory(); if (gitDir == null) return null; 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 a0ed04fe66..9f99e28557 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 @@ -107,13 +107,13 @@ public class FS_Win32 extends FS { /** {@inheritDoc} */ @Override - public boolean canExecute(final File f) { + public boolean canExecute(File f) { return false; } /** {@inheritDoc} */ @Override - public boolean setExecute(final File f, final boolean canExec) { + public boolean setExecute(File f, boolean canExec) { return false; } 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 0b0a5057ce..3393fbfd1d 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 @@ -119,7 +119,7 @@ public class FS_Win32_Cygwin extends FS_Win32 { /** {@inheritDoc} */ @Override - public File resolve(final File dir, final String pn) { + public File resolve(File dir, String pn) { String useCygPath = System.getProperty("jgit.usecygpath"); //$NON-NLS-1$ if (useCygPath != null && useCygPath.equals("true")) { //$NON-NLS-1$ String w; 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 933af469d0..2f547c15b0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FileUtils.java @@ -122,7 +122,7 @@ public class FileUtils { * {@link java.nio.file.InvalidPathException}) * @since 4.10 */ - public static Path toPath(final File f) throws IOException { + public static Path toPath(File f) throws IOException { try { return f.toPath(); } catch (InvalidPathException ex) { @@ -141,7 +141,7 @@ public class FileUtils { * cause java.io.IOExceptions during race conditions when * multiple concurrent threads all try to delete the same file. */ - public static void delete(final File f) throws IOException { + public static void delete(File f) throws IOException { delete(f, NONE); } @@ -162,7 +162,7 @@ public class FileUtils { * multiple concurrent threads all try to delete the same file. * This exception is not thrown when IGNORE_ERRORS is set. */ - public static void delete(final File f, int options) throws IOException { + public static void delete(File f, int options) throws IOException { FS fs = FS.DETECTED; if ((options & SKIP_MISSING) != 0 && !fs.exists(f)) return; @@ -241,7 +241,7 @@ public class FileUtils { * if the rename has failed * @since 3.0 */ - public static void rename(final File src, final File dst) + public static void rename(File src, File dst) throws IOException { rename(src, dst, StandardCopyOption.REPLACE_EXISTING); } @@ -321,7 +321,7 @@ public class FileUtils { * multiple concurrent threads all try to create the same * directory. */ - public static void mkdir(final File d) + public static void mkdir(File d) throws IOException { mkdir(d, false); } @@ -341,7 +341,7 @@ public class FileUtils { * multiple concurrent threads all try to create the same * directory. */ - public static void mkdir(final File d, boolean skipExisting) + public static void mkdir(File d, boolean skipExisting) throws IOException { if (!d.mkdir()) { if (skipExisting && d.isDirectory()) @@ -366,7 +366,7 @@ public class FileUtils { * multiple concurrent threads all try to create the same * directory. */ - public static void mkdirs(final File d) throws IOException { + public static void mkdirs(File d) throws IOException { mkdirs(d, false); } @@ -388,7 +388,7 @@ public class FileUtils { * multiple concurrent threads all try to create the same * directory. */ - public static void mkdirs(final File d, boolean skipExisting) + public static void mkdirs(File d, boolean skipExisting) throws IOException { if (!d.mkdirs()) { if (skipExisting && d.isDirectory()) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java index d070ed39d0..6f92b37853 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java @@ -177,7 +177,7 @@ public class HttpSupport { * @param key * value which must be encoded to protected special characters. */ - public static void encode(final StringBuilder urlstr, final String key) { + public static void encode(StringBuilder urlstr, String key) { if (key == null || key.length() == 0) return; try { @@ -202,7 +202,7 @@ public class HttpSupport { * communications error prevented obtaining the response code. * @since 3.3 */ - public static int response(final HttpConnection c) throws IOException { + public static int response(HttpConnection c) throws IOException { try { return c.getResponseCode(); } catch (ConnectException ce) { @@ -230,7 +230,7 @@ public class HttpSupport { * @throws java.io.IOException * communications error prevented obtaining the response code. */ - public static int response(final java.net.HttpURLConnection c) + public static int response(java.net.HttpURLConnection c) throws IOException { try { return c.getResponseCode(); @@ -275,7 +275,7 @@ public class HttpSupport { * the proxy could not be computed as the supplied URL could not * be read. This failure should never occur. */ - public static Proxy proxyFor(final ProxySelector proxySelector, final URL u) + public static Proxy proxyFor(ProxySelector proxySelector, URL u) throws ConnectException { try { return proxySelector.select(u.toURI()).get(0); 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 fa19e89f2e..e88e7a38c6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java @@ -76,7 +76,7 @@ public class IO { * @throws java.io.IOException * the file exists, but its contents cannot be read. */ - public static final byte[] readFully(final File path) + public static final byte[] readFully(File path) throws FileNotFoundException, IOException { return IO.readFully(path, Integer.MAX_VALUE); } @@ -96,7 +96,7 @@ public class IO { * @throws java.io.IOException * the file exists, but its contents cannot be read. */ - public static final byte[] readSome(final File path, final int limit) + public static final byte[] readSome(File path, int limit) throws FileNotFoundException, IOException { try (SilentFileInputStream in = new SilentFileInputStream(path)) { byte[] buf = new byte[limit]; @@ -129,7 +129,7 @@ public class IO { * @throws java.io.IOException * the file exists, but its contents cannot be read. */ - public static final byte[] readFully(final File path, final int max) + public static final byte[] readFully(File path, int max) throws FileNotFoundException, IOException { try (SilentFileInputStream in = new SilentFileInputStream(path)) { long sz = Math.max(path.length(), 1); @@ -311,7 +311,7 @@ public class IO { * @throws java.io.IOException * there was an error reading from the stream. */ - public static void skipFully(final InputStream fd, long toSkip) + public static void skipFully(InputStream fd, long toSkip) throws IOException { while (toSkip > 0) { final long r = fd.skip(toSkip); @@ -329,7 +329,7 @@ public class IO { * @return the string divided into lines * @since 2.0 */ - public static List readLines(final String s) { + public static List readLines(String s) { List l = new ArrayList<>(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/IntList.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/IntList.java index 24038f0976..7441d50686 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/IntList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/IntList.java @@ -65,7 +65,7 @@ public class IntList { * @param capacity * number of entries the list can initially hold. */ - public IntList(final int capacity) { + public IntList(int capacity) { entries = new int[capacity]; } @@ -102,7 +102,7 @@ public class IntList { * @throws java.lang.ArrayIndexOutOfBoundsException * the index outside the valid range */ - public int get(final int i) { + public int get(int i) { if (count <= i) throw new ArrayIndexOutOfBoundsException(i); return entries[i]; @@ -121,7 +121,7 @@ public class IntList { * @param n * the number to add. */ - public void add(final int n) { + public void add(int n) { if (count == entries.length) grow(); entries[count++] = n; @@ -135,7 +135,7 @@ public class IntList { * @param n * value to store at the position. */ - public void set(final int index, final int n) { + public void set(int index, int n) { if (count < index) throw new ArrayIndexOutOfBoundsException(index); else if (count == index) @@ -154,7 +154,7 @@ public class IntList { * @param val * value to insert into padded positions. */ - public void fillTo(int toIndex, final int val) { + public void fillTo(int toIndex, int val) { while (count < toIndex) add(val); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java index 404594cf79..3bd6e18264 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java @@ -67,7 +67,7 @@ public class LongList { * @param capacity * number of entries the list can initially hold. */ - public LongList(final int capacity) { + public LongList(int capacity) { entries = new long[capacity]; } @@ -89,7 +89,7 @@ public class LongList { * @throws java.lang.ArrayIndexOutOfBoundsException * the index outside the valid range */ - public long get(final int i) { + public long get(int i) { if (count <= i) throw new ArrayIndexOutOfBoundsException(i); return entries[i]; @@ -102,7 +102,7 @@ public class LongList { * the value to search for. * @return true of {@code value} appears in this list. */ - public boolean contains(final long value) { + public boolean contains(long value) { for (int i = 0; i < count; i++) if (entries[i] == value) return true; @@ -122,7 +122,7 @@ public class LongList { * @param n * the number to add. */ - public void add(final long n) { + public void add(long n) { if (count == entries.length) grow(); entries[count++] = n; @@ -136,7 +136,7 @@ public class LongList { * @param n * value to store at the position. */ - public void set(final int index, final long n) { + public void set(int index, long n) { if (count < index) throw new ArrayIndexOutOfBoundsException(index); else if (count == index) @@ -155,7 +155,7 @@ public class LongList { * @param val * value to insert into padded positions. */ - public void fillTo(int toIndex, final long val) { + public void fillTo(int toIndex, long val) { while (count < toIndex) add(val); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/LongMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/LongMap.java index 09eee42024..146966dd4e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/LongMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/LongMap.java @@ -144,7 +144,7 @@ public class LongMap { return null; } - private void insert(final Node n) { + private void insert(Node n) { final int idx = index(n.key); n.next = table[idx]; table[idx] = n; @@ -166,14 +166,14 @@ public class LongMap { } } - private final int index(final long key) { + private final int index(long key) { int h = ((int) key) >>> 1; h ^= (h >>> 20) ^ (h >>> 12); return h & (table.length - 1); } @SuppressWarnings("unchecked") - private static final Node[] createArray(final int sz) { + private static final Node[] createArray(int sz) { return new Node[sz]; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/QuotedString.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/QuotedString.java index 77bc2495fb..4d58d0614a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/QuotedString.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/QuotedString.java @@ -99,7 +99,7 @@ public abstract class QuotedString { * @return the cleaned string. * @see #dequote(byte[], int, int) */ - public String dequote(final String in) { + public String dequote(String in) { final byte[] b = Constants.encode(in); return dequote(b, 0, b.length); } @@ -137,7 +137,7 @@ public abstract class QuotedString { */ public static class BourneStyle extends QuotedString { @Override - public String quote(final String in) { + public String quote(String in) { final StringBuilder r = new StringBuilder(); r.append('\''); int start = 0, i = 0; @@ -160,7 +160,7 @@ public abstract class QuotedString { } @Override - public String dequote(final byte[] in, int ip, final int ie) { + public String dequote(byte[] in, int ip, int ie) { boolean inquote = false; final byte[] r = new byte[ie - ip]; int rPtr = 0; @@ -188,7 +188,7 @@ public abstract class QuotedString { /** Bourne style, but permits ~user at the start of the string. */ public static class BourneUserPathStyle extends BourneStyle { @Override - public String quote(final String in) { + public String quote(String in) { if (in.matches("^~[A-Za-z0-9_-]+$")) { //$NON-NLS-1$ // If the string is just "~user" we can assume they // mean "~user/". @@ -255,7 +255,7 @@ public abstract class QuotedString { } @Override - public String quote(final String instr) { + public String quote(String instr) { if (instr.length() == 0) return "\"\""; //$NON-NLS-1$ boolean reuse = true; @@ -291,13 +291,13 @@ public abstract class QuotedString { } @Override - public String dequote(final byte[] in, final int inPtr, final int inEnd) { + public String dequote(byte[] in, int inPtr, int inEnd) { if (2 <= inEnd - inPtr && in[inPtr] == '"' && in[inEnd - 1] == '"') return dq(in, inPtr + 1, inEnd - 1); return RawParseUtils.decode(Constants.CHARSET, in, inPtr, inEnd); } - private static String dq(final byte[] in, int inPtr, final int inEnd) { + private static String dq(byte[] in, int inPtr, int inEnd) { final byte[] r = new byte[inEnd - inPtr]; int rPtr = 0; while (inPtr < inEnd) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/RawCharSequence.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/RawCharSequence.java index 23ee9d0d64..42060c659e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/RawCharSequence.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/RawCharSequence.java @@ -68,7 +68,7 @@ public final class RawCharSequence implements CharSequence { * @param end * ending position for the sequence. */ - public RawCharSequence(final byte[] buf, final int start, final int end) { + public RawCharSequence(byte[] buf, int start, int end) { buffer = buf; startPtr = start; endPtr = end; @@ -76,7 +76,7 @@ public final class RawCharSequence implements CharSequence { /** {@inheritDoc} */ @Override - public char charAt(final int index) { + public char charAt(int index) { return (char) (buffer[startPtr + index] & 0xff); } @@ -88,7 +88,7 @@ public final class RawCharSequence implements CharSequence { /** {@inheritDoc} */ @Override - public CharSequence subSequence(final int start, final int end) { + public CharSequence subSequence(int start, int end) { return new RawCharSequence(buffer, startPtr + start, startPtr + end); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java index 26fc9d80c5..c22c8de5d1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java @@ -126,7 +126,7 @@ public final class RawParseUtils { * the buffer to test for equality with b. * @return ptr + src.length if b[ptr..src.length] == src; else -1. */ - public static final int match(final byte[] b, int ptr, final byte[] src) { + public static final int match(byte[] b, int ptr, byte[] src) { if (ptr + src.length > b.length) return -1; for (int i = 0; i < src.length; i++, ptr++) @@ -462,7 +462,7 @@ public final class RawParseUtils { * position within buffer to start parsing digits at. * @return the timezone at this location, expressed in minutes. */ - public static final int parseTimeZoneOffset(final byte[] b, int ptr) { + public static final int parseTimeZoneOffset(byte[] b, int ptr) { return parseTimeZoneOffset(b, ptr, null); } @@ -501,7 +501,7 @@ public final class RawParseUtils { * character to find. * @return new position just after chrA. */ - public static final int next(final byte[] b, int ptr, final char chrA) { + public static final int next(byte[] b, int ptr, char chrA) { final int sz = b.length; while (ptr < sz) { if (b[ptr++] == chrA) @@ -521,7 +521,7 @@ public final class RawParseUtils { * position within buffer to start looking for LF at. * @return new position just after the first LF found. */ - public static final int nextLF(final byte[] b, int ptr) { + public static final int nextLF(byte[] b, int ptr) { return next(b, ptr, '\n'); } @@ -538,7 +538,7 @@ public final class RawParseUtils { * character to find. * @return new position just after the first chrA or LF to be found. */ - public static final int nextLF(final byte[] b, int ptr, final char chrA) { + public static final int nextLF(byte[] b, int ptr, char chrA) { final int sz = b.length; while (ptr < sz) { final byte c = b[ptr++]; @@ -559,7 +559,7 @@ public final class RawParseUtils { * character to find. * @return new position just before chrA, -1 for not found */ - public static final int prev(final byte[] b, int ptr, final char chrA) { + public static final int prev(byte[] b, int ptr, char chrA) { if (ptr == b.length) --ptr; while (ptr >= 0) { @@ -580,7 +580,7 @@ public final class RawParseUtils { * position within buffer to start looking for LF at. * @return new position just before the first LF found, -1 for not found */ - public static final int prevLF(final byte[] b, int ptr) { + public static final int prevLF(byte[] b, int ptr) { return prev(b, ptr, '\n'); } @@ -598,7 +598,7 @@ public final class RawParseUtils { * @return new position just before the first chrA or LF to be found, -1 for * not found */ - public static final int prevLF(final byte[] b, int ptr, final char chrA) { + public static final int prevLF(byte[] b, int ptr, char chrA) { if (ptr == b.length) --ptr; while (ptr >= 0) { @@ -637,7 +637,7 @@ public final class RawParseUtils { * map representing the entire buffer as a single line if * buf contains a NUL byte. */ - public static final IntList lineMap(final byte[] buf, int ptr, int end) { + public static final IntList lineMap(byte[] buf, int ptr, int end) { IntList map = lineMapOrNull(buf, ptr, end); if (map == null) { map = new IntList(3); @@ -708,7 +708,7 @@ public final class RawParseUtils { * character of the author's name. If no author header can be * located -1 is returned. */ - public static final int author(final byte[] b, int ptr) { + public static final int author(byte[] b, int ptr) { final int sz = b.length; if (ptr == 0) ptr += 46; // skip the "tree ..." line. @@ -730,7 +730,7 @@ public final class RawParseUtils { * character of the committer's name. If no committer header can be * located -1 is returned. */ - public static final int committer(final byte[] b, int ptr) { + public static final int committer(byte[] b, int ptr) { final int sz = b.length; if (ptr == 0) ptr += 46; // skip the "tree ..." line. @@ -754,7 +754,7 @@ public final class RawParseUtils { * character of the tagger's name. If no tagger header can be * located -1 is returned. */ - public static final int tagger(final byte[] b, int ptr) { + public static final int tagger(byte[] b, int ptr) { final int sz = b.length; if (ptr == 0) ptr += 48; // skip the "object ..." line. @@ -782,7 +782,7 @@ public final class RawParseUtils { * character of the encoding's name. If no encoding header can be * located -1 is returned (and UTF-8 should be assumed). */ - public static final int encoding(final byte[] b, int ptr) { + public static final int encoding(byte[] b, int ptr) { final int sz = b.length; while (ptr < sz) { if (b[ptr] == '\n') @@ -806,7 +806,7 @@ public final class RawParseUtils { * @since 4.2 */ @Nullable - public static String parseEncodingName(final byte[] b) { + public static String parseEncodingName(byte[] b) { int enc = encoding(b, 0); if (enc < 0) { return null; @@ -834,7 +834,7 @@ public final class RawParseUtils { * if the JRE does not support the character set requested by * the encoding header. */ - public static Charset parseEncoding(final byte[] b) { + public static Charset parseEncoding(byte[] b) { String enc = parseEncodingName(b); if (enc == null) { return UTF_8; @@ -864,7 +864,7 @@ public final class RawParseUtils { * @return the parsed identity or null in case the identity could not be * parsed. */ - public static PersonIdent parsePersonIdent(final String in) { + public static PersonIdent parsePersonIdent(String in) { return parsePersonIdent(Constants.encode(in), 0); } @@ -886,7 +886,7 @@ public final class RawParseUtils { * @return the parsed identity or null in case the identity could not be * parsed. */ - public static PersonIdent parsePersonIdent(final byte[] raw, final int nameB) { + public static PersonIdent parsePersonIdent(byte[] raw, int nameB) { Charset cs; try { cs = parseEncoding(raw); @@ -994,7 +994,7 @@ public final class RawParseUtils { * @return position of the ':' which terminates the footer line key if this * is otherwise a valid footer line key; otherwise -1. */ - public static int endOfFooterLineKey(final byte[] raw, int ptr) { + public static int endOfFooterLineKey(byte[] raw, int ptr) { try { for (;;) { final byte c = raw[ptr]; @@ -1021,7 +1021,7 @@ public final class RawParseUtils { * @return a string representation of the range [start,end), * after decoding the region through the specified character set. */ - public static String decode(final byte[] buffer) { + public static String decode(byte[] buffer) { return decode(buffer, 0, buffer.length); } @@ -1059,7 +1059,7 @@ public final class RawParseUtils { * @return a string representation of the range [start,end), * after decoding the region through the specified character set. */ - public static String decode(final Charset cs, final byte[] buffer) { + public static String decode(Charset cs, byte[] buffer) { return decode(cs, buffer, 0, buffer.length); } @@ -1176,7 +1176,7 @@ public final class RawParseUtils { return r.toString(); } - private static String decode(final ByteBuffer b, final Charset charset) + private static String decode(ByteBuffer b, Charset charset) throws CharacterCodingException { final CharsetDecoder d = charset.newDecoder(); d.onMalformedInput(CodingErrorAction.REPORT); @@ -1195,7 +1195,7 @@ public final class RawParseUtils { * commit buffer. * @return position of the user's message buffer. */ - public static final int commitMessage(final byte[] b, int ptr) { + public static final int commitMessage(byte[] b, int ptr) { final int sz = b.length; if (ptr == 0) ptr += 46; // skip the "tree ..." line. @@ -1219,7 +1219,7 @@ public final class RawParseUtils { * buffer. * @return position of the user's message buffer. */ - public static final int tagMessage(final byte[] b, int ptr) { + public static final int tagMessage(byte[] b, int ptr) { final int sz = b.length; if (ptr == 0) ptr += 48; // skip the "object ..." line. @@ -1244,7 +1244,7 @@ public final class RawParseUtils { * @return position of the LF at the end of the paragraph; * b.length if no paragraph end could be located. */ - public static final int endOfParagraph(final byte[] b, final int start) { + public static final int endOfParagraph(byte[] b, int start) { int ptr = start; final int sz = b.length; while (ptr < sz && (b[ptr] != '\n' && b[ptr] != '\r')) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/RawSubStringPattern.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/RawSubStringPattern.java index a8f9bc72eb..040b5cbc37 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/RawSubStringPattern.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/RawSubStringPattern.java @@ -66,7 +66,7 @@ public class RawSubStringPattern { * meta-characters are supported by this implementation. The * string may not be the empty string. */ - public RawSubStringPattern(final String patternText) { + public RawSubStringPattern(String patternText) { if (patternText.length() == 0) throw new IllegalArgumentException(JGitText.get().cannotMatchOnEmptyString); needleString = patternText; @@ -87,7 +87,7 @@ public class RawSubStringPattern { * pattern; -1 if this pattern does not appear at any position of * rcs. */ - public int match(final RawCharSequence rcs) { + public int match(RawCharSequence rcs) { final int needleLen = needle.length; final byte first = needle[0]; @@ -114,11 +114,11 @@ public class RawSubStringPattern { return -1; } - private static final boolean neq(final byte a, final byte b) { + private static final boolean neq(byte a, byte b) { return a != b && a != lc(b); } - private static final byte lc(final byte q) { + private static final byte lc(byte q) { return (byte) StringUtils.toLowerCase((char) (q & 0xff)); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/RefMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/RefMap.java index c1aaecfd91..a3f9730f13 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/RefMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/RefMap.java @@ -169,7 +169,7 @@ public class RefMap extends AbstractMap { /** {@inheritDoc} */ @Override - public Ref put(final String keyName, Ref value) { + public Ref put(String keyName, Ref value) { String name = toRefName(keyName); if (!name.equals(value.getName())) @@ -355,7 +355,7 @@ public class RefMap extends AbstractMap { return null; } - private Ref resolveLoose(final Ref l) { + private Ref resolveLoose(Ref l) { if (resolvedIdx < resolved.size()) { Ref r = resolved.get(resolvedIdx); int cmp = RefComparator.compareTo(l, r); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java index b4736d3e40..3868e56f50 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java @@ -74,7 +74,7 @@ public final class StringUtils { * the input character. * @return lowercase version of the input. */ - public static char toLowerCase(final char c) { + public static char toLowerCase(char c) { return c <= 'Z' ? LC[c] : c; } @@ -91,7 +91,7 @@ public final class StringUtils { * @return a copy of the input string, after converting characters in the * range 'A'..'Z' to 'a'..'z'. */ - public static String toLowerCase(final String in) { + public static String toLowerCase(String in) { final StringBuilder r = new StringBuilder(in.length()); for (int i = 0; i < in.length(); i++) r.append(toLowerCase(in.charAt(i))); @@ -138,7 +138,7 @@ public final class StringUtils { * second string to compare. * @return true if a equals b */ - public static boolean equalsIgnoreCase(final String a, final String b) { + public static boolean equalsIgnoreCase(String a, String b) { if (a == b) return true; if (a.length() != b.length()) @@ -205,7 +205,7 @@ public final class StringUtils { * if {@code value} is not recognized as one of the standard * boolean names. */ - public static boolean toBoolean(final String stringValue) { + public static boolean toBoolean(String stringValue) { if (stringValue == null) throw new NullPointerException(JGitText.get().expectedBooleanStringValue); @@ -232,7 +232,7 @@ public final class StringUtils { * @return the boolean interpretation of {@code value} or null in case the * string does not represent a boolean value */ - public static Boolean toBooleanOrNull(final String stringValue) { + public static Boolean toBooleanOrNull(String stringValue) { if (stringValue == null) return null; 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 887f69b87c..057b17785e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java @@ -91,7 +91,7 @@ public abstract class TemporaryBuffer extends OutputStream { * maximum number of bytes to store in memory before entering the * overflow output path; also used as the estimated size. */ - protected TemporaryBuffer(final int limit) { + protected TemporaryBuffer(int limit) { this(limit, limit); } @@ -106,7 +106,7 @@ public abstract class TemporaryBuffer extends OutputStream { * overflow output path. * @since 4.0 */ - protected TemporaryBuffer(final int estimatedSize, final int limit) { + protected TemporaryBuffer(int estimatedSize, int limit) { if (estimatedSize > limit) throw new IllegalArgumentException(); this.inCoreLimit = limit; @@ -116,7 +116,7 @@ public abstract class TemporaryBuffer extends OutputStream { /** {@inheritDoc} */ @Override - public void write(final int b) throws IOException { + public void write(int b) throws IOException { if (overflow != null) { overflow.write(b); return; @@ -137,7 +137,7 @@ public abstract class TemporaryBuffer extends OutputStream { /** {@inheritDoc} */ @Override - public void write(final byte[] b, int off, int len) throws IOException { + public void write(byte[] b, int off, int len) throws IOException { if (overflow == null) { while (len > 0) { Block s = last(); @@ -183,7 +183,7 @@ public abstract class TemporaryBuffer extends OutputStream { * an error occurred reading from the input stream, or while * writing to a local temporary file. */ - public void copy(final InputStream in) throws IOException { + public void copy(InputStream in) throws IOException { if (blocks != null) { for (;;) { Block s = last(); @@ -288,7 +288,7 @@ public abstract class TemporaryBuffer extends OutputStream { * an error occurred reading from a temporary file on the local * system, or writing to the output stream. */ - public void writeTo(final OutputStream os, ProgressMonitor pm) + public void writeTo(OutputStream os, ProgressMonitor pm) throws IOException { if (pm == null) pm = NullProgressMonitor.INSTANCE; @@ -442,7 +442,7 @@ public abstract class TemporaryBuffer extends OutputStream { * system default temporary directory (for example /tmp) will * be used instead. */ - public LocalFile(final File directory) { + public LocalFile(File directory) { this(directory, DEFAULT_IN_CORE_LIMIT); } @@ -458,7 +458,7 @@ public abstract class TemporaryBuffer extends OutputStream { * maximum number of bytes to store in memory. Storage beyond * this limit will use the local file. */ - public LocalFile(final File directory, final int inCoreLimit) { + public LocalFile(File directory, int inCoreLimit) { super(inCoreLimit); this.directory = directory; } @@ -494,7 +494,7 @@ public abstract class TemporaryBuffer extends OutputStream { } @Override - public void writeTo(final OutputStream os, ProgressMonitor pm) + public void writeTo(OutputStream os, ProgressMonitor pm) throws IOException { if (onDiskFile == null) { super.writeTo(os, pm); @@ -563,7 +563,7 @@ public abstract class TemporaryBuffer extends OutputStream { * also used as the estimated size. Storing beyond this many * will cause an IOException to be thrown during write. */ - public Heap(final int limit) { + public Heap(int limit) { super(limit); } @@ -579,7 +579,7 @@ public abstract class TemporaryBuffer extends OutputStream { * thrown during write. * @since 4.0 */ - public Heap(final int estimatedSize, final int limit) { + public Heap(int estimatedSize, int limit) { super(estimatedSize, limit); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoCRLFInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoCRLFInputStream.java index 45668255e5..08377e6be0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoCRLFInputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoCRLFInputStream.java @@ -100,7 +100,7 @@ public class AutoCRLFInputStream extends InputStream { /** {@inheritDoc} */ @Override - public int read(byte[] bs, final int off, final int len) throws IOException { + public int read(byte[] bs, int off, int len) throws IOException { if (len == 0) return 0; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoCRLFOutputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoCRLFOutputStream.java index e764389ac8..d8cfee7c46 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoCRLFOutputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoCRLFOutputStream.java @@ -113,7 +113,7 @@ public class AutoCRLFOutputStream extends OutputStream { /** {@inheritDoc} */ @Override - public void write(byte[] b, final int startOff, final int startLen) + public void write(byte[] b, int startOff, int startLen) throws IOException { final int overflow = buffer(b, startOff, startLen); if (overflow < 0) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoLFInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoLFInputStream.java index 06f83f3ed9..ff28161a52 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoLFInputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoLFInputStream.java @@ -134,7 +134,7 @@ public class AutoLFInputStream extends InputStream { /** {@inheritDoc} */ @Override - public int read(byte[] bs, final int off, final int len) + public int read(byte[] bs, int off, int len) throws IOException { if (len == 0) return 0; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoLFOutputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoLFOutputStream.java index 32226c4af4..908d0a0b44 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoLFOutputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/AutoLFOutputStream.java @@ -120,7 +120,7 @@ public class AutoLFOutputStream extends OutputStream { /** {@inheritDoc} */ @Override - public void write(byte[] b, final int startOff, final int startLen) + public void write(byte[] b, int startOff, int startLen) throws IOException { final int overflow = buffer(b, startOff, startLen); if (overflow < 0) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java index f400e50cd3..475b0c110d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java @@ -103,7 +103,7 @@ public final class InterruptTimer { * @param threadName * name of the timer thread. */ - public InterruptTimer(final String threadName) { + public InterruptTimer(String threadName) { state = new AlarmState(); autoKiller = new AutoKiller(state); thread = new AlarmThread(threadName, state); @@ -117,7 +117,7 @@ public final class InterruptTimer { * number of milliseconds before the interrupt should trigger. * Must be > 0. */ - public void begin(final int timeout) { + public void begin(int timeout) { if (timeout <= 0) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().invalidTimeout, Integer.valueOf(timeout))); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/IsolatedOutputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/IsolatedOutputStream.java index 5e50995a2a..65470d4ef1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/IsolatedOutputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/IsolatedOutputStream.java @@ -99,7 +99,7 @@ public class IsolatedOutputStream extends OutputStream { /** {@inheritDoc} */ @Override - public void write(final byte[] buf, final int pos, final int cnt) + public void write(byte[] buf, int pos, int cnt) throws IOException { checkClosed(); execute(new Callable() { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java index efdddeee95..a9989a1c28 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java @@ -73,7 +73,7 @@ public class StreamCopyThread extends Thread { * stream to copy into. The destination stream is automatically * closed when the thread terminates. */ - public StreamCopyThread(final InputStream i, final OutputStream o) { + public StreamCopyThread(InputStream i, OutputStream o) { setName(Thread.currentThread().getName() + "-StreamCopy"); //$NON-NLS-1$ src = i; dst = o; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TeeInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TeeInputStream.java index dee4fe9e91..e40a5a4cee 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TeeInputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TeeInputStream.java @@ -89,7 +89,7 @@ public class TeeInputStream extends InputStream { /** {@inheritDoc} */ @Override - public long skip(final long count) throws IOException { + public long skip(long count) throws IOException { long skipped = 0; long cnt = count; final byte[] b = skipBuffer(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutInputStream.java index 01b25195ff..2392b8ae23 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutInputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutInputStream.java @@ -89,7 +89,7 @@ public class TimeoutInputStream extends FilterInputStream { * @param millis * number of milliseconds before aborting a read. Must be > 0. */ - public void setTimeout(final int millis) { + public void setTimeout(int millis) { if (millis < 0) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().invalidTimeout, Integer.valueOf(millis))); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutOutputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutOutputStream.java index ea40133383..27f18740f4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutOutputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/TimeoutOutputStream.java @@ -91,7 +91,7 @@ public class TimeoutOutputStream extends OutputStream { * number of milliseconds before aborting a write. Must be > * 0. */ - public void setTimeout(final int millis) { + public void setTimeout(int millis) { if (millis < 0) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().invalidTimeout, Integer.valueOf(millis))); 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 51d3106aa5..e14eb2b600 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 @@ -107,7 +107,7 @@ public class UnionInputStream extends InputStream { * @param in * the stream to add; must not be null. */ - public void add(final InputStream in) { + public void add(InputStream in) { streams.add(in); } @@ -164,7 +164,7 @@ public class UnionInputStream extends InputStream { /** {@inheritDoc} */ @Override - public long skip(final long count) throws IOException { + public long skip(long count) throws IOException { long skipped = 0; long cnt = count; while (0 < cnt) { -- 2.39.5