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 281930047..7f1fecb9b 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 void connect() throws IOException { /** {@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 0d935fc98..09f110d9b 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 @@ private boolean initRangeRequest(final HttpServletRequest req, 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 ee23677ca..d0ea7b6db 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 void addReceivePackFilter(Filter filter) { /** {@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 830e0611b..52aaf5128 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 @@ public void doGet(final HttpServletRequest req, 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 4f70cf700..d7f6fbf29 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 @@ public void doGet(final HttpServletRequest req, 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 b0b831f3d..b37998313 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 @@ public void doFilter(ServletRequest request, ServletResponse response, ((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 50dc68f99..1c523a062 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 @@ private void serve(final HttpServletRequest req, } } - 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 b9e82c27f..020be4f96 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 272edc687..2ff385dbe 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 static Repository getRepository(final ServletRequest req) { * @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 @@ static boolean acceptsGzipEncoding(String accepts) { 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 @@ private static byte[] compress(final byte[] raw) throws IOException { 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 00851cfbe..5cac868b9 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 @@ public void doGet(final HttpServletRequest req, } } - 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 57fdddaf3..6f27b287f 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 a3dc6c370..f26ebc35f 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 void doFilter(final ServletRequest request, 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 95eb8d52d..fbd155c0d 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 @@ private static class ServiceConfig { /** {@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 f5afa1ecd..e6df77b83 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 @@ private static class ServiceConfig { /** {@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 6dbe0e3cd..035501ffc 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 void setUp() throws Exception { 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 @@ private ServletContextHandler dumb(final String path) { 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 Repository open(HttpServletRequest req, String name) 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 01c4360d1..8d08c038d 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 @@ private static Map cloneHeaders(final Request req) { 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 fed063a8f..a714eb01d 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 RecordingLogger() { * * @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 c5576f91e..245b510fe 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 URIish getSecureUri() { 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 Repository open(HttpServletRequest req, String name) 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 27f745e4e..a102da1f4 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 @@ private static String s(byte[] raw) { * @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 static File writeTrashFile(final Repository db, * @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 static void write(final File f, final String body) * @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 static String read(final File file) throws IOException { * @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 static String read(final Repository db, final String name) * 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 3c00bd3df..6cdd0eb23 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 @@ protected void tick() { * @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 @@ private static void putPersonIdent(final Map env, * @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 @@ protected File write(final String body) throws IOException { * @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 @@ protected void write(final File f, final String body) throws IOException { * @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 05d15229b..d3d7d682e 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 MockSystemReader() { setCurrentPlatform(); } - private void init(final String n) { + private void init(String n) { setProperty(n, n); } @@ -197,7 +197,7 @@ public void blockUntil(Duration maxWait) { * 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 93fc771cb..e983e5dfb 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 @@ protected static void copyFile(final File src, final File dst) * @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 @@ protected File writeTrashFile(final String name, final String data) * @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 @@ protected File writeTrashFile(final String subdir, final String name, * @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 @@ protected String read(final String name) throws IOException { * 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 @@ protected boolean check(final String name) { * 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 @@ protected void deleteTrashFile(final String name) throws IOException { * 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 @@ else if (empty) * @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 89a86d8ee..4891c0194 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 TimeZone getTimeZone() { * @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 void setAuthorAndCommitter(org.eclipse.jgit.lib.CommitBuilder c) { * @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 RevBlob blob(final String content) throws Exception { * @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 RevBlob blob(final byte[] content) throws Exception { * @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 DirCacheEntry file(final String path, final RevBlob blob) * @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 RevTree tree(final DirCacheEntry... entries) throws Exception { * @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 RevObject get(final RevTree tree, final String path) * @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 RevCommit commit(final RevCommit... parents) throws Exception { * @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 RevCommit commit(final RevTree tree, final RevCommit... parents) * @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 CommitBuilder commit() { * @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 void updateServerInfo() throws Exception { 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 @@ protected void writeFile(final String name, final byte[] bin) * @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 @@ private static File nameFor(ObjectDirectory odb, ObjectId name, String t) { 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 CommitBuilder add(String path, String content) throws Exception { 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 54c81f2d8..f7af36a83 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 TestRng(final String seed) { * 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 688aef2af..55d909324 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 @@ private static char[] toHexCharArray(int b) { 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 4529a25fc..d26885791 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 static final AbbreviatedLongObjectId fromLongObjectId( * 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 LongObjectId toLongObjectId() { * >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 int prefixCompare(final AnyLongObjectId other) { * >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 int prefixCompare(final byte[] bs, final int p) { * >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 int getFirstByte() { 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 int hashCode() { /** {@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 96d693852..cdb297eb1 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 final int getByte(int index) { * 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 final int compareTo(final AnyLongObjectId other) { * @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 final int compareTo(final byte[] bs, final int p) { * @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 final int compareTo(final long[] bs, final int p) { * @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 final int hashCode() { * 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 final boolean equals(final Object o) { * @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 void copyRawTo(final ByteBuffer w) { * @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 void copyRawTo(final byte[] b, final int o) { * @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 void copyRawTo(final long[] b, final int o) { * @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 @@ private static void writeRawLong(final OutputStream w, long v) * @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 @@ private byte[] toHexByteArray() { 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 @@ private static void formatHexByte(final byte[] dst, final int p, long w) { * @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 void copyTo(final Writer w) throws IOException { * @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 void copyTo(final char[] tmp, final Writer w) throws IOException { * @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 @@ char[] toHexCharArray() { 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 final String getName() { * 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 ec1e1791d..8159576c0 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 static final LongObjectId zeroId() { * 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 static final boolean isId(final String id) { * 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 static boolean equals(final byte[] firstBuffer, final int fi, * 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 static final LongObjectId fromRaw(final byte[] bs) { * 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 static final LongObjectId fromRaw(final byte[] bs, final int p) { * 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 static final LongObjectId fromRaw(final long[] is) { * 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 static final LongObjectId fromRaw(final long[] is, final int p) { * 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 static final LongObjectId fromString(final byte[] buf, final int offset) * 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 @@ private static final LongObjectId fromHexString(final byte[] bs, int p) { * @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 7b0c49444..3d62490bf 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 void fromObjectId(AnyLongObjectId src) { * 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 void fromRaw(final byte[] bs) { * @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 void fromRaw(final byte[] bs, final int p) { * 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 void fromRaw(final long[] longs) { * @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 void fromRaw(final long[] longs, final int p) { * @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 void fromString(final byte[] buf, final int offset) { * @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 0eeababc5..0d1894b64 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 @@ protected Path writeLink(String link, String target) throws Exception { 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 e992ddfb5..afeb5ef6e 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 @@ private static String[] listZipEntries(byte[] zipData) throws IOException { 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 f0754b192..2b6ea2a0e 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 @@ private static String safeAbbreviate(ObjectReader reader, ObjectId id) { } } - 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 e6685c2f6..65d60bce5 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 @@ else if (remote) } } - 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 @@ private void addRefs(final Collection refs, final String prefix) { } } - 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 510daecd3..e699326a0 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 static CommandRef[] common() { 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 @@ private Enumeration catalogs() { } } - 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 @@ private void scan(final URL cUrl) { } } - 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 2c9bc0dc7..4df446fe8 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 59de80c96..4ec5f04bb 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 Die(final String why) { * @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 Die(boolean aborted) { * 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 ed6f7b426..97e3df38d 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 @@ void noPrefix(@SuppressWarnings("unused") boolean on) { /** {@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 a081b7813..2b5af5d7b 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 @@ protected int walkLoop() throws Exception { /** {@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 75542d445..0d8b7ec00 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 @@ void noPrefix(@SuppressWarnings("unused") boolean on) { /** {@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 @@ private void addNoteMap(String notesRef) throws IOException { /** {@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 9013ff6cf..907923358 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 @@ protected boolean requiresRepository() { 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 33c5475d1..e303f385a 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 Thread newThread(Runnable taskBody) { * 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 static void main(final String[] argv) throws Exception { * 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 @@ PrintWriter createErrorWriter() { 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 @@ private static boolean installConsole() { } } - 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 948cbc554..3308e18f2 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 @@ protected void run() throws Exception { /** {@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 8c88a5cdc..101fbb27d 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 @@ 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 @@ protected void show(final RevCommit c) throws Exception { /** {@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 80161b482..1178f8801 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 @@ protected int walkLoop() throws Exception { * 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 de04045e4..fb1e6d0a5 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 @@ void noPrefix(@SuppressWarnings("unused") boolean on) { /** {@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 @@ private void show(RevTree obj) throws MissingObjectException, } } - 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 9ce8347d9..0cc5dbc47 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 @@ private Iterable getSortedRefs() throws Exception { 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 bc3755d34..7b3854212 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 void initRaw(final Repository repository, final String gitDir, * 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 final void execute(String[] args) throws Exception { * 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 @@ protected void parseArguments(final String[] args) throws IOException { * 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 void printUsageAndExit(final CmdLineParser clp) throws IOException { * 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 void printUsageAndExit(final String message, final CmdLineParser clp) thr * @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 @@ ObjectId resolve(final String s) throws IOException { * 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 @@ protected static Die die(final String why) { * 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 @@ protected static Die die(boolean aborted) { * @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 127e54174..2a1326d4b 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 @@ protected void run() throws Exception { 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 42dea219f..a133b0537 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 @@ private void recreateRefs() throws Exception { 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 20fa4a3fe..6b97e08e4 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 @@ protected void run() throws Exception { 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 6378e8d22..bb51b5048 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 @@ public boolean equals(Object obj) { } } - 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 6fe792716..a14f6514f 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 AbstractTreeIteratorHandler(final CmdLineParser parser, /** {@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 e071bdf83..5cc98ca8a 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 CmdLineParser(final Object bean) { * 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 CmdLineParser(final Object bean, Repository repo) { /** {@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 @@ private void restoreRequiredOptions(List backup) { * @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 0e5b0f5b1..5f7e81ec7 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 ObjectIdHandler(final CmdLineParser parser, final OptionDef option, /** {@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 33d669ca6..d99f88e35 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 PathTreeFilterHandler(final CmdLineParser parser, /** {@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 dd8520af7..29577ed02 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 RefSpecHandler(final CmdLineParser parser, final OptionDef option, /** {@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 d2fa76432..b925e31f8 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 RevCommitHandler(final CmdLineParser parser, final OptionDef option, /** {@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 int parseArguments(final Parameters params) throws CmdLineException { 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 9444363be..85922a27b 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 RevTreeHandler(final CmdLineParser parser, final OptionDef option, /** {@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 d60071f17..92eebf47f 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 SubcommandHandler(final CmdLineParser parser, /** {@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 3f9ef1250..f26952ea7 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 @@ void onCommit(String cid, byte[] buf) { 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 172807c43..1dd329a9e 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 void testNonASCIIDel() throws Exception { 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 @@ private static byte[] readFile(final String patchFile) throws IOException { } } - 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 f37aa13d6..7a1d222ca 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 void testMoveToOtherDir() throws Exception { 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 354b9c6a6..fbc2cf67e 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 void testCherryPickOurCommitName() throws Exception { } } - 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 6f7df4bd8..9af003d42 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 @@ private static boolean canExecute(Git git, String path) { .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 e0c149903..1af37e25f 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 void testPrePushHook() throws JGitInternalException, IOException, } } - 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 ea631045c..d77c4e131 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 void testRevertOurCommitName() throws Exception { } } - 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 b9f9f5b49..3b582d714 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 void setUp() throws Exception { 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 @@ private TreeWalk createTreeWalk() { 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 @@ private List diffWorkingAgainstHead(final RevCommit commit) } } - 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 @@ private List diffIndexAgainstHead(final RevCommit commit) } } - 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 49e5d1b3d..0e344f5f2 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 void testNoNewLine2() throws IOException { 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 @@ private void assertFormatted() throws IOException { 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 @@ private byte[] readFile(final String patchFile) throws IOException { } } - 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 80d432985..0b261840c 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 @@ private static void assertV3TreeEntry(int indexPosition, String path, 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 05fa00790..86e285287 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 void testCopyMetaDataWithoutStage() { 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 ef3e61144..dfc136ce2 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 void testPath_16384() throws Exception { 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 @@ private void testLongPath(final int len) throws CorruptObjectException, } } - 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 4813d2801..2895b3026 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 @@ private static void whackCache() { 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 @@ private File[] pack(final Repository src, final RevObject... list) } } - 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 @@ private static void write(final File[] files, final PackWriter pw) 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 @@ private static void delete(final File[] list) throws IOException { 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 @@ private static void touch(final long begin, final File dir) { } } - 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 128c1edde..04fccf356 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 @@ private static void objectHeader(TemporaryBuffer.Heap pack, int type, int sz) 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 3711f8365..ed427d889 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 @@ private void createVerifyOpenPack(final Set interestings, 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 @@ private void createVerifyOpenPack(final List objectSource) 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 @@ private void verifyOpenPack(final boolean thin) throws IOException { 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 592d0c867..757ebb298 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 @@ private void writeSymref(String src, String dst) throws IOException { } } - 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 91255007e..a549d32df 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 @@ private ObjectId insertTree(TreeFormatter tree) throws IOException { } } - 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 @@ private RevCommit parseCommit(AnyObjectId id) } } - 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 9ac794ed8..bee11cd71 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 void testCache_TooSmallLimit() throws IOException { 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 1684afa4e..ae52ad591 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 @@ private static ReceiveCommand command(AnyObjectId a, AnyObjectId b, 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 boolean apply(ObjectReader reader, RefTree tree) }); } - 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 87bb08248..1ecdf21d4 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 void isRebase() { 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 7862005eb..c4c4da816 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 @@ private static void assertReadLong(long exp, String act) 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 22c66cec1..b8e8a12d5 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 @@ private void checkOneName(String name) throws CorruptObjectException { 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 @@ private void assertSkipListRejects(String msg, int type, byte[] data) { 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 d431a8910..87e901fcf 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.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 @@ private static void setUnixSystemReader() { }); } - 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 4948b373d..19f6dcbc5 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 void testRevert() throws Exception { 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 ee99aa137..aaa08a9e3 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 @@ void modifyIndex(IndexState indexState, String path, String other) } } - 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 951568e7b..dd2c2e84b 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 void testTrivialTwoWay_rightDFconflict2() throws Exception { 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 6027aff71..6c107f983 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 void testTypes() throws IOException { 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 7b4e01444..24fbda1ad 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 void testParseAbbrIndexLine_NoMode() { 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 8da199f7c..7b5868a39 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 @@ private Patch parseTestPatchFile() throws IOException { } } - 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 87c854781..ad8327ff4 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 void testMatchesBugId() throws IOException { 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 9fc96212c..cfefac3aa 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 void testParse_NoParents() throws Exception { 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 void testParse_GitStyleMessageWithCRLF() throws Exception { 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 8e9507961..e11cef7c9 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 void testTagTag() throws Exception { 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 void testParseOldStyleNoTagger() throws Exception { 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 void testParse_PublicParseMethod() throws CorruptObjectException { 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 ab2705cbe..70050270d 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 void setUp() throws Exception { 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 6ec529c31..b55a45aa6 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.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 631e3956f..70b4e154a 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 void setUp() throws Exception { } } - 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 @@ protected void check(final RevCommit... order) throws Exception { 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 f12cc0872..544398219 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 @@ protected Date getDate() { 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 @@ protected RevCommit commit(final int secDelta, final RevTree tree, 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 @@ protected CommitBuilder commitBuilder() 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 10bea0a8b..a26ae10af 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 void withCommitLoadedByDifferentRevWalk() throws Exception { } } - 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 76404aba9..4e5d56acb 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 void setUp() throws Exception { 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 886f577d9..abf80ecd4 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 void setUp() throws Exception { 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 982bae839..8b1d86005 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 void testReadACK_ERR() throws IOException { // 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 dd9a0d3bb..391a701b8 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 void flush() throws IOException { 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 a0cf0d2db..9aabd71d9 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 void setUp() throws Exception { 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 457161960..4d3e16224 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 void testConstructor_RejectsBadBufferSize() throws Exception { } } - 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 f5e97c2dc..57eec0b58 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 void setUp() throws Exception { 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 e34cb9779..0e009b954 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 @@ private static void assertEntry(String sha1string, String path, TreeWalk tw) 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 717a2f3b2..fc79d4586 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 FileTreeIteratorWithTimeControl(File f, FS fs, } @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 6ad47c295..87fe00b1c 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 void testWithPostOrder_NoEnterSubtree() throws Exception { } } - 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 8e2cca44a..d9cfb622a 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 @@ public TreeFilter clone() { } @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 6fed23305..81467c2d0 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 void testIndexOfChangeId() { "\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 a680ef9f9..e34c3cebd 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 void testFailedPreCommitHookBlockCommit() throws Exception { } } - 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 d2d44ffdc..830f20e5c 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 void testEncodeInt64() { 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 @@ private static void assertOutput(final byte[] expect, final byte[] buf, 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 @@ private static byte[] b(int a, int b, int c) { 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 65078763e..49ad55f42 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.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 7463528b5..17f1b77e0 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.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 a6f33451c..9a0c96e17 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.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 f5b56e7b7..f3c046d4a 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 void testInt4_1() { 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 5a1468a8b..d124d7365 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 @@ private static RefList toList(Ref... refs) { 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 bccf0c02f..dcf27b4a7 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 @@ protected void drawBoundaryDot(final int x, final int y, final int w, /** {@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 @@ protected void drawText(final String msg, final int x, final int y) { /** {@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 d122a7728..3f9217d1c 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 PlotCommitList getCommitList() { /** {@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 int getRowCount() { } @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 Component getTableCellRendererComponent(final JTable table, } @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 743eb7839..10519ca9c 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 @@ protected SwingLane createLane() { /** {@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 f45e39e06..65b72f7d9 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 CherryPickCommand setOurCommitName(String ourCommitName) { * @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 6084375e3..a05d96255 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 @@ private FetchResult fetch(Repository clonedRepo, URIish u) 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 @@ private void addMergeConfig(Repository clonedRepo, Ref head) 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 be446f944..31987036a 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 @@ else if (repo.readSquashCommitMsg() != null) } } - 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 5f7928d4d..01d070cbd 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 StashApplyCommand(final Repository repo) { * 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 cd8f8e6c9..7f02aabc0 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 StashDropCommand(Repository repo) { * 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 StashDropCommand setStashRef(final int stashRef) { * {@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 @@ private Ref getRef() throws GitAPIException { } } - 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 @@ private RefUpdate createRefUpdate(final Ref stashRef) throws IOException { 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 6451b709f..f316b2366 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 1aa050f56..9538d2be6 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 SubmoduleAddCommand(final Repository repo) { * (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 SubmoduleAddCommand setPath(final String path) { * 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 SubmoduleAddCommand setURI(final String uri) { * 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 6af27d704..2db12b8e2 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 SubmoduleInitCommand(final Repository repo) { * (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 5c2186420..0606c5b8d 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 SubmoduleStatusCommand(final Repository repo) { * (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 462543d3b..7cf4b73af 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 SubmoduleSyncCommand(final Repository repo) { * (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 SubmoduleSyncCommand addPath(final String path) { * @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 289ef4a8f..398f21ebc 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 SubmoduleUpdateCommand setProgressMonitor( * @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 SubmoduleUpdateCommand setFetch(final boolean fetch) { * (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 9c915377d..d34bb5d4c 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 @@ protected final C self() { * 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 @@ protected C configure(final Transport transport) { * 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 517b51266..b12c032f8 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 StashApplyFailureException(String message, Throwable cause) { * @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 063cefffa..21dca6b78 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 static enum RenameDetectionType { 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 2e29b8177..7aaa50030 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 @@ private void setReader(ObjectReader reader, Config cfg, boolean closeReader) { * 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 void setContext(final int lineCount) { * @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 @@ private static String quotePath(String name) { * @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 void format(final FileHeader head, final RawText a, final RawText b) * 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 void format(final EditList edits, final RawText a, final RawText b) * 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 @@ private static boolean isEndOfLineMissing(final RawText text, final int line) { * 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 @@ protected void writeAddedLine(final RawText text, final int line) * 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 @@ protected void writeHunkHeader(int aStartLine, int aEndLine, 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 @@ private void formatOldNewPaths(ByteArrayOutputStream o, DiffEntry ent) 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 @@ private int findCombinedEnd(final List edits, final int i) { 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 775d11a46..5c876e87f 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 static enum Type { * @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 Edit(final int as, final int bs) { * @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 int hashCode() { /** {@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 04c79fcd1..3f813d811 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 @@ private boolean scanA() { 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 @@ private static int recCnt(long rec) { 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 ed2eebb85..1e68c2f41 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 boolean equals(RawText a, int ai, RawText b, int bi) { } @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 boolean equals(RawText a, int ai, RawText b, int bi) { } @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 boolean equals(RawText a, int ai, RawText b, int bi) { } @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 boolean equals(RawText a, int ai, RawText b, int bi) { } @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 0228f4d3c..aa229f79b 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 @@ public DirCache getDirCache() { * @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 @@ protected void fastAdd(final DirCacheEntry newEntry) { * @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 db1cfd554..752c01758 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 static DirCache read(ObjectReader reader, AnyObjectId treeId) * 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 static DirCache read(final Repository repository) * 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 static DirCache read(final File indexLocation, final FS fs) * 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 static DirCache lock(final File indexLocation, final FS fs, * 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 void clear() { 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 @@ private void skipOptionalExtension(final InputStream in, } } - 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 boolean commit() { 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 void unlock() { * 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 @@ else if (cmp == 0) { * 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 int getEntryCount() { * 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 DirCacheEntry getEntry(final int i) { * 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 @@ void toArray(final int i, final DirCacheEntry[] dst, final int off, * @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 DirCacheTree getCacheTree(final boolean build) { * @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 6e3682a3e..e80544e48 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 DirCacheBuildIterator(final DirCacheBuilder dcb) { /** {@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 2ff7bb9ae..c5ff9ac41 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 @@ protected DirCacheBuilder(final DirCache dc, final int ecnt) { * @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 void add(final DirCacheEntry newEntry) { * @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 void finish() { 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 30e3a3cf1..74ba97fb8 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 @@ 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 int compare(final PathEdit o1, final PathEdit o2) { * 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 @@ protected DirCacheEditor(final DirCache dc, final int ecnt) { * @param edit * another edit command. */ - public void add(final PathEdit edit) { + public void add(PathEdit edit) { edits.add(edit); } @@ -304,7 +304,7 @@ public abstract static class PathEdit { * @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 PathEdit(final String entryPath) { * 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 static final class DeletePath extends PathEdit { * @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 DeletePath(final String entryPath) { * 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 @@ private static byte[] appendSlash(byte[] path) { } @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 7c03c6494..19408b059 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 DirCacheEntry(final String newPath) { * 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 DirCacheEntry(final String newPath, final int stage) { * "\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 DirCacheEntry(final byte[] newPath) { * 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 @@ void write(final OutputStream os) throws IOException { * 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 boolean isAssumeValid() { * 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 FileMode getFileMode() { * {@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 long getCreationTime() { * @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 long getLastModified() { * @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 int getLength() { * 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 void setLength(final int sz) { * @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 ObjectId getObjectId() { * {@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 void setObjectId(final AnyObjectId id) { * @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 String toString() { * @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 @@ boolean isExtended() { 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 d768216db..575b9a25f 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 DirCacheIterator(final DirCache dc) { /** {@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 dc825d4dc..e9f1fcd92 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 int getChildCount() { * 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 @@ private int computeSize(final DirCacheEntry[] cache, int cIdx, 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 @@ void validate(final DirCacheEntry[] cache, final int cCnt, int cIdx, 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 @@ private void insertChild(final int stIdx, final DirCacheTree st) { 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 @@ static boolean peq(final byte[] a, final byte[] b, int aLen) { 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 @@ private static int namecmp(final byte[] a, int aPos, final DirCacheTree ct) { 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 62ff99088..7192138b1 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 @@ 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 @@ private static String format(final Collection causes) { * @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 a7e1d02b4..24f43cfcd 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 ConfigInvalidException(final String message) { * @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 8dd0d539f..b97d237b2 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 a6471217e..785cb95bf 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 7ba3a006d..5abd0c347 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 IncorrectObjectTypeException(final ObjectId id, final String type) { * @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 70f650dde..e07d30820 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 IndexReadException() { * @param s * message */ - public IndexReadException(final String s) { + public IndexReadException(String s) { super(s); } @@ -75,7 +75,7 @@ public IndexReadException(final String s) { * @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 de19c0668..34fd7a894 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 IndexWriteException() { * * @param s message */ - public IndexWriteException(final String s) { + public IndexWriteException(String s) { super(s); } @@ -70,7 +70,7 @@ public IndexWriteException(final String s) { * @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 09bb4a914..9efc21e7c 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 @@ 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 f6aa092db..c6c47f959 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 MissingObjectException(final ObjectId id, final String type) { * @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 MissingObjectException(final ObjectId id, final int type) { * @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 28e978897..8c2e87297 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 fe073d564..524968d52 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 124680ecc..114e662fb 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 NotSupportedException(final String s) { * @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 8af1991b1..bbee42f18 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 ObjectWritingException(final String s) { * @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 9886e15dd..a83de0626 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 PackInvalidException(final File path) { * @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 5b9a4b93b..ea1e65b22 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 44bc16492..dd13740f1 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 PackProtocolException(final URIish uri, final String s, * @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 PackProtocolException(final String s) { * @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 aabb46ad4..04fd8ea6d 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 RepositoryNotFoundException(final File location) { * @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 RepositoryNotFoundException(final File location, Throwable why) { * @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 RepositoryNotFoundException(String location, Throwable why) { 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 82654e8bd..f6852b59f 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 60d7aa098..dc59c8c32 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 86dea8284..5fecf0ea5 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 TransportException(final URIish uri, final String s, * @param s * message */ - public TransportException(final String s) { + public TransportException(String s) { super(s); } @@ -102,7 +102,7 @@ public TransportException(final String s) { * @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 4fc534b94..6de9153c0 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 88c2ef623..9bab68797 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 0b7ccf577..0a4fef11f 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 23611867b..cbf8f3a6d 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 98aee0eef..7039c3d61 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 56630395b..bfcc580ba 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 @@ private static AbstractHead createWildCardHead( * @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 @@ private static int indexOfUnescaped(final String searchString, * 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 965d90085..eb98a3acd 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 c132e2815..2068b0d89 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 c806e2313..07362aa96 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 8b8df8797..80fd3cf1a 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 RepoCommand setRecommendShallow(boolean enable) { * 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 RepoCommand setIgnoreRemoteFailures(boolean ignore) { * 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 RepoCommand setAuthor(final PersonIdent author) { * 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 1908d6c98..d1d4f67d8 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 String newLeaderTag() { * @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 9c37a90ce..7ddde6337 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 @@ void initialize(Repository repo) throws IOException { /** {@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 674da1fc6..b61274ef4 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 @@ protected String describeForLog() { /** {@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 14dc80fc9..46879529b 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 static DfsBlockCache getInstance() { 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 @@ int getBlockSize() { 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 cd7901b35..dd7cb89c9 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 long getBlockLimit() { * 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 int getBlockSize() { * 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 DfsBlockCacheConfig setStreamRatio(double ratio) { * 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 1220b122b..0d9e2c1d7 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 @@ private int encodeTypeSize(int type, long rawLength) { } @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 bf14d18e3..2ea5c3976 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 int getStreamFileThreshold() { * {@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 338df4a8e..07b607c18 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 @@ protected int copy(final int p, final byte[] b, final int o, int n) { /** {@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 4dcf133e0..343d36922 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 @@ void write(PackOutputStream out, long pos, int cnt) /** {@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 7963ceac4..a3146dbb5 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 e810ae0e2..945e97950 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 @@ void resolve(Set matches, AbbreviatedObjectId id) /** {@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 b3979894e..b464a1b79 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 @@ private void releaseMemory() { } } - private void moveToHead(final Slot e) { + private void moveToHead(Slot e) { unlink(e); e.lruPrev = null; e.lruNext = lruHead; @@ -147,7 +147,7 @@ private void moveToHead(final Slot e) { 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 @@ private void unlink(final Slot e) { 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 9bbf7466b..f174e491a 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 FileRepository(final File gitDir) throws IOException { * 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 FileRepository(final String gitDir) throws IOException { * 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 @@ private Set getAdditionalHaves(Set skips) { * 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 2165aa2b7..10adc6ccc 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 String toString() { + ", 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 @@ private boolean notRacyClean(final long read) { 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 80d67cf6a..a11e4ffdf 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 boolean accept(File dir, String name) { * @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 void copyCurrentContent() throws IOException { * 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 void write(final ObjectId id) throws IOException { * 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 OutputStream getOutputStream() { 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 @@ void requireLock() { * @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 void setNeedStatInformation(final boolean on) { * @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 void setNeedSnapshot(final boolean on) { * @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 92b53ad44..4cab5f8bb 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 Collection getPacks() { * 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 @@ Set getShallowCommits() throws IOException { return shallowCommitsIds; } - private void insertPack(final PackFile pf) { + private void insertPack(PackFile pf) { PackList o, n; do { o = packList.get(); @@ -837,7 +837,7 @@ private void insertPack(final PackFile pf) { } 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 @@ private void removePack(final PackFile deadPack) { 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 @@ private static int indexOf(final PackFile[] list, final PackFile pack) { return -1; } - private PackList scanPacks(final PackList original) { + private PackList scanPacks(PackList original) { synchronized (packList) { PackList o, n; do { @@ -882,7 +882,7 @@ private PackList scanPacks(final PackList original) { } } - 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 @@ private PackList scanPacksImpl(final PackList old) { 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 @@ private AlternateHandle[] loadAlternates() throws IOException { 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 e06f72167..e6ae9686a 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 @@ private ObjectId insert( /** {@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 b5a4d5c3f..0cec2d5a8 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 void setIndexVersion(int version) { * @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 @@ private void writeIdx() throws IOException { } } - 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 d5219c7a0..c32ba3601 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 int compare(final PackFile a, final PackFile b) { * @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 String getPackName() { * @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 @@ LocalObjectRepresentation representation(final WindowCursor curs, } } - 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 e324c1f52..72699b043 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 static PackIndex read(InputStream fd) throws IOException, 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 @@ private static boolean isTOC(final byte[] h) { * 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 boolean contains(AnyObjectId id) { * 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 8ea31e4fa..66d35bd90 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 @@ public long getOffset64Count() { 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 @@ private int findLevelOne(final long nthPosition) { 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 @@ long getOffset(long nthPosition) { /** {@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 9f6201f9a..a9606cfa2 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 @@ public long getOffset64Count() { 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 @@ private int findLevelOne(final long nthPosition) { 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 @@ public ObjectId getObjectId(final long nthPosition) { /** {@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 @@ public long getOffset(final long nthPosition) { /** {@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 @@ public long findOffset(final AnyObjectId objId) { 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 @@ private static int idOffset(int p) { 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 b92f7b207..61bb902a9 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 static PackIndexWriter createVersion(final OutputStream dst, * 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 void write(final List toStore, * @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 7ff269694..0ce3cc93c 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 @@ private int encodeTypeSize(int type, long rawLength) { } @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 82f0da1c8..0fb8911ba 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 944af26dc..fb7eddf6b 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 PackReverseIndex(final PackIndex packIndex) { * 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 ObjectId findObject(final long offset) { * @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 @@ int findPostion(long offset) { 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 198775cc1..8e3357fdc 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 Ref exactRef(String name) throws IOException { /** {@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 @@ private void scanOne(String name) { /** {@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 Ref peel(final Ref ref) throws IOException { 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 @@ private ObjectIdRef doPeel(final Ref leaf) throws MissingObjectException, } } - 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 @@ private PackedRefList readPackedRefs() throws IOException { } } - 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 @@ private RefList parsePackedRefs(final BufferedReader br) 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 @@ LooseRef scanRef(LooseRef ref, String name) throws IOException { 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 @@ static void delete(final File file, final int depth) throws IOException { 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 4d6b24570..fb839dff6 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 @@ protected void unlock() { /** {@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 @@ private String toResultString(Result status) { /** {@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 @@ protected Result doDelete(final Result status) throws IOException { /** {@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 e71284fb6..c03fb2f83 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 @@ private static final int bits(int newSize) { * 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 @@ static final void purge(final PackFile pack) { 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 long getOpenBytes() { 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 @@ private ByteWindow load(final PackFile pack, final long offset) } } - 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 @@ private boolean isFull() { 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 @@ private static int tableSize(final WindowCacheConfig cfg) { 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 @@ private static int lockCount(final WindowCacheConfig cfg) { * 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 @@ private ByteWindow getOrLoad(final PackFile pack, final long position) 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 @@ private ByteWindow scan(Entry n, final PackFile pack, final long position) { 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 @@ private void removeAll() { * @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 @@ private void gc() { } } - 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 d9cbbd8f8..23055ee95 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 2565931e0..c7e5ad623 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 static long getBaseSize(final byte[] delta) { * 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 static long getResultSize(final byte[] delta) { * 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 969d02b94..944a9e5e4 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 @@ private void scan(byte[] raw, final int end) { } 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 73b285afc..a047534fb 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 @@ private void searchInWindow() throws IOException { 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 e8c75107b..a30bf982f 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 fd9c1a00d..7f38a7b51 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 PackOutputStream(final ProgressMonitor writeMonitor, /** {@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 void write(final int b) throws IOException { /** {@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 490766b8f..f5e600d55 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 static Iterable getInstances() { * @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 PackWriter(final Repository repo) { * @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 PackWriter(final ObjectReader reader) { * @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 PackWriter(final Repository repo, final ObjectReader reader) { * @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 boolean isThin() { * 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 boolean isIgnoreMissingUninteresting() { * 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 void preparePack(ProgressMonitor countingMonitor, * @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 int getIndexVersion() { * @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 void writeIndex(final OutputStream indexStream) throws IOException { * @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 @@ private void writeDeltaObjectDeflate(PackOutputStream out, 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 @@ private static void pruneEdgesFromObjectList(List list) { * @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 e9aa11041..5751dd6fa 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 @@ private static boolean isValidRef(Command cmd) { 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 425f7f689..6acc684bc 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 static final AbbreviatedObjectId fromObjectId(AnyObjectId id) { * 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 ObjectId toObjectId() { * >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 int prefixCompare(final AnyObjectId other) { * >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 int prefixCompare(final byte[] bs, final int p) { * >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 int getFirstByte() { 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 int hashCode() { /** {@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 91c9a6b04..e7d465b12 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 final int getByte(int index) { * 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 final int compareTo(final AnyObjectId other) { * @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 final int compareTo(final byte[] bs, final int p) { * @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 final int compareTo(final int[] bs, final int p) { * 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 final int hashCode() { * 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 final boolean equals(final Object o) { * @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 void copyRawTo(final ByteBuffer w) { * @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 void copyRawTo(final byte[] b, final int o) { * @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 void copyRawTo(final int[] b, final int o) { * @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 void copyRawTo(final OutputStream w) throws IOException { 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 @@ private static void writeRawInt(final OutputStream w, int v) * @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 @@ private byte[] toHexByteArray() { 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 @@ private static void formatHexByte(final byte[] dst, final int p, int w) { * @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 void copyTo(final Writer w) throws IOException { * @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 void copyTo(final char[] tmp, final Writer w) throws IOException { * @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 @@ private char[] toHexCharArray() { 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 final String getName() { * 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 6919f7ef0..5e1755370 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 PersonIdent getRefLogIdent() { * 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 f44aeceb5..e008be3a3 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 596da0349..be53c4b4f 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 boolean matchConfigValue(String s) { * @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 2217fde04..59a13f655 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 String getMessage() { * @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 285a56c87..f59cc6961 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 > T getEnum(final String section, } @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 List getRefSpecs(String section, String subsection, * 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 Set getNames(String section, String subsection, * @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 T get(final SectionParser parser) { * 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 String toText() { * 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 @@ private ConfigSnapshot newState() { getBaseState()); } - private ConfigSnapshot newState(final List entries) { + private ConfigSnapshot newState(List entries) { return new ConfigSnapshot(Collections.unmodifiableList(entries), getBaseState()); } @@ -1210,7 +1210,7 @@ protected boolean isUtf8(final byte[] bytes) { && 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 @@ private static String readSectionName(final StringReader in) 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 @@ private static String readSubsectionName(StringReader in) 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 d5f1d8f08..011ceccca 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 @@ boolean match(final String aSection, final String aSubsection) { && 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 @@ private static boolean eqIgnoreCase(final String a, final String b) { 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 5c7cee6ca..a119480ea 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 static MessageDigest newMessageDigest() { * @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 static String typeString(final int typeCode) { * @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 static int decodeTypeString(final AnyObjectId id, * @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 static byte[] encodeASCII(final long s) { * 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 static byte[] encodeASCII(final String s) { * 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 32a894f79..98de3a91c 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 static enum HideDotFiles { 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 68f881dd1..89aef7fcf 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 long getTimeUnit(Config config, String section, String subsection, } } - 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 785237164..d4c4d5b40 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 boolean equals(final int modeBits) { 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 boolean equals(final int modeBits) { 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 boolean equals(final int modeBits) { 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 boolean equals(final int modeBits) { 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 boolean equals(final int modeBits) { 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 boolean equals(final int modeBits) { * 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 static final FileMode fromBits(final int bits) { 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 boolean equals(final int a) { 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 @@ private FileMode(int mode, final int expType) { * 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 @@ private FileMode(int mode, final int expType) { * @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 fbdffbc48..94b9ddc18 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 Set getUntrackedFolders() { * @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 FileMode getIndexMode(final String path) { * 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 a97721c73..dd0f18e16 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 @@ private synchronized static Inflater getImpl() { * 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 static void release(final Inflater i) { } } - 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 e492af94b..8cf0fd05c 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 void fromObjectId(AnyObjectId src) { * 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 void fromRaw(final byte[] bs) { * @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 void fromRaw(final byte[] bs, final int p) { * 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 void fromRaw(final int[] ints) { * @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 void set(int a, int b, int c, int d, int e) { * @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 void fromString(final byte[] buf, final int offset) { * @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 a6d2c3f22..689659b39 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 BlobObjectChecker newBlobObjectChecker() { * @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 bbef51da2..3abdc0c41 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 void create() throws IOException { * @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 boolean has(final AnyObjectId objectId) throws IOException { * @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 0e8554553..764f89015 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 static final ObjectId zeroId() { * 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 static final boolean isId(final String id) { * 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 static boolean equals(final byte[] firstBuffer, final int fi, * 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 static final ObjectId fromRaw(final byte[] bs) { * 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 static final ObjectId fromRaw(final byte[] bs, final int p) { * 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 static final ObjectId fromRaw(final int[] is) { * 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 static final ObjectId fromRaw(final int[] is, final int p) { * 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 static final ObjectId fromString(final byte[] buf, final int offset) { * 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 ObjectId(int new_1, int new_2, int new_3, int new_4, int new_5) { * @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 03a430cab..9df593375 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 void clear() { * @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 V get(final AnyObjectId toFind) { * 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 boolean contains(final AnyObjectId toFind) { * @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 void add(final Q newValue) { * {@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 001aa9cdd..cd57bda82 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 void clear() { * 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 V get(final AnyObjectId toFind) { * 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 boolean contains(final AnyObjectId toFind) { * @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 void add(final Q newValue) { * 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 void remove() { }; } - 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 @@ private void initTable(int sz) { } @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 40522ba24..77fa1b234 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 final ObjectId insert(TagBuilder builder) throws IOException { * @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 64f2a6fc6..2e52f031c 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 void copyTo(OutputStream out) throws MissingObjectException, } } - 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 18a11f001..c16a2b6ab 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 static void appendSanitized(StringBuilder r, String str) { * * @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 PersonIdent(final Repository repo) { * @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 PersonIdent(final PersonIdent pi) { * @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 PersonIdent(String aName, String aEmailAddress, * @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 PersonIdent(final PersonIdent pi, final Date when, final TimeZone tz) { * @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 PersonIdent(final String aName, final String aEmailAddress, * @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 @@ private PersonIdent(final String aName, final String aEmailAddress, .getTimezone(when)); } - private PersonIdent(final UserConfig config) { + private PersonIdent(UserConfig config) { this(config.getCommitterName(), config.getCommitterEmail()); } @@ -370,7 +370,7 @@ public int hashCode() { /** {@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 395bb323d..b00055894 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 static enum Storage { 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 43d2f3766..8bcac0087 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 int compare(final Ref o1, final Ref o2) { * 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 static int compareTo(Ref o1, String o2) { * 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 3d22bb0fc..a05daa00a 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 PersonIdent getRefLogIdent() { * 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 String getRefLogMessage() { * @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 06a7576db..5cd593ed5 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 static enum Result { * @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 boolean isDetachingSymbolicRef() { * @param id * the new value. */ - public void setNewObjectId(final AnyObjectId id) { + public void setNewObjectId(AnyObjectId id) { newValue = id.copy(); } @@ -377,7 +377,7 @@ public ObjectId getExpectedOldObjectId() { * 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 boolean isForceUpdate() { * @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 PersonIdent getRefLogIdent() { * automatically determined based on the repository * configuration. */ - public void setRefLogIdent(final PersonIdent pi) { + public void setRefLogIdent(PersonIdent pi) { refLogIdent = pi; } @@ -461,7 +461,7 @@ protected boolean isRefLogIncludingResult() { * 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 Result update() throws IOException { * @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 Result delete() throws IOException { * @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 Result link(String target) throws IOException { } } - 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 9b5085189..e7e2b0034 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 static ListenerList getGlobalListenerList() { * @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 boolean hasObject(AnyObjectId objectId) { * 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 ObjectLoader open(AnyObjectId objectId, int typeHint) * 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 RefUpdate updateRef(final String ref) throws IOException { * 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 RefUpdate updateRef(final String ref, final boolean detach) throws IOExce * 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 RefRename renameRef(final String fromRef, final String toRef) throws IOEx * 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 ObjectId resolve(final String revstr) * @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 String simplify(final String revstr) } @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 @@ private RevObject parseSimple(RevWalk rw, String revstr) throws IOException { } @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 @@ private RevCommit resolveReflog(RevWalk rw, Ref ref, String time) } @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 Map getTags() { * (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 RepositoryState getRepositoryState() { * @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 5e902c988..400342b1b 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 static Repository open(final Key location) throws IOException, * 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 static Repository open(final Key location, final boolean mustExist) * @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 static void register(final Repository db) { * @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 static void close(@NonNull final Repository db) { * 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 @@ private Repository openRepository(final Key location, 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 @@ private boolean isExpired(Repository db) { && (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 @@ private void clearAll() { } } - private Lock lockFor(final Key location) { + private Lock lockFor(Key location) { return openLocks[(location.hashCode() >>> 1) % openLocks.length]; } @@ -383,7 +383,7 @@ public static class FileKey implements Key { * @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 static FileKey exact(final File directory, FS fs) { * @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 static FileKey lenient(final File directory, FS fs) { * 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 final File getFile() { } @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 int hashCode() { } @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 String toString() { * 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 @@ private static String readFirstLine(final File head) { * @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 32ef50480..bd0316580 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 String getMessage() { * @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 1a3c6f6bd..bfb5e2fc1 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 520ea6e74..98a706c6a 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 static synchronized void register(final String name, * 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 cd19d696a..25eb1af12 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 void setObjectInserter(ObjectInserter oi) { * 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 boolean merge(final AnyObjectId... tips) throws IOException { * 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 @@ protected RevCommit getBaseCommit(RevCommit a, RevCommit b) * @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 17a3d6194..a908db7a1 --- 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 @@ private RawText getRawText(ObjectId id, 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 979685c40..6e2e2aad0 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 String getName() { /** {@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 5739d58b3..08f0a8a62 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 String getName() { /** {@inheritDoc} */ @Override - public ThreeWayMerger newMerger(final Repository db) { + public ThreeWayMerger newMerger(Repository db) { return new InCoreMerger(db); } @@ -182,11 +182,11 @@ else if (modeB == modeT && tw.idEqual(T_BASE, T_THEIRS)) } } - 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 @@ private void add(final int tree, final int stage) throws IOException { } } - 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 3f2882009..2fc0f4f07 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 @@ protected ThreeWayMerger(final Repository local) { * @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 @@ protected ThreeWayMerger(ObjectInserter inserter) { * @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 void setBase(final AnyObjectId id) throws MissingObjectException, /** {@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 1be525162..6723b6309 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 @@ private TreeFormatter build() { 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 1afb53da8..0f8f7aad0 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 FileMode getOldMode() { * 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 AbbreviatedObjectId getOldId() { * 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 String getScriptText(final Charset ocs, final Charset ncs) { * 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 @@ int parseGitHeaders(int ptr, final int end) { /** {@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 @@ protected void parseIndexLine(int ptr, final int eol) { /** {@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 @@ HunkHeader newHunkHeader(final int offset) { 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 @@ private void parseModeLine(int ptr, final int eol) { 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 bbf802317..3f27bb3b2 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 OldImage getOldImage() { * 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 5cfbbb2d8..32cf64230 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 static enum PatchType { * @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 @@ String getScriptText(Charset[] charsetGuess) { 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 @@ private static boolean trySimpleConversion(final Charset[] charsetGuess) { 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 @@ int parseTraditionalHeaders(int ptr, final int end) { 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 da123a7c2..3a77387f2 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 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 List getFiles() { * @param err * the error description. */ - public void addError(final FormatError err) { + public void addError(FormatError err) { errors.add(err); } @@ -146,12 +146,12 @@ public List getErrors() { * @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 @@ private static byte[] readFully(final InputStream is) throws IOException { * 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 @@ private int parseFile(final byte[] buf, int c, final int end) { 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 @@ private int parseTraditionalPatch(final byte[] buf, final int start, 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 @@ && matchAny(buf, c, BIN_HEADERS)) { 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 f88b819d4..c12acb40c 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 @@ protected void paintCommit(final PlotCommit commit, final int h) { */ 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 @@ protected abstract void drawLine(TColor color, int x1, int y1, int x2, */ 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 091bf683a..fecc48d55 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 @@ void addMergingLane(final PlotLane m) { 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 final int getChildCount() { * @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 final PlotCommit getChild(final int nth) { * 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 final int getRefCount() { * @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 6a0ba66ba..d952fa67e 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 void clear() { /** {@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 void findPassingThrough(final PlotCommit currCommit, /** {@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 @@ protected void enter(final int index, final PlotCommit currCommit) { 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 @@ private void closeLane(PlotLane lane) { } } - 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 @@ protected L createLane() { * @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 8ba8d6e4c..f27f356c6 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 void dispose() { * @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 void addAdditionalRefs(Iterable refs) throws IOException { /** {@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 void sort(final RevSort s, final boolean use) { /** {@inheritDoc} */ @Override - protected RevCommit createCommit(final AnyObjectId id) { + protected RevCommit createCommit(AnyObjectId id) { return new PlotCommit(id); } @@ -140,7 +140,7 @@ public RevCommit next() throws MissingObjectException, 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 b948adb42..247a3bdb2 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 @@ public final void add(final RevCommit c, final RevFlag queueControl) { * @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 @@ int outputType() { * @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 74a351108..31612ff66 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 @@ protected BlockRevQueue() { * 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 c993fe50a..795bdf195 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 DateRevQueue() { /** {@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 String toString() { 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 @@ private Entry newEntry(final RevCommit c) { 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 63b799060..1bb8715a3 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 FIFORevQueue() { /** {@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 void add(final RevCommit c) { * @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 2da97c891..567c8465c 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 String getPath() { /** {@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 360be298e..45d5f809b 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 074ce8275..d6fed6670 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 f734b693e..cbffd91d7 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 LIFORevQueue() { /** {@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 73ce9854e..755df58cf 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 @@ void init(final AbstractRevQueue p) throws IOException { } } - 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 25c3e1224..e5903c911 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 void dispose() { /** {@inheritDoc} */ @Override - protected void reset(final int retainFlags) { + protected void reset(int retainFlags) { super.reset(retainFlags); for (RevObject obj : rootObjects) @@ -711,7 +711,7 @@ protected void reset(final int retainFlags) { 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 @@ private void addObject(final RevObject o) { } } - 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 d3529292e..cc5e3e40d 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 5c8371f91..14222e9d5 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 static RevCommit parse(RevWalk rw, byte[] raw) throws IOException { * @param id * object name for the commit. */ - protected RevCommit(final AnyObjectId id) { + protected RevCommit(AnyObjectId id) { super(id); } @@ -310,7 +310,7 @@ private static void carryOneStep(FIFORevQueue q, int carry, RevCommit c) { * @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 final int getParentCount() { * @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 final List getFooterLines() { * 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 final List getFooterLines(final String keyName) { * 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 38cf3f510..d2fda2f91 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 void clear() { * 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 void applyFlag(final RevFilter matching, final RevFlag flag, * 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 void clearFlag(final RevFlag flag, final int rangeBegin, * @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 int indexOf(final RevFlag flag, int begin) { * @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 int lastIndexOf(final RevFlag flag, int begin) { * 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 boolean isPending() { * 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 void fillTo(final int highMark) throws MissingObjectException, * 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 void fillTo(final RevCommit commitToLoad, int highMark) * @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 9740d1417..45a730cfd 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 RevFlagSet() { * @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 RevFlagSet(final RevFlagSet s) { * @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 boolean contains(final Object o) { /** {@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 boolean containsAll(final Collection c) { /** {@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 boolean add(final RevFlag flag) { /** {@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 4a88105d1..1c76fe9c1 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 final ObjectId getId() { * 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 final boolean has(final RevFlag flag) { * @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 final boolean hasAny(final RevFlagSet set) { * @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 final boolean hasAll(final RevFlagSet set) { * @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 final void add(final RevFlag flag) { * @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 final void add(final RevFlagSet set) { * @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 final void remove(final RevFlag flag) { * @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 String toString() { * @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 2bb442718..42f26d267 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 RevObjectList() { /** {@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 cbeda71a8..e7fe0f73b 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 static RevTag parse(RevWalk rw, byte[] raw) * @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 92b81a17d..e7de270f6 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 91c15a1e7..cf278bbbe 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 void close() { * @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 void markStart(final RevCommit c) throws MissingObjectException, * @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 void markStart(final Collection list) * @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 void markUninteresting(final RevCommit c) * @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 boolean hasRevSort(RevSort sort) { * @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 void sort(final RevSort s) { * 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 RevFilter getRevFilter() { * @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 TreeFilter getTreeFilter() { * 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 boolean isRetainBody() { * @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 void setRetainBody(final boolean retain) { * @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 RevBlob lookupBlob(final AnyObjectId id) { * @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 RevTree lookupTree(final AnyObjectId id) { * @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 RevCommit lookupCommit(final AnyObjectId id) { * @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 RevTag lookupTag(final AnyObjectId id) { * @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 RevObject lookupOrNull(AnyObjectId id) { * 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 RevCommit parseCommit(final AnyObjectId id) * 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 @@ else if (!(c instanceof RevTree)) * 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 RevTag parseTag(final AnyObjectId id) throws MissingObjectException, * 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 void release() { * @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 void parseHeaders(final RevObject obj) * @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 RevObject peel(RevObject obj) throws MissingObjectException, * @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 @@ int allocFlag() { * @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 void carry(final RevFlag flag) { * @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 final void retainOnReset(Collection flags) { * @param flag * the to recycle. */ - public void disposeFlag(final RevFlag flag) { + public void disposeFlag(RevFlag flag) { freeFlag(flag.mask); } @@ -1244,7 +1244,7 @@ public final void reset() { * 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 final void resetRetain(final RevFlagSet retainFlags) { * 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 ObjectWalk toObjectWalkWithSameObjects() { * 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 f82301a82..bb0955ccf 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 @@ private RevCommit rewrite(RevCommit p) { } } - 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 99c5d59a1..11301538e 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 RevFilter clone() { /** {@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 0019e0c28..4215f2121 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 static RevFilter create(final RevFilter a, final RevFilter b) { * 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 static RevFilter create(final RevFilter[] list) { * 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 @@ private static class Binary extends AndRevFilter { } @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 @@ private static class List extends AndRevFilter { } @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 e00feaf9a..8474e6c43 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 @@ private static class PatternSearch extends PatternMatchRevFilter { } @Override - protected CharSequence text(final RevCommit cmit) { + protected CharSequence text(RevCommit cmit) { return textFor(cmit); } @@ -112,7 +112,7 @@ private static class SubStringSearch extends SubStringRevFilter { } @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 9f4f10f3a..002985b11 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 static final RevFilter before(final Date ts) { * 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 static final RevFilter before(final long ts) { * 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 static final RevFilter after(final Date ts) { * 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 static final RevFilter after(final long ts) { * @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 static final RevFilter between(final Date since, final Date until) { * @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 @@ private static class Before extends CommitTimeRevFilter { } @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 @@ private static class After extends CommitTimeRevFilter { } @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 @@ private static class Between extends CommitTimeRevFilter { } @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 4a1b3a6c7..8d73ce43b 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 @@ private static class PatternSearch extends PatternMatchRevFilter { } @Override - protected CharSequence text(final RevCommit cmit) { + protected CharSequence text(RevCommit cmit) { return textFor(cmit); } @@ -112,7 +112,7 @@ private static class SubStringSearch extends SubStringRevFilter { } @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 f1f406548..5621e6463 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 @@ private static class PatternSearch extends PatternMatchRevFilter { } @Override - protected CharSequence text(final RevCommit cmit) { + protected CharSequence text(RevCommit cmit) { return textFor(cmit); } @@ -112,7 +112,7 @@ private static class SubStringSearch extends SubStringRevFilter { } @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 84b7f6b7b..69dec567b 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 RevFilter negate() { /** {@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 a14764a82..97697349f 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 static RevFilter create(final RevFilter a, final RevFilter b) { * 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 static RevFilter create(final RevFilter[] list) { * 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 @@ private static class Binary extends OrRevFilter { } @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 @@ private static class List extends OrRevFilter { } @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 edce224a6..4f41edf54 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 String pattern() { /** {@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 9068c5751..39f0d6016 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 String toString() { 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 String toString() { 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 String toString() { 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 8225e4d3e..4d5690bb1 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 static RevFilter has(final RevFlag a) { * 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 static RevFilter hasAll(final RevFlag... a) { * 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 static RevFilter hasAll(final RevFlagSet a) { * 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 static RevFilter hasAny(final RevFlag... a) { * 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 @@ private static class HasAll extends RevFlagFilter { } @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 @@ private static class HasAny extends RevFlagFilter { } @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 3e6b1480e..54650da0e 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 static boolean safe(final String pattern) { * 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 fcac80ce3..4b272ba7a 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 void clear() { 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 19fc63e00..c2e6a4200 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 int getPackedGitOpenFiles() { * 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 long getPackedGitLimit() { * 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 int getPackedGitWindowSize() { * @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 boolean isPackedGitMMAP() { * 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 int getDeltaBaseCacheLimit() { * 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 int getStreamFileThreshold() { * 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 void setStreamFileThreshold(final int newLimit) { * @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 484cde29e..256e41d22 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 void setBitmapInactiveBranchAgeInDays(int ageInDays) { * @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 211bbe8e5..ce8995ad8 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 @@ else if (submoduleUrl.startsWith("../")) { //$NON-NLS-1$ * 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 SubmoduleWalk(final Repository repository) throws IOException { * .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 SubmoduleWalk setModulesConfig(final Config config) { * 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 SubmoduleWalk setRootTree(final AbstractTreeIterator tree) { * @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 SubmoduleWalk setFilter(TreeFilter filter) { * @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 SubmoduleWalk setTree(final AbstractTreeIterator iterator) * @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 740a28430..3df5bdb2c 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 @@ private static String toCleanString(final List list) { 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 @@ else if (StringUtils.equalsIgnoreCase("PUBLIC_READ", pacl)) //$NON-NLS-1$ * @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 URLConnection get(final String bucket, final String key) * @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 InputStream decrypt(final URLConnection u) throws IOException { * 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 List list(final String bucket, String prefix) * @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 void delete(final String bucket, final String key) * @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 void ignorableWhitespace(final char[] ch, final int s, } @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 c8d1d229b..f6045f6fe 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 final Collection getRefs() { /** {@inheritDoc} */ @Override - public final Ref getRef(final String name) { + public final Ref getRef(String name) { return advertisedRefs.get(name); } @@ -132,7 +132,7 @@ protected void setPeerUserAgent(String agent) { * 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 e9227e33a..1bda91494 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 @@ protected TransportException noRepository() { * 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 @@ protected boolean isCapableOf(final String option) { * 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 @@ public String getPeerUserAgent() { 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 96329d1f1..6e4b05fe2 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 boolean didFetchTestConnectivity() { /** {@inheritDoc} */ @Override - public void setPackLockMessage(final String message) { + public void setPackLockMessage(String message) { lockMessage = message; } @@ -418,7 +418,7 @@ FetchConfig getFetchConfig() { 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 @@ private int maxTimeWanted(final Collection wants) { 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 @@ private void parseReachable(ObjectId id) { } } - 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 @@ else if (wantCapability(line, OPTION_SIDE_BAND)) 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 RevFilter clone() { } @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 @@ private void markRefsAdvertised() { } } - private void markAdvertised(final AnyObjectId id) { + private void markAdvertised(AnyObjectId id) { try { walk.parseAny(id).add(ADVERTISED); } catch (IOException readError) { @@ -821,7 +821,7 @@ private void markAdvertised(final AnyObjectId id) { } } - 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 ee6f29ed0..5624377b7 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 @@ private void writePack(final Map refUpdates, } } - 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 e97f71a48..d78751f89 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 void setPushCertificate(PushCertificate cert) { * @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 boolean isBiDirectionalPipe() { * 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 boolean isCheckReceivedObjects() { * 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 boolean isAllowCreates() { * @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 boolean isAllowDeletes() { * @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 boolean isAllowNonFastForwards() { * {@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 PersonIdent getRefLogIdent() { * 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 RefFilter getRefFilter() { * @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 void setAdvertiseRefsHook(final AdvertiseRefsHook advertiseRefsHook) { * @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 int getTimeout() { * 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 void setMaxCommandDiscardBytes(long limit) { * @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 void setMaxObjectSizeLimit(final long limit) { * 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 List getAllCommands() { * 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 @@ private void fatalError(String msg) { * 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 @@ protected void unlockPack() throws IOException { * @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 @@ protected void failPendingCommands() { * @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 7cf10e95b..2002c9199 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 @@ private void readBundleV2() throws IOException { 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 @@ protected void doFetch(final ProgressMonitor monitor, /** {@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 35ac7792e..5779b0d75 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 void setPackConfig(PackConfig pc) { * @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 void include(final String name, final AnyObjectId id) { * @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 @@ else if (r.getObjectId() != null * 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 bcc5110e7..d4c514e63 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 2fc5eb2b5..2b2f25782 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 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 int getTimeout() { * 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 712eb2215..1dc55beb1 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 boolean isEnabled() { * {@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 boolean isOverridable() { * 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 String getCommandName() { * 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 @@ void execute(final DaemonClient client, final String commandLine) } } - 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 a749fbcaf..5f74e72ea 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 @@ 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 fdb5adf94..1ef190057 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 @@ else if (tagopt == TagOpt.FETCH_TAGS) } } - 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 @@ private void fetchObjects(final ProgressMonitor monitor) 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 @@ private void reopenConnection() throws NotSupportedException, } } - 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 @@ private void removeTrackingRefUpdate(final ObjectId want) { } } - 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 @@ private void removeFetchHeadRecord(final ObjectId want) { } } - 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 @@ private boolean askForIsComplete() throws TransportException { } } - 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 @@ private void expandWildcard(final RefSpec spec, final Set matched) } } - 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 @@ private void expandFetchTags() throws TransportException { } } - 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 @@ private void deleteTrackingRef(final FetchResult result, 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 2a222fbc7..ea2f4b1e3 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 @@ protected void configureJSch(JSch jsch) { * @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 @@ protected JSch createDefaultJSch(FS fs) throws JSchException { 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 @@ private static void knownHosts(final JSch sch, FS fs) throws JSchException { } } - 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 @@ private static void identities(final JSch sch, FS fs) { } } - 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 081d05748..68757803c 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 4660c40d9..4cb839369 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 String toString() { * 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 @@ private synchronized State refresh() { 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 @@ private static boolean patternMatchesHost(final String pattern, } } - 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 @@ private static String nows(final String value) { 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 @@ private static File toFile(String path, File home) { 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 42317984f..0fc24ed9b 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 Collection getAdvertisedRefs() { * 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 Collection getTrackingRefUpdates() { * @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 897295541..8ac7926dc 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 static enum Source { * @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 boolean isAllowThin() { * @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 ObjectIdSubclassMap getBaseObjectIds() { * @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 void setObjectChecker(final ObjectChecker oc) { * @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 @@ private void processDeltas(ProgressMonitor resolving) throws IOException { 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 @@ protected ObjectTypeAndSize readObjectHeader(ObjectTypeAndSize info) 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 @@ private UnresolvedDelta firstChildOf(PackedObjectInfo oe) { return first; } - private void resolveDeltasWithExternalBases(final ProgressMonitor progress) + private void resolveDeltasWithExternalBases(ProgressMonitor progress) throws IOException { growEntries(baseById.size()); @@ -1065,7 +1065,7 @@ private void indexOneObject() throws IOException { } } - 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 @@ private ObjectTypeAndSize openDatabase(UnresolvedDelta delta, } // 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 static class ObjectTypeAndSize { 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 @@ private byte[] inflateAndReturn(final Source src, final long inflatedSize) 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 80fc0b42a..59d1b7885 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 long getOffset() { * @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 int getCRC() { * 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 0cb3b0ff0..a26d1d77d 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 void setFlushOnEnd(boolean flushOnEnd) { * 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 36d660234..7f5a3408e 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 PushCertificate get(String refName) throws IOException { * @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 8bae5a5e0..54527048f 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 Collection getRemoteUpdates() { * 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 e14d18f3a..5c52f2c3e 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 Boolean isForceRefLog() { * @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 void setResult(final Result s) { * @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 void updateType(RevWalk walk) throws IOException { * 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 7c5f32ac0..31b75b07f 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 PreReceiveHook getPreReceiveHook() { * @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 PostReceiveHook getPostReceiveHook() { * @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 07d0bfdc0..859ef2c97 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 @@ private void grow() { } @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 void setUseProtocolV2(boolean b) { * 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 boolean isEmpty() { 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 @@ private void advertiseAny(AnyObjectId obj, final String refName) * 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 bbe4f84bc..992ddc6e5 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 e1b306ea9..afd3adaac 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 RefSpec(String spec, WildcardMode mode) { * @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 boolean isForceUpdate() { * 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 String getSource() { * 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 String getDestination() { * 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 RefSpec setSourceDestination(final String source, * 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 boolean matchSource(final String r) { * 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 boolean matchSource(final Ref r) { * 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 boolean matchDestination(final String r) { * 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 boolean matchDestination(final Ref r) { * 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 RefSpec expandFromSource(final String r) { 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 @@ private RefSpec expandFromSourceImp(final String name) { * 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 RefSpec expandFromSource(final Ref r) { * 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 RefSpec expandFromDestination(final String r) { 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 @@ private RefSpec expandFromDstImp(final String name) { * 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 @@ private static String checkValid(String spec) { 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 int hashCode() { /** {@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 boolean equals(final Object obj) { 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 7b882ec8d..356976117 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 static List getAllRemoteConfigs(final Config rc) * @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 RemoteConfig(final Config rc, final String remoteName) * @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 @@ private void set(final Config rc, final String key, final int currentValue, 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 List getURIs() { * 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 boolean addURI(final URIish toAdd) { * 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 List getPushURIs() { * 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 boolean addPushURI(final URIish toAdd) { * 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 List getFetchRefSpecs() { * 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 boolean addFetchRefSpec(final RefSpec s) { * 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 void setFetchRefSpecs(final List specs) { * 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 void setPushRefSpecs(final List specs) { * 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 List getPushRefSpecs() { * 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 boolean addPushRefSpec(final RefSpec s) { * 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 TagOpt getTagOpt() { * @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 boolean isMirror() { * @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 int getTimeout() { * 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 3e9b16ee4..2849afe20 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 @@ void setMessage(final String message) { * @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 15338a3a3..3100cb444 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 int read() throws IOException { /** {@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 @@ else if (0 <= cr) 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 @@ private void doProgressLine(final String msg) throws IOException { out.write(msg.getBytes()); } - private void beginTask(final int totalWorkUnits) { + private void beginTask(int totalWorkUnits) { monitor.beginTask(remote(currentTask), totalWorkUnits); } @@ -254,7 +254,7 @@ private static String remote(String msg) { 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 af65827ca..b2cc1b6d9 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 void flush() throws IOException { /** {@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 void write(final byte[] b, int off, int len) throws IOException { /** {@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 e0022333e..ae357dfb7 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 static SshSessionFactory getInstance() { * 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 RemoteSession getSession(URIish uri, * {@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 e1134e8fa..eae8aa06d 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 String option() { * 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 77a4d92ab..0336f4773 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 static List getTransportProtocols() { * @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 static List openAll(final Repository local, * 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 @@ private static List getURIs(final RemoteConfig cfg, } } - private static boolean doesNotExist(final RemoteConfig cfg) { + private static boolean doesNotExist(RemoteConfig cfg) { return cfg.getURIs().isEmpty() && cfg.getPushURIs().isEmpty(); } @@ -519,7 +519,7 @@ private static boolean doesNotExist(final RemoteConfig cfg) { * @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 @@ private static String findTrackingRefName(final String remoteName, * 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 @@ protected Transport(final Repository local, final URIish uri) { * @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 String getOptionUploadPack() { * @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 TagOpt getTagOpt() { * @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 boolean isFetchThin() { * 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 boolean isCheckFetchedObjects() { * 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 boolean isPushThin() { * 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 boolean isPushAtomic() { * @see PackTransport * @since 4.2 */ - public void setPushAtomic(final boolean atomic) { + public void setPushAtomic(boolean atomic) { this.pushAtomic = atomic; } @@ -1062,7 +1062,7 @@ public boolean isRemoveDeletedRefs() { * * @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 long getFilterBlobLimit() { * @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 void setFilterBlobLimit(final long bytes) { * @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 boolean isDryRun() { * 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 int getTimeout() { * 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 List getPushOptions() { * 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 ac68ba2fd..9ddfc4666 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 @@ Map readAdvertisedRefs() throws TransportException { 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 @@ private void readLooseRefs(final TreeMap avail) } } - 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 @@ private Ref readRef(final TreeMap avail, final String rn) 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 87c328f45..7fb206003 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 @@ private URL toURL(URIish urish) throws MalformedURLException { * @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 @@ protected void setURI(final URIish uri) throws NotSupportedException { * @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 void setAdditionalHeaders(Map headers) { 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 @@ private boolean isValidRedirect(URL current, String next, String checkFor) { 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 @@ IOException wrongContentType(String expType, String actType) { 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 @@ Map readAdvertisedImpl(final BufferedReader br) 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 4f1880b7e..648eaa3cf 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 @@ public void close() { * @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 09cd67b51..aa5ee7a3d 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 @@ Collection getPackNames() throws IOException { 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 @@ private Ref readRef(final TreeMap avail, 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 a048fe30f..026fd819c 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 @@ else if (s != null && p.length() >= 2 && p.charAt(0) == '/' * @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 URIish() { // 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 String getHost() { * 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 String getScheme() { * 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 String getRawPath() { * 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 URIish setPath(final String n) { * @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 String getUser() { * 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 String getPass() { * 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 int getPort() { * 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 int hashCode() { /** {@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 boolean equals(final Object obj) { 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 String toString() { 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 b1832fd02..393b3aa1a 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 Set getOptions() { * @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 int getTimeout() { * 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 boolean isBiDirectionalPipe() { * 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 RefFilter getRefFilter() { * @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 void setAdvertiseRefsHook(final AdvertiseRefsHook advertiseRefsHook) { * @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 @@ private void verifyClientShallow() * @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 @@ private static void checkNotAdvertisedWants(UploadPack up, } } - 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 @@ private boolean okToGiveUpImp() throws PackProtocolException { } } - 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 b8f8d97be..9b6f45899 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 @@ public Collection getPackLocks() { /** {@inheritDoc} */ @Override - public void setPackLockMessage(final String message) { + public void setPackLockMessage(String message) { lockMessage = message; } @@ -273,7 +273,7 @@ public void close() { 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 @@ private void queueWants(final Collection want) } } - 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 @@ private void process(final ObjectId id) throws TransportException { 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 @@ private void processBlob(final RevObject obj) throws TransportException { } } - 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 @@ private void processTree(final RevObject obj) throws TransportException { 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 @@ private void processCommit(final RevObject obj) throws TransportException { 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 @@ private void needs(final RevObject obj) { } } - 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 @@ private void downloadObject(final ProgressMonitor pm, final AnyObjectId id) } } - 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 @@ private Collection expandOneAlternate( 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 @@ private void markLocalObjComplete(RevObject obj) throws IOException { } } - private void markLocalCommitsComplete(final int until) + private void markLocalCommitsComplete(int until) throws TransportException { try { for (;;) { @@ -747,7 +747,7 @@ private void markLocalCommitsComplete(final int until) } } - private void pushLocalCommit(final RevCommit p) + private void pushLocalCommit(RevCommit p) throws MissingObjectException, IOException { if (p.has(LOCALLY_SEEN)) return; @@ -758,7 +758,7 @@ private void pushLocalCommit(final RevCommit p) 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 @@ private void markTreeComplete(final RevTree tree) throws IOException { } } - 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 cf50c51d5..5cc616ed3 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 @@ private void sendpack(final List updates, } } - private void safeDelete(final String path) { + private void safeDelete(String path) { if (path != null) { try { dest.deleteFile(path); @@ -307,7 +307,7 @@ private void safeDelete(final String path) { } } - 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 @@ private void deleteCommand(final RemoteRefUpdate u) { } } - 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 @@ private boolean isNewRepository() { && 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 @@ private void createNewRepository(final List updates) } } - 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 965be509c..dde7b0815 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 @@ Collection readAlternates(final String listPath) * @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 16a6f4ab7..60acd2f8a 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 FileResolver() { * 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 FileResolver(final File basePath, final boolean exportAll) { /** {@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 boolean isExportAll() { * * @param export a boolean. */ - public void setExportAll(final boolean export) { + public void setExportAll(boolean export) { exportAll = export; } @@ -202,7 +202,7 @@ public void exportRepository(String name, Repository db) { * 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 @@ private static String nameWithDotGit(String name) { 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 a7900f0b6..ad409f6d6 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 @@ protected 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 @@ protected AbstractTreeIterator(final String prefix) { * 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 @@ protected AbstractTreeIterator(final byte[] prefix) { * @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 @@ protected AbstractTreeIterator(final AbstractTreeIterator p, * 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 @@ protected void growPath(final int len) { * @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 @@ private void setPathCapacity(int capacity, int len) { * @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 @@ private static int alreadyMatch(AbstractTreeIterator a, * 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 ObjectId getEntryObjectId() { * @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 71113a661..019968875 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 CanonicalTreeParser(final byte[] prefix, final ObjectReader reader, reset(reader, treeId); } - private CanonicalTreeParser(final CanonicalTreeParser p) { + private CanonicalTreeParser(CanonicalTreeParser p) { super(p); } @@ -140,7 +140,7 @@ public CanonicalTreeParser getParent() { * @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 CanonicalTreeParser next() { * @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 final CanonicalTreeParser createSubtreeIterator0( /** {@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 596d3d083..0639b0dbd 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 EmptyTreeIterator(final AbstractTreeIterator p, /** {@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 boolean eof() { /** {@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 06f53c2f3..ccd5e7091 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 FileTreeIterator(Repository repo, FileModeStrategy fileModeStrategy) { * @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 @@ protected FileTreeIterator(final WorkingTreeIterator p, final File root, /** {@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 File getEntryFile() { /** {@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 5560f7750..b0509705d 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 NameConflictTreeWalk(final Repository repo) { * 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 NameConflictTreeWalk(@Nullable Repository repo, final ObjectReader or) { * @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 @@ private boolean isGitlink(AbstractTreeIterator p) { 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 @@ private boolean skipEntry(final AbstractTreeIterator minRef) 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 41c016cff..8db95da34 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 static TreeWalk forPath(final Repository db, final String path, * 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 TreeWalk(final Repository repo) { * 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 TreeWalk(final @Nullable Repository repo, final ObjectReader or) { * 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 TreeFilter getFilter() { * @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 boolean isRecursive() { * @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 boolean isPostOrderTraversal() { * 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 void reset() { * @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 void reset(final AnyObjectId id) throws MissingObjectException, * @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 void reset(final AnyObjectId... ids) throws MissingObjectException, * @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 T getTree(final int nth, * @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 int getRawMode(final int nth) { * 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 FileMode getFileMode() { * @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 ObjectId getObjectId(final int nth) { * 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 void getObjectId(final MutableObjectId out, final int nth) { * 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 int getPathLength() { * 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 int isPathMatch(final byte[] p, final int pLen) { * 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 int isPathPrefix(final byte[] p, final int pLen) { * @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 @@ void exitSubtree() { 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 cb68cee7b..44385eacb 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 @@ protected WorkingTreeIterator(final String prefix, * @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 @@ protected byte[] idSubmodule(File directory, Entry e) { 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 @@ && getEolStreamType(opType) == EolStreamType.DIRECT) { 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 boolean eof() { /** {@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 void next(final int delta) throws CorruptObjectException { /** {@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 boolean isEntryIgnored() throws IOException { * @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 @@ protected boolean isEntryIgnored(final int pLen) throws IOException { * @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 int compare(Entry a, Entry b) { * 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 enum MetadataDiff { * 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 boolean isModified(DirCacheEntry entry, boolean forceContentCheck, * 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 2dfb2033d..846fb6e34 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 6d40a4eb5..62a5440aa 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 static TreeFilter create(final TreeFilter a, final TreeFilter b) { * 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 static TreeFilter create(final TreeFilter[] list) { * 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 @@ private static class Binary extends AndTreeFilter { } @Override - public boolean include(final TreeWalk walker) + public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { return matchFilter(walker) <= 0; @@ -175,7 +175,7 @@ private static class List extends AndTreeFilter { } @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 653786b7a..0a3b7d02d 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 @@ boolean isEmpty() { 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 81b8e6d14..338ee2b27 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 3403c7857..6090508a4 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 2e023d069..d315526e0 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 TreeFilter negate() { /** {@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 dbb062b97..07c6bfcfc 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 static TreeFilter create(final TreeFilter a, final TreeFilter b) { * 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 static TreeFilter create(final TreeFilter[] list) { * 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 @@ private static class Binary extends OrTreeFilter { } @Override - public boolean include(final TreeWalk walker) + public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { return matchFilter(walker) <= 0; @@ -173,7 +173,7 @@ private static class List extends OrTreeFilter { } @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 2f7f5cdc5..66b3c8407 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 static PathFilter create(String path) { final byte[] pathRaw; - private PathFilter(final String s) { + private PathFilter(String s) { pathStr = s; pathRaw = Constants.encode(pathStr); } @@ -102,13 +102,13 @@ public String getPath() { /** {@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 String toString() { * @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 0652288b6..26cf8857b 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 static TreeFilter createFromStrings(final Collection paths) { * 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 static TreeFilter createFromStrings(final String... paths) { * 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 static TreeFilter create(final Collection paths) { 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 @@ static class Single extends TreeFilter { 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 @@ static class Group extends TreeFilter { 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 @@ private static int compare(byte[] a, byte[] b) { } @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 553e6bdd6..3d9f875e9 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 static PathSuffixFilter create(String path) { 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 f0a76324b..11ad46553 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 @@ private static final class AnyDiffFilter extends 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 boolean include(TreeWalk walker) * 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 9915bdf49..25e9aafe1 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 27a437f4f..0681a3f68 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 void delete(File f) throws IOException { * @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 String run() { * @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 @@ protected ProcessResult internalRunHookIfPresent(Repository repository, * 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 a0ed04fe6..9f99e2855 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 boolean supportsExecute() { /** {@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 0b0a5057c..3393fbfd1 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 FS newInstance() { /** {@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 933af469d..2f547c15b 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 static Path toPath(final File f) throws IOException { * 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 static void delete(final File f) throws IOException { * 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 static void delete(final File f, int options) throws IOException { * 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 static void rename(final File src, final File dst, * 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 static void mkdir(final File d) * 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 static void mkdir(final File d, boolean skipExisting) * 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 static void mkdirs(final File d) throws IOException { * 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 d070ed39d..6f92b3785 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 static void encode(final StringBuilder urlstr, final String key) { * 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 static int response(final HttpConnection c) throws IOException { * @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 static String responseHeader(final HttpConnection c, * 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 fa19e89f2..e88e7a38c 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 static final byte[] readFully(final File path) * @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 static final byte[] readSome(final File path, final int limit) * @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 static int readFully(InputStream fd, byte[] dst, int off) * @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 static void skipFully(final InputStream fd, long toSkip) * @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 24038f097..7441d5068 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 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 boolean contains(int value) { * @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 void clear() { * @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 void add(final int n) { * @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 @@ else if (count == index) * @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 404594cf7..3bd6e1826 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 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 int size() { * @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 long get(final int i) { * 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 void clear() { * @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 void add(final long n) { * @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 @@ else if (count == index) * @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 09eee4202..146966dd4 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 V put(long key, V value) { 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 @@ private void grow() { } } - 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 77bc2495f..4d58d0614 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 String dequote(final String in) { */ 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 String quote(final String in) { } @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 String dequote(final byte[] in, int ip, final int ie) { /** 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 static final class GitPathStyle extends 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 String quote(final String instr) { } @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 23ee9d0d6..42060c659 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 RawCharSequence(final byte[] buf, final int start, final int end) { /** {@inheritDoc} */ @Override - public char charAt(final int index) { + public char charAt(int index) { return (char) (buffer[startPtr + index] & 0xff); } @@ -88,7 +88,7 @@ public int length() { /** {@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 26fc9d80c..c22c8de5d 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 static final int parseHexInt4(final byte digit) { * 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 static final int parseTimeZoneOffset(final byte[] b, int ptr, * 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 static final int next(final byte[] b, int ptr, final char chrA) { * 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 static final int nextLF(final byte[] b, int ptr) { * 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 static final int nextLF(final byte[] b, int ptr, final char chrA) { * 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 static final int prev(final byte[] b, int ptr, final char chrA) { * 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 static final int prevLF(final byte[] b, int ptr) { * @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 static final int prevLF(final byte[] b, int ptr, final char chrA) { * 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 static final IntList lineMapOrBinary(byte[] buf, int ptr, int end) * 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 static final int author(final byte[] b, int ptr) { * 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 static final int committer(final byte[] b, int ptr) { * 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 static final int tagger(final byte[] b, int ptr) { * 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 static final int encoding(final byte[] b, int ptr) { * @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 static String parseEncodingName(final byte[] b) { * 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 static Charset parseEncoding(final byte[] b) { * @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 static PersonIdent parsePersonIdent(final String in) { * @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 static PersonIdent parsePersonIdentOnly(final byte[] raw, * @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 static int endOfFooterLineKey(final byte[] raw, int ptr) { * @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 static String decode(final byte[] buffer, final int start, * @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 static String extractBinaryString(final byte[] buffer, 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 @@ private static String decode(final ByteBuffer b, final Charset charset) * 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 static final int commitMessage(final byte[] b, int ptr) { * 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 static final int tagMessage(final byte[] b, int ptr) { * @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 a8f9bc72e..040b5cbc3 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 RawSubStringPattern(final String patternText) { * 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 int match(final RawCharSequence rcs) { 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 c1aaecfd9..a3f9730f1 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 Ref get(Object key) { /** {@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 Entry peek() { 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 b4736d3e4..3868e56f5 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 static char toLowerCase(final char c) { * @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 static String capitalize(String str) { * 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 static int compareWithCase(String a, String b) { * 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 static boolean toBoolean(final String stringValue) { * @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 887f69b87..057b17785 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 @@ protected TemporaryBuffer(final int limit) { * 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 @@ protected TemporaryBuffer(final int estimatedSize, final int limit) { /** {@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 void write(final int b) throws IOException { /** {@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 @@ protected void doFlush() throws IOException { * 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 byte[] toByteArray(int limit) throws IOException { * 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 static class LocalFile extends TemporaryBuffer { * 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 LocalFile(final File directory) { * 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 byte[] toByteArray() throws IOException { } @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 static class Heap extends TemporaryBuffer { * 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 Heap(final int limit) { * 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 45668255e..08377e6be 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 int read() throws IOException { /** {@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 e764389ac..d8cfee7c4 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 void write(byte[] b) throws IOException { /** {@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 06f83f3ed..ff28161a5 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 int read() throws IOException { /** {@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 32226c4af..908d0a0b4 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 void write(byte[] b) throws IOException { /** {@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 f400e50cd..475b0c110 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 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 InterruptTimer(final String threadName) { * 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 5e50995a2..65470d4ef 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 void write(int ch) throws IOException { /** {@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 efdddeee9..a9989a1c2 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 dee4fe9e9..e40a5a4ce 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 int read() throws IOException { /** {@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 01b25195f..2392b8ae2 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 int getTimeout() { * @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 ea4013338..27f18740f 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 int getTimeout() { * 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 51d3106aa..e14eb2b60 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 @@ private void pop() throws IOException { * @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 int available() throws IOException { /** {@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) {