From 7ac182f4e427e0d5a986b8ca67a56fc22828b1a0 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 16 Jan 2017 14:39:32 +0900 Subject: [PATCH] Enable and fix 'Should be tagged with @Override' warning Set missingOverrideAnnotation=warning in Eclipse compiler preferences which enables the warning: The method of type should be tagged with @Override since it actually overrides a superclass method Justification for this warning is described in: http://stackoverflow.com/a/94411/381622 Enabling this causes in excess of 1000 warnings across the entire code-base. They are very easy to fix automatically with Eclipse's "Quick Fix" tool. Fix all of them except 2 which cause compilation failure when the project is built with mvn; add TODO comments on those for further investigation. Change-Id: I5772061041fd361fe93137fd8b0ad356e748a29c Signed-off-by: David Pursehouse --- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../http/apache/HttpClientConnection.java | 27 +++++++++++++ .../apache/HttpClientConnectionFactory.java | 2 + .../http/apache/TemporaryBufferEntity.java | 5 +++ .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../jgit/http/server/AsIsFileFilter.java | 3 ++ .../eclipse/jgit/http/server/GitServlet.java | 4 ++ .../jgit/http/server/InfoPacksServlet.java | 1 + .../jgit/http/server/InfoRefsServlet.java | 1 + .../jgit/http/server/IsLocalFilter.java | 3 ++ .../jgit/http/server/NoCacheFilter.java | 3 ++ .../jgit/http/server/ReceivePackServlet.java | 3 ++ .../jgit/http/server/RepositoryFilter.java | 3 ++ .../jgit/http/server/SmartOutputStream.java | 1 + .../http/server/SmartServiceInfoRefs.java | 4 ++ .../jgit/http/server/TextFileServlet.java | 1 + .../jgit/http/server/UploadPackServlet.java | 3 ++ .../jgit/http/server/glue/MetaFilter.java | 3 ++ .../jgit/http/server/glue/MetaServlet.java | 2 + .../server/glue/NoParameterFilterConfig.java | 6 +++ .../http/server/glue/RegexGroupFilter.java | 3 ++ .../jgit/http/server/glue/RegexPipeline.java | 2 + .../http/server/glue/ServletBinderImpl.java | 2 + .../jgit/http/server/glue/SuffixPipeline.java | 2 + .../jgit/http/server/glue/UrlPipeline.java | 7 ++++ .../http/server/resolver/AsIsFileService.java | 1 + .../resolver/DefaultReceivePackFactory.java | 2 + .../resolver/DefaultUploadPackFactory.java | 2 + .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../jgit/http/test/AdvertiseErrorTest.java | 3 ++ .../jgit/http/test/AsIsServiceTest.java | 1 + .../test/DefaultReceivePackFactoryTest.java | 1 + .../test/DefaultUploadPackFactoryTest.java | 1 + .../http/test/DumbClientDumbServerTest.java | 1 + .../http/test/DumbClientSmartServerTest.java | 2 + .../http/test/GitServletResponseTests.java | 4 ++ .../jgit/http/test/HookMessageTest.java | 4 ++ .../jgit/http/test/HttpClientTests.java | 2 + .../jgit/http/test/MeasurePackSizeTest.java | 4 ++ .../jgit/http/test/ProtocolErrorTest.java | 2 + .../jgit/http/test/RegexPipelineTest.java | 2 + .../http/test/SetAdditionalHeadersTest.java | 1 + .../http/test/SmartClientSmartServerTest.java | 5 +++ .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../eclipse/jgit/junit/http/AccessEvent.java | 1 + .../eclipse/jgit/junit/http/AppServer.java | 1 - .../eclipse/jgit/junit/http/HttpTestCase.java | 2 + .../jgit/junit/http/MockServletConfig.java | 6 +++ .../jgit/junit/http/RecordingLogger.java | 14 +++++++ .../jgit/junit/http/SimpleHttpServer.java | 1 + .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../src/org/eclipse/jgit/lfs/CleanFilter.java | 1 + .../eclipse/jgit/lfs/lib/AnyLongObjectId.java | 3 ++ .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../jgit/lib/CLIRepositoryTestCase.java | 1 + .../org/eclipse/jgit/pgm/CLIGitCommand.java | 1 + .../tst/org/eclipse/jgit/pgm/ArchiveTest.java | 1 + .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../org/eclipse/jgit/pgm/CommandCatalog.java | 1 + .../src/org/eclipse/jgit/pgm/Glog.java | 1 + .../src/org/eclipse/jgit/pgm/LsRemote.java | 1 + .../jgit/pgm/debug/DiffAlgorithms.java | 4 ++ .../org/eclipse/jgit/pgm/debug/LfsStore.java | 1 + .../eclipse/jgit/pgm/debug/ShowCommands.java | 3 ++ .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../org/eclipse/jgit/api/AddCommandTest.java | 7 ++++ .../eclipse/jgit/api/ArchiveCommandTest.java | 1 + .../eclipse/jgit/api/CleanCommandTest.java | 1 + .../eclipse/jgit/api/CloneCommandTest.java | 1 + .../eclipse/jgit/api/CommitCommandTest.java | 14 +++++++ .../eclipse/jgit/api/EolRepositoryTest.java | 1 + .../eclipse/jgit/api/LsRemoteCommandTest.java | 1 + .../org/eclipse/jgit/api/PullCommandTest.java | 9 +++++ .../eclipse/jgit/api/RebaseCommandTest.java | 40 +++++++++++++++++++ .../jgit/api/RenameBranchCommandTest.java | 1 + .../jgit/api/StashApplyCommandTest.java | 1 + .../jgit/api/StashCreateCommandTest.java | 1 + .../jgit/api/StashDropCommandTest.java | 1 + .../org/eclipse/jgit/diff/DiffEntryTest.java | 1 + .../jgit/dircache/DirCacheBuilderTest.java | 2 + .../jgit/events/ConfigChangeEventTest.java | 1 + .../eclipse/jgit/gitrepo/RepoCommandTest.java | 1 + .../storage/file/AbbreviationTest.java | 2 + .../storage/file/ConcurrentRepackTest.java | 2 + .../storage/file/GcConcurrentTest.java | 2 + .../internal/storage/file/GcPackRefsTest.java | 3 ++ .../internal/storage/file/GcTestCase.java | 2 + .../storage/file/ObjectDirectoryTest.java | 1 + .../internal/storage/file/PackFileTest.java | 2 + .../storage/file/PackIndexTestCase.java | 1 + .../storage/file/PackReverseIndexTest.java | 1 + .../internal/storage/file/PackWriterTest.java | 3 ++ .../storage/file/RefDirectoryTest.java | 8 ++++ .../storage/file/UnpackedObjectTest.java | 2 + .../reftree/LocalDiskRefTreeDatabaseTest.java | 1 + .../storage/reftree/RefTreeDatabaseTest.java | 1 + .../org/eclipse/jgit/lib/IndexDiffTest.java | 1 + .../lib/ThreadSafeProgressMonitorTest.java | 7 ++++ .../tst/org/eclipse/jgit/nls/NLSTest.java | 1 + .../jgit/revwalk/DateRevQueueTest.java | 2 + .../jgit/revwalk/FIFORevQueueTest.java | 2 + .../jgit/revwalk/LIFORevQueueTest.java | 2 + .../jgit/revwalk/RevQueueTestCase.java | 1 + .../revwalk/RevWalkPathFilter6012Test.java | 1 + .../jgit/submodule/SubmoduleAddTest.java | 1 + .../jgit/submodule/SubmoduleInitTest.java | 1 + .../jgit/submodule/SubmoduleStatusTest.java | 6 +++ .../jgit/submodule/SubmoduleSyncTest.java | 2 + .../jgit/submodule/SubmoduleUpdateTest.java | 3 ++ .../jgit/submodule/SubmoduleWalkTest.java | 11 +++++ .../org/eclipse/jgit/transport/NetRCTest.java | 1 + .../jgit/transport/OpenSshConfigTest.java | 1 + .../jgit/transport/PushOptionsTest.java | 2 + .../jgit/transport/PushProcessTest.java | 2 + .../ReceivePackAdvertiseRefsHookTest.java | 1 + .../eclipse/jgit/transport/SpiTransport.java | 6 +++ .../jgit/treewalk/FileTreeIteratorTest.java | 6 +++ .../treewalk/filter/IndexDiffFilterTest.java | 1 + .../filter/InterIndexDiffFilterTest.java | 1 + .../treewalk/filter/PathFilterGroupTest.java | 2 + .../jgit/util/io/UnionInputStreamTest.java | 6 +++ .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../eclipse/jgit/awtui/CommitGraphPane.java | 6 +++ .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../src/org/eclipse/jgit/api/AddCommand.java | 1 + .../org/eclipse/jgit/api/AddNoteCommand.java | 1 + .../org/eclipse/jgit/api/ApplyCommand.java | 1 + .../org/eclipse/jgit/api/BlameCommand.java | 1 + .../org/eclipse/jgit/api/CheckoutCommand.java | 3 ++ .../eclipse/jgit/api/CherryPickCommand.java | 1 + .../org/eclipse/jgit/api/CleanCommand.java | 1 + .../org/eclipse/jgit/api/CloneCommand.java | 1 + .../org/eclipse/jgit/api/CommitCommand.java | 1 + .../eclipse/jgit/api/CreateBranchCommand.java | 1 + .../eclipse/jgit/api/DeleteBranchCommand.java | 1 + .../eclipse/jgit/api/DeleteTagCommand.java | 1 + .../org/eclipse/jgit/api/DescribeCommand.java | 1 + .../src/org/eclipse/jgit/api/DiffCommand.java | 1 + .../org/eclipse/jgit/api/FetchCommand.java | 1 + .../src/org/eclipse/jgit/api/Git.java | 1 + .../src/org/eclipse/jgit/api/GitCommand.java | 1 + .../src/org/eclipse/jgit/api/InitCommand.java | 1 + .../eclipse/jgit/api/ListBranchCommand.java | 2 + .../eclipse/jgit/api/ListNotesCommand.java | 1 + .../org/eclipse/jgit/api/ListTagCommand.java | 2 + .../src/org/eclipse/jgit/api/LogCommand.java | 1 + .../org/eclipse/jgit/api/LsRemoteCommand.java | 1 + .../org/eclipse/jgit/api/MergeCommand.java | 3 ++ .../src/org/eclipse/jgit/api/MergeResult.java | 2 + .../src/org/eclipse/jgit/api/PullCommand.java | 1 + .../src/org/eclipse/jgit/api/PushCommand.java | 1 + .../org/eclipse/jgit/api/RebaseCommand.java | 1 + .../org/eclipse/jgit/api/ReflogCommand.java | 1 + .../eclipse/jgit/api/RemoveNoteCommand.java | 1 + .../eclipse/jgit/api/RenameBranchCommand.java | 1 + .../org/eclipse/jgit/api/ResetCommand.java | 1 + .../org/eclipse/jgit/api/RevertCommand.java | 1 + .../src/org/eclipse/jgit/api/RmCommand.java | 1 + .../org/eclipse/jgit/api/ShowNoteCommand.java | 1 + .../eclipse/jgit/api/StashApplyCommand.java | 1 + .../eclipse/jgit/api/StashCreateCommand.java | 2 + .../eclipse/jgit/api/StashDropCommand.java | 1 + .../eclipse/jgit/api/StashListCommand.java | 1 + .../org/eclipse/jgit/api/StatusCommand.java | 1 + .../eclipse/jgit/api/SubmoduleAddCommand.java | 1 + .../jgit/api/SubmoduleInitCommand.java | 1 + .../jgit/api/SubmoduleStatusCommand.java | 1 + .../jgit/api/SubmoduleSyncCommand.java | 1 + .../jgit/api/SubmoduleUpdateCommand.java | 1 + .../src/org/eclipse/jgit/api/TagCommand.java | 1 + .../src/org/eclipse/jgit/diff/DiffConfig.java | 1 + .../org/eclipse/jgit/diff/HistogramDiff.java | 1 + .../src/org/eclipse/jgit/diff/MyersDiff.java | 12 ++++++ .../src/org/eclipse/jgit/diff/RawText.java | 1 + .../org/eclipse/jgit/diff/RenameDetector.java | 1 + .../org/eclipse/jgit/dircache/DirCache.java | 1 + .../jgit/dircache/DirCacheBuilder.java | 1 + .../eclipse/jgit/dircache/DirCacheEditor.java | 4 ++ .../eclipse/jgit/dircache/DirCacheTree.java | 1 + .../eclipse/jgit/fnmatch/AbstractHead.java | 1 + .../org/eclipse/jgit/fnmatch/GroupHead.java | 8 ++++ .../org/eclipse/jgit/fnmatch/LastHead.java | 1 + .../org/eclipse/jgit/gitrepo/RepoCommand.java | 2 + .../src/org/eclipse/jgit/hooks/GitHook.java | 1 + .../jgit/ignore/internal/IMatcher.java | 2 + .../internal/LeadingAsteriskMatcher.java | 1 + .../jgit/ignore/internal/NameMatcher.java | 2 + .../jgit/ignore/internal/PathMatcher.java | 2 + .../internal/TrailingAsteriskMatcher.java | 1 + .../jgit/ignore/internal/WildMatcher.java | 2 + .../eclipse/jgit/internal/ketch/LagCheck.java | 1 + .../jgit/internal/ketch/ProposalRound.java | 2 + .../jgit/internal/ketch/RemoteGitReplica.java | 1 + .../storage/dfs/DfsPackCompactor.java | 2 + .../storage/dfs/DfsPackDescription.java | 1 + .../jgit/internal/storage/dfs/DfsReader.java | 21 ++++++++++ .../internal/storage/dfs/DfsRepository.java | 2 + .../storage/dfs/InMemoryRepository.java | 8 ++++ .../storage/file/BasePackBitmapIndex.java | 1 + .../storage/file/BitmapIndexImpl.java | 3 ++ .../storage/file/CheckoutEntryImpl.java | 2 + .../jgit/internal/storage/file/GC.java | 3 ++ .../jgit/internal/storage/file/LockFile.java | 1 + .../storage/file/ObjectDirectory.java | 7 ++++ .../storage/file/PackBitmapIndexBuilder.java | 5 +++ .../storage/file/PackBitmapIndexRemapper.java | 4 ++ .../jgit/internal/storage/file/PackFile.java | 2 + .../jgit/internal/storage/file/PackIndex.java | 4 ++ .../internal/storage/file/PackIndexV1.java | 2 + .../internal/storage/file/PackIndexV2.java | 2 + .../internal/storage/file/RefDirectory.java | 10 +++++ .../storage/file/ReflogEntryImpl.java | 5 +++ .../storage/file/ReflogReaderImpl.java | 4 ++ .../storage/file/SimpleDataInput.java | 15 +++++++ .../storage/file/SimpleDataOutput.java | 14 +++++++ .../internal/storage/file/WindowCursor.java | 9 +++++ .../internal/storage/file/WriteConfig.java | 1 + .../internal/storage/pack/DeltaIndex.java | 1 + .../jgit/internal/storage/pack/DeltaTask.java | 3 ++ .../internal/storage/pack/PackWriter.java | 6 +++ .../pack/PackWriterBitmapPreparer.java | 5 +++ .../src/org/eclipse/jgit/lib/AnyObjectId.java | 3 ++ .../jgit/lib/BatchingProgressMonitor.java | 6 +++ .../src/org/eclipse/jgit/lib/BitmapIndex.java | 4 ++ .../org/eclipse/jgit/lib/ConfigSnapshot.java | 4 ++ .../src/org/eclipse/jgit/lib/CoreConfig.java | 1 + .../jgit/lib/EmptyProgressMonitor.java | 5 +++ .../src/org/eclipse/jgit/lib/FileMode.java | 7 ++++ .../src/org/eclipse/jgit/lib/IndexDiff.java | 1 + .../eclipse/jgit/lib/NullProgressMonitor.java | 5 +++ .../src/org/eclipse/jgit/lib/ObjectIdRef.java | 12 ++++++ .../eclipse/jgit/lib/ObjectIdSubclassMap.java | 5 +++ .../org/eclipse/jgit/lib/ObjectInserter.java | 11 +++++ .../org/eclipse/jgit/lib/ObjectReader.java | 12 ++++++ .../src/org/eclipse/jgit/lib/PersonIdent.java | 3 ++ .../org/eclipse/jgit/lib/RefComparator.java | 1 + .../src/org/eclipse/jgit/lib/SymbolicRef.java | 8 ++++ .../jgit/lib/ThreadSafeProgressMonitor.java | 5 +++ .../src/org/eclipse/jgit/lib/UserConfig.java | 1 + .../src/org/eclipse/jgit/lib/WorkQueue.java | 1 + .../org/eclipse/jgit/merge/MergeConfig.java | 1 + .../org/eclipse/jgit/merge/MergeResult.java | 4 ++ .../src/org/eclipse/jgit/nls/NLS.java | 1 + .../eclipse/jgit/notes/DefaultNoteMerger.java | 1 + .../org/eclipse/jgit/notes/FanoutBucket.java | 4 ++ .../org/eclipse/jgit/notes/LeafBucket.java | 4 ++ .../src/org/eclipse/jgit/notes/NoteMap.java | 1 + .../jgit/patch/CombinedHunkHeader.java | 1 + .../org/eclipse/jgit/revplot/PlotWalk.java | 1 + .../jgit/revwalk/AbstractRevQueue.java | 1 + .../eclipse/jgit/revwalk/BlockRevQueue.java | 1 + .../eclipse/jgit/revwalk/DateRevQueue.java | 6 +++ .../org/eclipse/jgit/revwalk/DepthWalk.java | 6 +++ .../eclipse/jgit/revwalk/FIFORevQueue.java | 6 +++ .../eclipse/jgit/revwalk/LIFORevQueue.java | 6 +++ .../org/eclipse/jgit/revwalk/ObjectWalk.java | 1 + .../src/org/eclipse/jgit/revwalk/RevFlag.java | 1 + .../org/eclipse/jgit/revwalk/RevFlagSet.java | 3 ++ .../eclipse/jgit/revwalk/RevObjectList.java | 4 ++ .../src/org/eclipse/jgit/revwalk/RevWalk.java | 10 +++++ .../jgit/revwalk/filter/RevFilter.java | 1 + .../jgit/storage/file/FileBasedConfig.java | 1 + .../eclipse/jgit/storage/pack/PackConfig.java | 1 + .../transport/AbstractAdvertiseRefsHook.java | 2 + .../jgit/transport/AdvertiseRefsHook.java | 2 + .../transport/AdvertiseRefsHookChain.java | 2 + .../jgit/transport/BaseConnection.java | 6 +++ .../jgit/transport/BaseFetchConnection.java | 3 ++ .../transport/BasePackFetchConnection.java | 7 ++++ .../transport/BasePackPushConnection.java | 2 + .../jgit/transport/BaseReceivePack.java | 1 + .../jgit/transport/BundleFetchConnection.java | 3 ++ .../eclipse/jgit/transport/Connection.java | 1 + .../CredentialsProviderUserInfo.java | 7 ++++ .../org/eclipse/jgit/transport/Daemon.java | 4 ++ .../eclipse/jgit/transport/DaemonService.java | 1 + .../transport/DefaultSshSessionFactory.java | 1 + .../transport/HMACSHA1NonceGenerator.java | 1 + .../transport/InternalFetchConnection.java | 1 + .../transport/InternalPushConnection.java | 1 + .../eclipse/jgit/transport/JschSession.java | 2 + .../eclipse/jgit/transport/OpenSshConfig.java | 1 + .../jgit/transport/PostReceiveHook.java | 1 + .../jgit/transport/PostReceiveHookChain.java | 1 + .../jgit/transport/PostUploadHook.java | 1 + .../jgit/transport/PostUploadHookChain.java | 1 + .../jgit/transport/PreReceiveHook.java | 1 + .../jgit/transport/PreReceiveHookChain.java | 1 + .../eclipse/jgit/transport/PreUploadHook.java | 3 ++ .../jgit/transport/PreUploadHookChain.java | 3 ++ .../jgit/transport/PushCertificateStore.java | 1 + .../eclipse/jgit/transport/ReceivePack.java | 3 ++ .../org/eclipse/jgit/transport/RefFilter.java | 1 + .../org/eclipse/jgit/transport/RefSpec.java | 3 ++ .../jgit/transport/SignedPushConfig.java | 1 + .../jgit/transport/TransferConfig.java | 2 + .../org/eclipse/jgit/transport/Transport.java | 1 + .../jgit/transport/TransportAmazonS3.java | 5 +++ .../jgit/transport/TransportBundleFile.java | 2 + .../jgit/transport/TransportGitAnon.java | 6 +++ .../jgit/transport/TransportGitSsh.java | 8 ++++ .../eclipse/jgit/transport/TransportHttp.java | 18 +++++++++ .../jgit/transport/TransportLocal.java | 2 + .../eclipse/jgit/transport/TransportSftp.java | 7 ++++ .../org/eclipse/jgit/transport/URIish.java | 3 ++ .../eclipse/jgit/transport/UploadPack.java | 5 +++ .../jgit/transport/UploadPackLogger.java | 1 + .../jgit/transport/UploadPackLoggerChain.java | 1 + .../jgit/transport/WalkFetchConnection.java | 3 ++ .../jgit/transport/WalkPushConnection.java | 2 + .../transport/http/JDKHttpConnection.java | 23 +++++++++++ .../http/JDKHttpConnectionFactory.java | 2 + .../jgit/transport/resolver/FileResolver.java | 1 + .../resolver/ReceivePackFactory.java | 1 + .../resolver/RepositoryResolver.java | 1 + .../transport/resolver/UploadPackFactory.java | 1 + .../jgit/treewalk/CanonicalTreeParser.java | 2 + .../jgit/treewalk/NameConflictTreeWalk.java | 1 + .../org/eclipse/jgit/treewalk/TreeWalk.java | 1 + .../jgit/treewalk/WorkingTreeIterator.java | 2 + .../jgit/treewalk/WorkingTreeOptions.java | 1 + .../jgit/treewalk/filter/PathFilter.java | 1 + .../jgit/treewalk/filter/PathFilterGroup.java | 2 + .../jgit/treewalk/filter/TreeFilter.java | 1 + .../src/org/eclipse/jgit/util/BlockList.java | 3 ++ .../src/org/eclipse/jgit/util/FS.java | 2 + .../src/org/eclipse/jgit/util/FS_Win32.java | 4 ++ .../eclipse/jgit/util/FS_Win32_Cygwin.java | 4 ++ .../org/eclipse/jgit/util/GitDateParser.java | 1 + .../org/eclipse/jgit/util/HttpSupport.java | 4 ++ .../src/org/eclipse/jgit/util/IntList.java | 1 + .../src/org/eclipse/jgit/util/LongList.java | 1 + .../eclipse/jgit/util/RawCharSequence.java | 3 ++ .../src/org/eclipse/jgit/util/RefList.java | 4 ++ .../src/org/eclipse/jgit/util/RefMap.java | 6 +++ .../org/eclipse/jgit/util/SystemReader.java | 8 ++++ .../eclipse/jgit/util/TemporaryBuffer.java | 5 +++ .../eclipse/jgit/util/io/InterruptTimer.java | 1 + .../eclipse/jgit/util/io/TeeInputStream.java | 1 + .../jgit/util/io/ThrowingPrintWriter.java | 1 + 347 files changed, 1011 insertions(+), 18 deletions(-) diff --git a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs index 10c29d557..47cca3692 100644 --- a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs index 80cfbbbd3..adfb7aa3b 100644 --- a/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs index 4f1759fb3..763144c86 100644 --- a/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs index 80cfbbbd3..adfb7aa3b 100644 --- a/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java index 281154fb1..9285d1766 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 @@ -223,15 +223,18 @@ public class HttpClientConnection implements HttpConnection { this.proxy = proxy; } + @Override public int getResponseCode() throws IOException { execute(); return resp.getStatusLine().getStatusCode(); } + @Override public URL getURL() { return url; } + @Override public String getResponseMessage() throws IOException { execute(); return resp.getStatusLine().getReasonPhrase(); @@ -259,6 +262,7 @@ public class HttpClientConnection implements HttpConnection { } } + @Override public Map> getHeaderFields() { Map> ret = new HashMap>(); for (Header hdr : resp.getAllHeaders()) { @@ -270,10 +274,12 @@ public class HttpClientConnection implements HttpConnection { return ret; } + @Override public void setRequestProperty(String name, String value) { req.addHeader(name, value); } + @Override public void setRequestMethod(String method) throws ProtocolException { this.method = method; if (METHOD_GET.equalsIgnoreCase(method)) { @@ -290,18 +296,22 @@ public class HttpClientConnection implements HttpConnection { } } + @Override public void setUseCaches(boolean usecaches) { // not needed } + @Override public void setConnectTimeout(int timeout) { this.timeout = Integer.valueOf(timeout); } + @Override public void setReadTimeout(int readTimeout) { this.readTimeout = Integer.valueOf(readTimeout); } + @Override public String getContentType() { HttpEntity responseEntity = resp.getEntity(); if (responseEntity != null) { @@ -312,16 +322,19 @@ public class HttpClientConnection implements HttpConnection { return null; } + @Override public InputStream getInputStream() throws IOException { return resp.getEntity().getContent(); } // will return only the first field + @Override public String getHeaderField(String name) { Header header = resp.getFirstHeader(name); return (header == null) ? null : header.getValue(); } + @Override public int getContentLength() { Header contentLength = resp.getFirstHeader("content-length"); //$NON-NLS-1$ if (contentLength == null) { @@ -336,14 +349,17 @@ public class HttpClientConnection implements HttpConnection { } } + @Override public void setInstanceFollowRedirects(boolean followRedirects) { this.followRedirects = Boolean.valueOf(followRedirects); } + @Override public void setDoOutput(boolean dooutput) { // TODO: check whether we can really ignore this. } + @Override public void setFixedLengthStreamingMode(int contentLength) { if (entity != null) throw new IllegalArgumentException(); @@ -351,52 +367,63 @@ public class HttpClientConnection implements HttpConnection { entity.setContentLength(contentLength); } + @Override public OutputStream getOutputStream() throws IOException { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); return entity.getBuffer(); } + @Override public void setChunkedStreamingMode(int chunklen) { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); entity.setChunked(true); } + @Override public String getRequestMethod() { return method; } + @Override public boolean usingProxy() { return isUsingProxy; } + @Override public void connect() throws IOException { execute(); } + @Override public void setHostnameVerifier(final HostnameVerifier hostnameverifier) { this.hostnameverifier = new X509HostnameVerifier() { + @Override public boolean verify(String hostname, SSLSession session) { return hostnameverifier.verify(hostname, session); } + @Override public void verify(String host, String[] cns, String[] subjectAlts) throws SSLException { throw new UnsupportedOperationException(); // TODO message } + @Override public void verify(String host, X509Certificate cert) throws SSLException { throw new UnsupportedOperationException(); // TODO message } + @Override public void verify(String host, SSLSocket ssl) throws IOException { hostnameverifier.verify(host, ssl.getSession()); } }; } + @Override public void configure(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws KeyManagementException { getSSLContext().init(km, tm, random); diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java index fe1eef484..f97d284b4 100644 --- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java +++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java @@ -55,10 +55,12 @@ import org.eclipse.jgit.transport.http.HttpConnectionFactory; * @since 3.3 */ public class HttpClientConnectionFactory implements HttpConnectionFactory { + @Override public HttpConnection create(URL url) throws IOException { return new HttpClientConnection(url.toString()); } + @Override public HttpConnection create(URL url, Proxy proxy) throws IOException { return new HttpClientConnection(url.toString(), proxy); diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java index 93328c96c..3efff49d0 100644 --- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java +++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java @@ -78,25 +78,30 @@ public class TemporaryBufferEntity extends AbstractHttpEntity return buffer; } + @Override public boolean isRepeatable() { return true; } + @Override public long getContentLength() { if (contentLength != null) return contentLength.intValue(); return buffer.length(); } + @Override public InputStream getContent() throws IOException, IllegalStateException { return buffer.openInputStream(); } + @Override public void writeTo(OutputStream outstream) throws IOException { // TODO: dont we need a progressmonitor buffer.writeTo(outstream, null); } + @Override public boolean isStreaming() { return false; } diff --git a/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs index 80cfbbbd3..adfb7aa3b 100644 --- a/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java index d33362b4b..05391eb75 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java @@ -70,14 +70,17 @@ class AsIsFileFilter implements Filter { this.asIs = getAnyFile; } + @Override public void init(FilterConfig config) throws ServletException { // Do nothing. } + @Override public void destroy() { // Do nothing. } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; 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 bca521025..3a5edeebe 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 @@ -174,18 +174,22 @@ public class GitServlet extends MetaServlet { @Override public void init(final ServletConfig config) throws ServletException { gitFilter.init(new FilterConfig() { + @Override public String getFilterName() { return gitFilter.getClass().getName(); } + @Override public String getInitParameter(String name) { return config.getInitParameter(name); } + @Override public Enumeration getInitParameterNames() { return config.getInitParameterNames(); } + @Override public ServletContext getServletContext() { return config.getServletContext(); } 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 bb6efb84b..91c2f9fd9 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 @@ -60,6 +60,7 @@ import org.eclipse.jgit.lib.ObjectDatabase; class InfoPacksServlet extends HttpServlet { private static final long serialVersionUID = 1L; + @Override public void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { sendPlainText(packList(req), req, rsp); 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 446f6a2c8..72c71369d 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 @@ -64,6 +64,7 @@ import org.eclipse.jgit.util.HttpSupport; class InfoRefsServlet extends HttpServlet { private static final long serialVersionUID = 1L; + @Override public void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { // Assume a dumb client and send back the dumb client 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 511cdf193..223813feb 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 @@ -66,14 +66,17 @@ import org.eclipse.jgit.lib.Repository; * downstream servlet can directly access its contents on disk. */ class IsLocalFilter implements Filter { + @Override public void init(FilterConfig config) throws ServletException { // Do nothing. } + @Override public void destroy() { // Do nothing. } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (isLocal(getRepository(request))) diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/NoCacheFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/NoCacheFilter.java index 6a23cb95f..bdc3420aa 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/NoCacheFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/NoCacheFilter.java @@ -59,14 +59,17 @@ import javax.servlet.http.HttpServletResponse; /** Adds HTTP response headers to prevent caching by proxies/browsers. */ class NoCacheFilter implements Filter { + @Override public void init(FilterConfig config) throws ServletException { // Do nothing. } + @Override public void destroy() { // Do nothing. } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletResponse rsp = (HttpServletResponse) response; diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java index c88670ec9..9d24bf7d0 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java @@ -130,6 +130,7 @@ class ReceivePackServlet extends HttpServlet { this.receivePackFactory = receivePackFactory; } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; @@ -153,10 +154,12 @@ class ReceivePackServlet extends HttpServlet { } } + @Override public void init(FilterConfig filterConfig) throws ServletException { // Nothing. } + @Override public void destroy() { // Nothing. } 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 b3fad3d95..de09c545e 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,14 +100,17 @@ public class RepositoryFilter implements Filter { this.resolver = resolver; } + @Override public void init(final FilterConfig config) throws ServletException { context = config.getServletContext(); } + @Override public void destroy() { context = null; } + @Override public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java index 145c63bca..08a5eba15 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java @@ -95,6 +95,7 @@ class SmartOutputStream extends TemporaryBuffer { return out; } + @Override public void close() throws IOException { super.close(); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java index a06bb1e9e..fe34f6691 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java @@ -80,14 +80,17 @@ abstract class SmartServiceInfoRefs implements Filter { this.filters = filters.toArray(new Filter[filters.size()]); } + @Override public void init(FilterConfig config) throws ServletException { // Do nothing. } + @Override public void destroy() { // Do nothing. } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { final HttpServletRequest req = (HttpServletRequest) request; @@ -154,6 +157,7 @@ abstract class SmartServiceInfoRefs implements Filter { private class Chain implements FilterChain { private int filterIdx; + @Override public void doFilter(ServletRequest req, ServletResponse rsp) throws IOException, ServletException { if (filterIdx < filters.length) 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 650059bd3..28ee17dcd 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 @@ -68,6 +68,7 @@ class TextFileServlet extends HttpServlet { this.fileName = name; } + @Override public void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { try { diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java index a9a0c5b12..97d00c10a 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java @@ -129,6 +129,7 @@ class UploadPackServlet extends HttpServlet { this.uploadPackFactory = uploadPackFactory; } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; @@ -152,10 +153,12 @@ class UploadPackServlet extends HttpServlet { } } + @Override public void init(FilterConfig filterConfig) throws ServletException { // Nothing. } + @Override public void destroy() { // Nothing. } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java index 2187cfaa4..800c5d4fe 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaFilter.java @@ -128,10 +128,12 @@ public class MetaFilter implements Filter { return register(new RegexPipeline.Binder(pattern)); } + @Override public void init(FilterConfig filterConfig) throws ServletException { servletContext = filterConfig.getServletContext(); } + @Override public void destroy() { if (pipelines != null) { Set destroyed = newIdentitySet(); @@ -166,6 +168,7 @@ public class MetaFilter implements Filter { }; } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java index 05060658d..71365c8f4 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java @@ -123,6 +123,7 @@ public class MetaServlet extends HttpServlet { filter.init(new NoParameterFilterConfig(name, ctx)); } + @Override public void destroy() { filter.destroy(); } @@ -131,6 +132,7 @@ public class MetaServlet extends HttpServlet { protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { filter.doFilter(req, res, new FilterChain() { + @Override public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException { diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java index 8dfcc4d14..961f88e4f 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java @@ -59,26 +59,32 @@ final class NoParameterFilterConfig implements FilterConfig { this.context = context; } + @Override public String getInitParameter(String name) { return null; } + @Override public Enumeration getInitParameterNames() { return new Enumeration() { + @Override public boolean hasMoreElements() { return false; } + @Override public String nextElement() { throw new NoSuchElementException(); } }; } + @Override public ServletContext getServletContext() { return context; } + @Override public String getFilterName() { return filterName; } 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 2414660a0..a402977ad 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 @@ -79,14 +79,17 @@ public class RegexGroupFilter implements Filter { this.groupIdx = groupIdx - 1; } + @Override public void init(FilterConfig config) throws ServletException { // Do nothing. } + @Override public void destroy() { // Do nothing. } + @Override public void doFilter(final ServletRequest request, final ServletResponse rsp, final FilterChain chain) throws IOException, ServletException { diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java index 2ef71368d..f33243b3b 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java @@ -95,6 +95,7 @@ class RegexPipeline extends UrlPipeline { pattern = p; } + @Override UrlPipeline create() { return new RegexPipeline(pattern, getFilters(), getServlet()); } @@ -108,6 +109,7 @@ class RegexPipeline extends UrlPipeline { this.pattern = pattern; } + @Override boolean match(final HttpServletRequest req) { final String pathInfo = req.getPathInfo(); return pathInfo != null && pattern.matcher(pathInfo).matches(); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java index e96fc59dc..c2b037097 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java @@ -61,6 +61,7 @@ abstract class ServletBinderImpl implements ServletBinder { this.filters = new ArrayList(); } + @Override public ServletBinder through(Filter filter) { if (filter == null) throw new NullPointerException(HttpServerText.get().filterMustNotBeNull); @@ -68,6 +69,7 @@ abstract class ServletBinderImpl implements ServletBinder { return this; } + @Override public void with(HttpServlet servlet) { if (servlet == null) throw new NullPointerException(HttpServerText.get().servletMustNotBeNull); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java index b94201625..903de63b8 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java @@ -71,6 +71,7 @@ class SuffixPipeline extends UrlPipeline { this.suffix = suffix; } + @Override UrlPipeline create() { return new SuffixPipeline(suffix, getFilters(), getServlet()); } @@ -87,6 +88,7 @@ class SuffixPipeline extends UrlPipeline { this.suffixLen = suffix.length(); } + @Override boolean match(final HttpServletRequest req) { final String pathInfo = req.getPathInfo(); return pathInfo != null && pathInfo.endsWith(suffix); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java index 2d0b84407..56e4e2288 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java @@ -121,26 +121,32 @@ abstract class UrlPipeline { throws ServletException { if (!inited.contains(ref)) { ref.init(new ServletConfig() { + @Override public String getInitParameter(String name) { return null; } + @Override public Enumeration getInitParameterNames() { return new Enumeration() { + @Override public boolean hasMoreElements() { return false; } + @Override public String nextElement() { throw new NoSuchElementException(); } }; } + @Override public ServletContext getServletContext() { return context; } + @Override public String getServletName() { return ref.getClass().getName(); } @@ -229,6 +235,7 @@ abstract class UrlPipeline { this.servlet = servlet; } + @Override public void doFilter(ServletRequest req, ServletResponse rsp) throws IOException, ServletException { if (filterIdx < filters.length) diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java index 4ef2a7c4c..88ad472ac 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java @@ -72,6 +72,7 @@ public class AsIsFileService { }; private static final SectionParser CONFIG = new SectionParser() { + @Override public ServiceConfig parse(final Config cfg) { return new ServiceConfig(cfg); } 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 8c39b7997..04e192bcf 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 @@ -69,6 +69,7 @@ import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; public class DefaultReceivePackFactory implements ReceivePackFactory { private static final SectionParser CONFIG = new SectionParser() { + @Override public ServiceConfig parse(final Config cfg) { return new ServiceConfig(cfg); } @@ -85,6 +86,7 @@ public class DefaultReceivePackFactory implements } } + @Override public ReceivePack create(final HttpServletRequest req, final Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { final ServiceConfig cfg = db.getConfig().get(CONFIG); 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 34c069e0e..d01e2efca 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 @@ -62,6 +62,7 @@ import org.eclipse.jgit.transport.resolver.UploadPackFactory; public class DefaultUploadPackFactory implements UploadPackFactory { private static final SectionParser CONFIG = new SectionParser() { + @Override public ServiceConfig parse(final Config cfg) { return new ServiceConfig(cfg); } @@ -75,6 +76,7 @@ public class DefaultUploadPackFactory implements } } + @Override public UploadPack create(final HttpServletRequest req, final Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { if (db.getConfig().get(CONFIG).enabled) diff --git a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs index 10c29d557..47cca3692 100644 --- a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java index 0285bd167..0e92b1460 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java @@ -80,6 +80,7 @@ public class AdvertiseErrorTest extends HttpTestCase { private URIish remoteURI; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -90,6 +91,7 @@ public class AdvertiseErrorTest extends HttpTestCase { ServletContextHandler app = server.addContext("/git"); GitServlet gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { + @Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { @@ -102,6 +104,7 @@ public class AdvertiseErrorTest extends HttpTestCase { } }); gs.setReceivePackFactory(new DefaultReceivePackFactory() { + @Override public ReceivePack create(HttpServletRequest req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java index c6b8f092b..e94a792ff 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java @@ -64,6 +64,7 @@ public class AsIsServiceTest extends LocalDiskRepositoryTestCase { private AsIsFileService service; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java index f2879e0fa..b24e2dfc7 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java @@ -71,6 +71,7 @@ public class DefaultReceivePackFactoryTest extends LocalDiskRepositoryTestCase { private ReceivePackFactory factory; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java index 3bcb0571b..ce24d64b7 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java @@ -69,6 +69,7 @@ public class DefaultUploadPackFactoryTest extends LocalDiskRepositoryTestCase { private UploadPackFactory factory; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java index 677132d73..822df7175 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java @@ -109,6 +109,7 @@ public class DumbClientDumbServerTest extends HttpTestCase { HttpTransport.setConnectionFactory(cf); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java index bce44f9bf..ab4ac131e 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java @@ -114,6 +114,7 @@ public class DumbClientSmartServerTest extends HttpTestCase { HttpTransport.setConnectionFactory(cf); } + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -124,6 +125,7 @@ public class DumbClientSmartServerTest extends HttpTestCase { ServletContextHandler app = server.addContext("/git"); GitServlet gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { + @Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletResponseTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletResponseTests.java index 4b15d4b53..1c953084d 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletResponseTests.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletResponseTests.java @@ -107,6 +107,7 @@ public class GitServletResponseTests extends HttpTestCase { * configure the maximum pack file size, the object checker and custom hooks * just before they talk to the server. */ + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -117,6 +118,7 @@ public class GitServletResponseTests extends HttpTestCase { ServletContextHandler app = server.addContext("/git"); gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { + @Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { @@ -129,6 +131,7 @@ public class GitServletResponseTests extends HttpTestCase { } }); gs.setReceivePackFactory(new DefaultReceivePackFactory() { + @Override public ReceivePack create(HttpServletRequest req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { @@ -270,6 +273,7 @@ public class GitServletResponseTests extends HttpTestCase { // this PostReceiveHook when called after an unsuccesfull unpack will // lead to an IllegalStateException postHook = new PostReceiveHook() { + @Override public void onPostReceive(ReceivePack rp, Collection commands) { // the maxPackSize setting caused that the packfile couldn't be diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java index d67c8173c..adb69ec27 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java @@ -88,6 +88,7 @@ public class HookMessageTest extends HttpTestCase { private URIish remoteURI; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -98,6 +99,7 @@ public class HookMessageTest extends HttpTestCase { ServletContextHandler app = server.addContext("/git"); GitServlet gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { + @Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { @@ -110,11 +112,13 @@ public class HookMessageTest extends HttpTestCase { } }); gs.setReceivePackFactory(new DefaultReceivePackFactory() { + @Override public ReceivePack create(HttpServletRequest req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack recv = super.create(req, db); recv.setPreReceiveHook(new PreReceiveHook() { + @Override public void onPreReceive(ReceivePack rp, Collection commands) { rp.sendMessage("message line 1"); 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 ce7844278..6dbe0e3cd 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 @@ -94,6 +94,7 @@ public class HttpClientTests extends HttpTestCase { private URIish smartAuthBasicURI; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -132,6 +133,7 @@ public class HttpClientTests extends HttpTestCase { private ServletContextHandler smart(final String path) { GitServlet gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { + @Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java index 108e7bb72..4c08ec263 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java @@ -83,6 +83,7 @@ public class MeasurePackSizeTest extends HttpTestCase { long packSize = -1; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -93,6 +94,7 @@ public class MeasurePackSizeTest extends HttpTestCase { ServletContextHandler app = server.addContext("/git"); GitServlet gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { + @Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { @@ -105,12 +107,14 @@ public class MeasurePackSizeTest extends HttpTestCase { } }); gs.setReceivePackFactory(new DefaultReceivePackFactory() { + @Override public ReceivePack create(HttpServletRequest req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { ReceivePack recv = super.create(req, db); recv.setPostReceiveHook(new PostReceiveHook() { + @Override public void onPostReceive(ReceivePack rp, Collection commands) { packSize = rp.getPackSize(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java index 68c5a3a43..87d0bad85 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java @@ -84,6 +84,7 @@ public class ProtocolErrorTest extends HttpTestCase { private RevBlob a_blob; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -94,6 +95,7 @@ public class ProtocolErrorTest extends HttpTestCase { ServletContextHandler app = server.addContext("/git"); GitServlet gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { + @Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java index 64fbc01d4..725a5902d 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java @@ -93,12 +93,14 @@ public class RegexPipelineTest extends HttpTestCase { } } + @Override @Before public void setUp() throws Exception { server = new AppServer(); ctx = server.addContext("/"); } + @Override @After public void tearDown() throws Exception { server.tearDown(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java index 5be783454..0a68ed261 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SetAdditionalHeadersTest.java @@ -77,6 +77,7 @@ public class SetAdditionalHeadersTest extends HttpTestCase { private RevCommit A, B; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java index fd3fef4be..f887da4c7 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java @@ -147,6 +147,7 @@ public class SmartClientSmartServerTest extends HttpTestCase { HttpTransport.setConnectionFactory(cf); } + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -193,6 +194,7 @@ public class SmartClientSmartServerTest extends HttpTestCase { ServletContextHandler broken = server.addContext("/bad"); broken.addFilter(new FilterHolder(new Filter() { + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { @@ -204,11 +206,13 @@ public class SmartClientSmartServerTest extends HttpTestCase { w.close(); } + @Override public void init(FilterConfig filterConfig) throws ServletException { // empty } + @Override public void destroy() { // empty } @@ -831,6 +835,7 @@ public class SmartClientSmartServerTest extends HttpTestCase { this.repoName = repoName; } + @Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { if (!name.equals(repoName)) diff --git a/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs index 10c29d557..47cca3692 100644 --- a/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java index aaccc66f5..6580ade8e 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 @@ -153,6 +153,7 @@ public class AccessEvent { return responseHeaders.get(name); } + @Override public String toString() { StringBuilder b = new StringBuilder(); b.append(method); diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java index 09754317e..1575cb650 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java @@ -184,7 +184,6 @@ public class AppServer { return new UserPrincipal(username, Credential.getCredential(Crypt.crypt(username, password))); } - } private void auth(ServletContextHandler ctx, Authenticator authType) { diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java index ab5d3e1d9..5db76eb7b 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java @@ -74,11 +74,13 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase { /** In-memory application server; subclass must start. */ protected AppServer server; + @Override public void setUp() throws Exception { super.setUp(); server = new AppServer(); } + @Override public void tearDown() throws Exception { server.tearDown(); super.tearDown(); diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java index 59765890b..4f11ea8fc 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/MockServletConfig.java @@ -58,27 +58,33 @@ public class MockServletConfig implements ServletConfig { parameters.put(name, value); } + @Override public String getInitParameter(String name) { return parameters.get(name); } + @Override public Enumeration getInitParameterNames() { final Iterator i = parameters.keySet().iterator(); return new Enumeration() { + @Override public boolean hasMoreElements() { return i.hasNext(); } + @Override public String nextElement() { return i.next(); } }; } + @Override public String getServletName() { return "MOCK_SERVLET"; } + @Override public ServletContext getServletContext() { return null; } 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 c7545a94b..5fed12263 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 @@ -95,10 +95,12 @@ public class RecordingLogger implements Logger { this.name = name; } + @Override public Logger getLogger(@SuppressWarnings("hiding") String name) { return new RecordingLogger(name); } + @Override public String getName() { return name; } @@ -109,6 +111,7 @@ public class RecordingLogger implements Logger { } } + @Override public void warn(String msg, Throwable th) { synchronized (warnings) { warnings.add(new Warning(msg, th)); @@ -127,6 +130,7 @@ public class RecordingLogger implements Logger { // Ignore (not relevant to test failures) } + @Override public void debug(String msg, Throwable th) { // Ignore (not relevant to test failures) } @@ -145,14 +149,17 @@ public class RecordingLogger implements Logger { // Ignore (not relevant to test failures) } + @Override public boolean isDebugEnabled() { return false; } + @Override public void setDebugEnabled(boolean enabled) { // Ignore (not relevant to test failures) } + @Override public void warn(String msg, Object... args) { synchronized (warnings) { warnings.add(new Warning( @@ -160,32 +167,39 @@ public class RecordingLogger implements Logger { } } + @Override public void warn(Throwable thrown) { synchronized (warnings) { warnings.add(new Warning(thrown)); } } + @Override public void info(String msg, Object... args) { // Ignore (not relevant to test failures) } + @Override public void info(Throwable thrown) { // Ignore (not relevant to test failures) } + @Override public void info(String msg, Throwable thrown) { // Ignore (not relevant to test failures) } + @Override public void debug(String msg, Object... args) { // Ignore (not relevant to test failures) } + @Override public void debug(Throwable thrown) { // Ignore (not relevant to test failures) } + @Override public void ignore(Throwable arg0) { // Ignore (not relevant to test failures) } 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 e550e6c56..605c69a84 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 @@ -92,6 +92,7 @@ public class SimpleHttpServer { private ServletContextHandler smart(final String path) { GitServlet gs = new GitServlet(); gs.setRepositoryResolver(new RepositoryResolver() { + @Override public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { diff --git a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs index 10c29d557..47cca3692 100644 --- a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs index 10c29d557..47cca3692 100644 --- a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs index 808ec3a2c..2db1c4f21 100644 --- a/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs index 10c29d557..47cca3692 100644 --- a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs index 808ec3a2c..2db1c4f21 100644 --- a/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java index c4e34eed0..b78ee047e 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java @@ -130,6 +130,7 @@ public class CleanFilter extends FilterCommand { this.aOut = new AtomicObjectOutputStream(tmpFile.toAbsolutePath()); } + @Override public int run() throws IOException { try { byte[] buf = new byte[8192]; 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 1f0df882d..caf034d93 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 @@ -171,6 +171,7 @@ public abstract class AnyLongObjectId implements Comparable { * @return < 0 if this id comes before other; 0 if this id is equal to * other; > 0 if this id comes after other. */ + @Override public final int compareTo(final AnyLongObjectId other) { if (this == other) return 0; @@ -262,6 +263,7 @@ public abstract class AnyLongObjectId implements Comparable { return abbr.prefixCompare(this) == 0; } + @Override public final int hashCode() { return (int) (w1 >> 32); } @@ -277,6 +279,7 @@ public abstract class AnyLongObjectId implements Comparable { return other != null ? equals(this, other) : false; } + @Override public final boolean equals(final Object o) { if (o instanceof AnyLongObjectId) return equals((AnyLongObjectId) o); diff --git a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs index 10c29d557..47cca3692 100644 --- a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java index b675d3c31..0bc2a3f8d 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 @@ -127,6 +127,7 @@ public class CLIRepositoryTestCase extends LocalDiskRepositoryTestCase { return JGitTestUtil.writeTrashFile(db, name, data); } + @Override protected String read(final File file) throws IOException { return JGitTestUtil.read(file); } diff --git a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java index b08bc8afe..2d0c8974e 100644 --- a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java +++ b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java @@ -156,6 +156,7 @@ public class CLIGitCommand extends Main { return new PrintWriter(result.err); } + @Override void init(final TextBuiltin cmd) throws IOException { cmd.outs = result.out; cmd.errs = result.err; 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 35467c630..c0593a78f 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 @@ -706,6 +706,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { ExecutorService executor = Executors.newSingleThreadExecutor(); return executor.submit(new Callable() { + @Override public Object call() throws IOException { try { stream.write(data); diff --git a/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs index 4f1759fb3..763144c86 100644 --- a/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 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 2673cc887..99ba3b4b4 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 @@ -110,6 +110,7 @@ public class CommandCatalog { private static CommandRef[] toSortedArray(final 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) { return o1.getName().compareTo(o2.getName()); } 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 f07c3ca8b..7b715751d 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 @@ -88,6 +88,7 @@ class Glog extends RevWalkTextBuiltin { final JButton repaint = new JButton(); repaint.setText(CLIText.get().repaint); repaint.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { graphPane.repaint(); } 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 6262ad246..f35d4fdba 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 @@ -76,6 +76,7 @@ class LsRemote extends TextBuiltin { .setTimeout(timeout).setHeads(heads).setTags(tags); TreeSet refs = new TreeSet(new Comparator() { + @Override public int compare(Ref r1, Ref r2) { return r1.getName().compareTo(r2.getName()); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java index 05d094f0d..f8dd46187 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java @@ -84,12 +84,14 @@ import org.kohsuke.args4j.Option; class DiffAlgorithms extends TextBuiltin { final Algorithm myers = new Algorithm() { + @Override DiffAlgorithm create() { return MyersDiff.INSTANCE; } }; final Algorithm histogram = new Algorithm() { + @Override DiffAlgorithm create() { HistogramDiff d = new HistogramDiff(); d.setFallbackAlgorithm(null); @@ -98,6 +100,7 @@ class DiffAlgorithms extends TextBuiltin { }; final Algorithm histogram_myers = new Algorithm() { + @Override DiffAlgorithm create() { HistogramDiff d = new HistogramDiff(); d.setFallbackAlgorithm(MyersDiff.INSTANCE); @@ -234,6 +237,7 @@ class DiffAlgorithms extends TextBuiltin { } Collections.sort(all, new Comparator() { + @Override public int compare(Test a, Test b) { int result = Long.signum(a.runningTimeNanos - b.runningTimeNanos); if (result == 0) { diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java index 52b6d190d..6817325c5 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java @@ -219,6 +219,7 @@ class LfsStore extends TextBuiltin { return false; } + @Override protected void run() throws Exception { AppServer server = new AppServer(port); URI baseURI = server.getURI(); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java index aa258073b..415c7d320 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java @@ -85,6 +85,7 @@ class ShowCommands extends TextBuiltin { static enum Format { /** */ USAGE { + @Override void print(ThrowingPrintWriter err, final CommandRef c) throws IOException { String usage = c.getUsage(); if (usage != null && usage.length() > 0) @@ -94,6 +95,7 @@ class ShowCommands extends TextBuiltin { /** */ CLASSES { + @Override void print(ThrowingPrintWriter err, final CommandRef c) throws IOException { err.print(c.getImplementationClassName()); } @@ -101,6 +103,7 @@ class ShowCommands extends TextBuiltin { /** */ URLS { + @Override void print(ThrowingPrintWriter err, final CommandRef c) throws IOException { final ClassLoader ldr = c.getImplementationClassLoader(); diff --git a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs index 10c29d557..47cca3692 100644 --- a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java index 5ad73f17b..ed3907e9b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java @@ -1074,30 +1074,37 @@ public class AddCommandTest extends RepositoryTestCase { FS executableFs = new FS() { + @Override public boolean supportsExecute() { return true; } + @Override public boolean setExecute(File f, boolean canExec) { return true; } + @Override public ProcessBuilder runInShell(String cmd, String[] args) { return null; } + @Override public boolean retryFailedLockFileCommit() { return false; } + @Override public FS newInstance() { return this; } + @Override protected File discoverGitExe() { return null; } + @Override public boolean canExecute(File f) { try { return read(f).startsWith("binary:"); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java index 54d58eca4..40545ce2a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ArchiveCommandTest.java @@ -79,6 +79,7 @@ public class ArchiveCommandTest extends RepositoryTestCase { ArchiveCommand.registerFormat(format.SUFFIXES.get(0), format); } + @Override @After public void tearDown() { ArchiveCommand.unregisterFormat(format.SUFFIXES.get(0)); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java index 0e1cf02c8..fd42ca5b3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java @@ -64,6 +64,7 @@ import org.junit.Test; public class CleanCommandTest extends RepositoryTestCase { private Git git; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java index 8a728caf7..e7a84f2d1 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java @@ -85,6 +85,7 @@ public class CloneCommandTest extends RepositoryTestCase { private TestRepository tr; + @Override public void setUp() throws Exception { super.setUp(); tr = new TestRepository(db); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java index 473dce113..7e657e64a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java @@ -92,30 +92,37 @@ public class CommitCommandTest extends RepositoryTestCase { FS executableFs = new FS() { + @Override public boolean supportsExecute() { return true; } + @Override public boolean setExecute(File f, boolean canExec) { return true; } + @Override public ProcessBuilder runInShell(String cmd, String[] args) { return null; } + @Override public boolean retryFailedLockFileCommit() { return false; } + @Override public FS newInstance() { return this; } + @Override protected File discoverGitExe() { return null; } + @Override public boolean canExecute(File f) { return true; } @@ -137,30 +144,37 @@ public class CommitCommandTest extends RepositoryTestCase { FS nonExecutableFs = new FS() { + @Override public boolean supportsExecute() { return false; } + @Override public boolean setExecute(File f, boolean canExec) { return false; } + @Override public ProcessBuilder runInShell(String cmd, String[] args) { return null; } + @Override public boolean retryFailedLockFileCommit() { return false; } + @Override public FS newInstance() { return this; } + @Override protected File discoverGitExe() { return null; } + @Override public boolean canExecute(File f) { return false; } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java index 5f1013175..48d373344 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java @@ -623,6 +623,7 @@ public class EolRepositoryTest extends RepositoryTestCase { for (int i = 0; i < dc.getEntryCount(); i++) { editor.add(new DirCacheEditor.PathEdit( dc.getEntry(i).getPathString()) { + @Override public void apply(DirCacheEntry ent) { ent.smudgeRacilyClean(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java index a853d6ab8..c9f77ea8a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java @@ -58,6 +58,7 @@ public class LsRemoteCommandTest extends RepositoryTestCase { private Git git; + @Override public void setUp() throws Exception { super.setUp(); git = new Git(db); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java index a526fdaa7..823516b99 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java @@ -346,6 +346,7 @@ public class PullCommandTest extends RepositoryTestCase { /** global rebase config should be respected */ public void testPullWithRebasePreserve1Config() throws Exception { Callable setup = new Callable() { + @Override public PullResult call() throws Exception { StoredConfig config = dbTarget.getConfig(); config.setString("pull", null, "rebase", "preserve"); @@ -360,6 +361,7 @@ public class PullCommandTest extends RepositoryTestCase { /** the branch-local config should win over the global config */ public void testPullWithRebasePreserveConfig2() throws Exception { Callable setup = new Callable() { + @Override public PullResult call() throws Exception { StoredConfig config = dbTarget.getConfig(); config.setString("pull", null, "rebase", "false"); @@ -375,6 +377,7 @@ public class PullCommandTest extends RepositoryTestCase { /** the branch-local config should be respected */ public void testPullWithRebasePreserveConfig3() throws Exception { Callable setup = new Callable() { + @Override public PullResult call() throws Exception { StoredConfig config = dbTarget.getConfig(); config.setString("branch", "master", "rebase", "preserve"); @@ -389,6 +392,7 @@ public class PullCommandTest extends RepositoryTestCase { /** global rebase config should be respected */ public void testPullWithRebaseConfig1() throws Exception { Callable setup = new Callable() { + @Override public PullResult call() throws Exception { StoredConfig config = dbTarget.getConfig(); config.setString("pull", null, "rebase", "true"); @@ -403,6 +407,7 @@ public class PullCommandTest extends RepositoryTestCase { /** the branch-local config should win over the global config */ public void testPullWithRebaseConfig2() throws Exception { Callable setup = new Callable() { + @Override public PullResult call() throws Exception { StoredConfig config = dbTarget.getConfig(); config.setString("pull", null, "rebase", "preserve"); @@ -418,6 +423,7 @@ public class PullCommandTest extends RepositoryTestCase { /** the branch-local config should be respected */ public void testPullWithRebaseConfig3() throws Exception { Callable setup = new Callable() { + @Override public PullResult call() throws Exception { StoredConfig config = dbTarget.getConfig(); config.setString("branch", "master", "rebase", "true"); @@ -432,6 +438,7 @@ public class PullCommandTest extends RepositoryTestCase { /** without config it should merge */ public void testPullWithoutConfig() throws Exception { Callable setup = new Callable() { + @Override public PullResult call() throws Exception { return target.pull().call(); } @@ -443,6 +450,7 @@ public class PullCommandTest extends RepositoryTestCase { /** the branch local config should win over the global config */ public void testPullWithMergeConfig() throws Exception { Callable setup = new Callable() { + @Override public PullResult call() throws Exception { StoredConfig config = dbTarget.getConfig(); config.setString("pull", null, "rebase", "true"); @@ -458,6 +466,7 @@ public class PullCommandTest extends RepositoryTestCase { /** the branch local config should win over the global config */ public void testPullWithMergeConfig2() throws Exception { Callable setup = new Callable() { + @Override public PullResult call() throws Exception { StoredConfig config = dbTarget.getConfig(); config.setString("pull", null, "rebase", "false"); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java index 24cb522a0..0cc0816c1 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java @@ -2269,11 +2269,13 @@ public class RebaseCommandTest extends RepositoryTestCase { RebaseResult res = git.rebase().setUpstream("HEAD~2") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { steps.add(0, new RebaseTodoLine( "# Comment that should not be processed")); } + @Override public String modifyCommitMessage(String commit) { fail("modifyCommitMessage() was not expected to be called"); return commit; @@ -2284,6 +2286,7 @@ public class RebaseCommandTest extends RepositoryTestCase { RebaseResult res2 = git.rebase().setUpstream("HEAD~2") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { // delete RevCommit c4 @@ -2293,6 +2296,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { fail("modifyCommitMessage() was not expected to be called"); return commit; @@ -2514,6 +2518,7 @@ public class RebaseCommandTest extends RepositoryTestCase { RebaseResult res = git.rebase().setUpstream("HEAD~2") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.REWORD); @@ -2522,6 +2527,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return "rewritten commit message"; } @@ -2560,6 +2566,7 @@ public class RebaseCommandTest extends RepositoryTestCase { RebaseResult res = git.rebase().setUpstream("HEAD~2") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.EDIT); @@ -2568,6 +2575,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return ""; // not used } @@ -2624,6 +2632,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.rebase().setUpstream("HEAD~3") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(1).setAction(Action.SQUASH); @@ -2632,6 +2641,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { final File messageSquashFile = new File(db .getDirectory(), "rebase-merge/message-squash"); @@ -2704,6 +2714,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.rebase().setUpstream("HEAD~4") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(1).setAction(Action.SQUASH); @@ -2713,6 +2724,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { final File messageSquashFile = new File(db.getDirectory(), "rebase-merge/message-squash"); @@ -2786,6 +2798,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.rebase().setUpstream("HEAD~4") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(1).setAction(Action.FIXUP); @@ -2795,6 +2808,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { final File messageSquashFile = new File(db .getDirectory(), "rebase-merge/message-squash"); @@ -2861,6 +2875,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.rebase().setUpstream("HEAD~3") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(1).setAction(Action.FIXUP); @@ -2869,6 +2884,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { fail("No callback to modify commit message expected for single fixup"); return commit; @@ -2910,6 +2926,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.rebase().setUpstream("HEAD~2") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(1).setAction(Action.FIXUP); @@ -2918,6 +2935,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { fail("No callback to modify commit message expected for single fixup"); return commit; @@ -2950,6 +2968,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.rebase().setUpstream("HEAD~1") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.FIXUP); @@ -2958,6 +2977,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return commit; } @@ -2982,6 +3002,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.rebase().setUpstream("HEAD~1") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.SQUASH); @@ -2990,6 +3011,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return commit; } @@ -3013,6 +3035,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.rebase().setUpstream("HEAD~1") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.EDIT); @@ -3021,6 +3044,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return commit; } @@ -3055,6 +3079,7 @@ public class RebaseCommandTest extends RepositoryTestCase { RebaseResult result = git.rebase().setUpstream("HEAD~2") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { steps.remove(0); try { @@ -3064,6 +3089,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return commit; } @@ -3097,6 +3123,7 @@ public class RebaseCommandTest extends RepositoryTestCase { RebaseResult result = git.rebase().setUpstream("HEAD~2") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { steps.remove(0); try { @@ -3106,6 +3133,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return "rewritten commit message"; } @@ -3114,6 +3142,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.add().addFilepattern(FILE1).call(); result = git.rebase().runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { steps.remove(0); try { @@ -3123,6 +3152,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return "rewritten commit message"; } @@ -3160,6 +3190,7 @@ public class RebaseCommandTest extends RepositoryTestCase { RebaseResult result = git.rebase().setUpstream("HEAD~3") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.PICK); @@ -3170,6 +3201,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return "squashed message"; } @@ -3178,6 +3210,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.add().addFilepattern(FILE1).call(); result = git.rebase().runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.PICK); @@ -3188,6 +3221,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return "squashed message"; } @@ -3226,6 +3260,7 @@ public class RebaseCommandTest extends RepositoryTestCase { RebaseResult result = git.rebase().setUpstream("HEAD~3") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.PICK); @@ -3236,6 +3271,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return commit; } @@ -3244,6 +3280,7 @@ public class RebaseCommandTest extends RepositoryTestCase { git.add().addFilepattern(FILE1).call(); result = git.rebase().runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.PICK); @@ -3254,6 +3291,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return "commit"; } @@ -3297,6 +3335,7 @@ public class RebaseCommandTest extends RepositoryTestCase { RebaseResult result = git.rebase().setUpstream("HEAD~2") .runInteractively(new InteractiveHandler() { + @Override public void prepareSteps(List steps) { try { steps.get(0).setAction(Action.EDIT); @@ -3306,6 +3345,7 @@ public class RebaseCommandTest extends RepositoryTestCase { } } + @Override public String modifyCommitMessage(String commit) { return commit; } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java index 4c09a8257..5c437ac5a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java @@ -69,6 +69,7 @@ public class RenameBranchCommandTest extends RepositoryTestCase { private Git git; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java index 862711571..f2e4d5b3b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java @@ -77,6 +77,7 @@ public class StashApplyCommandTest extends RepositoryTestCase { private File committedFile; + @Override @Before public void setUp() throws Exception { super.setUp(); 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 ae8551e64..b9f9f5b49 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 @@ -82,6 +82,7 @@ public class StashCreateCommandTest extends RepositoryTestCase { private File untrackedFile; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java index 859277e93..5d5be5ddf 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java @@ -73,6 +73,7 @@ public class StashDropCommandTest extends RepositoryTestCase { private File committedFile; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java index 443c956b7..73c230ac6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java @@ -395,6 +395,7 @@ public class DiffEntryTest extends RepositoryTestCase { assertTrue(walk.next()); editor.add(new PathEdit("a.txt") { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.EXECUTABLE_FILE); ent.setObjectId(walk.getObjectId(0)); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java index 5408f761d..d12f302da 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java @@ -211,6 +211,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { DirCache dc = db.lockDirCache(); IndexChangedListener listener = new IndexChangedListener() { + @Override public void onIndexChanged(IndexChangedEvent event) { throw new ReceivedEventMarkerException(); } @@ -238,6 +239,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { dc = db.lockDirCache(); listener = new IndexChangedListener() { + @Override public void onIndexChanged(IndexChangedEvent event) { throw new ReceivedEventMarkerException(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java index 3c1f231db..362410067 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java @@ -56,6 +56,7 @@ public class ConfigChangeEventTest extends RepositoryTestCase { final ConfigChangedEvent[] events = new ConfigChangedEvent[1]; db.getListenerList().addConfigChangedListener( new ConfigChangedListener() { + @Override public void onConfigChanged(ConfigChangedEvent event) { events[0] = event; } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java index c110a3d3f..03ed82443 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/gitrepo/RepoCommandTest.java @@ -79,6 +79,7 @@ public class RepoCommandTest extends RepositoryTestCase { private ObjectId oldCommitId; + @Override public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java index ece8f6736..29da63f0b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java @@ -81,6 +81,7 @@ public class AbbreviationTest extends LocalDiskRepositoryTestCase { private TestRepository test; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -89,6 +90,7 @@ public class AbbreviationTest extends LocalDiskRepositoryTestCase { test = new TestRepository(db); } + @Override @After public void tearDown() throws Exception { if (reader != null) { 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 1d71cb3cf..09438e964 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 @@ -77,6 +77,7 @@ import org.junit.Before; import org.junit.Test; public class ConcurrentRepackTest extends RepositoryTestCase { + @Override @Before public void setUp() throws Exception { WindowCacheConfig windowCacheConfig = new WindowCacheConfig(); @@ -85,6 +86,7 @@ public class ConcurrentRepackTest extends RepositoryTestCase { super.setUp(); } + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java index 07a7be746..ebb5a4f12 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java @@ -68,6 +68,7 @@ public class GcConcurrentTest extends GcTestCase { class DoRepack extends EmptyProgressMonitor implements Callable { + @Override public void beginTask(String title, int totalWork) { if (title.equals(JGitText.get().writingObjects)) { try { @@ -81,6 +82,7 @@ public class GcConcurrentTest extends GcTestCase { } /** @return 0 for success, 1 in case of error when writing pack */ + @Override public Integer call() throws Exception { try { gc.setProgressMonitor(this); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java index 22bec3762..11a2a22ed 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java @@ -105,6 +105,7 @@ public class GcPackRefsTest extends GcTestCase { Callable packRefs = new Callable() { /** @return 0 for success, 1 in case of error when writing pack */ + @Override public Integer call() throws Exception { syncPoint.await(); try { @@ -158,6 +159,7 @@ public class GcPackRefsTest extends GcTestCase { try { Future result = pool.submit(new Callable() { + @Override public Result call() throws Exception { RefUpdate update = new RefDirectoryUpdate( (RefDirectory) repo.getRefDatabase(), @@ -182,6 +184,7 @@ public class GcPackRefsTest extends GcTestCase { }); pool.submit(new Callable() { + @Override public Void call() throws Exception { refUpdateLockedRef.await(); gc.packRefs(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java index 90c115227..fc91bd038 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java @@ -62,6 +62,7 @@ public abstract class GcTestCase extends LocalDiskRepositoryTestCase { protected GC gc; protected RepoStatistics stats; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -71,6 +72,7 @@ public abstract class GcTestCase extends LocalDiskRepositoryTestCase { gc = new GC(repo); } + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java index 1293bef9a..f1cbb99d5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java @@ -218,6 +218,7 @@ public class ObjectDirectoryTest extends RepositoryTestCase { private Collection> blobInsertersForTheSameFanOutDir( final ObjectDirectory dir) { Callable callable = new Callable() { + @Override public ObjectId call() throws Exception { return dir.newInserter().insert(Constants.OBJ_BLOB, new byte[0]); } 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 1c10bb335..986bfe51d 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 @@ -107,6 +107,7 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { return rng; } + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -120,6 +121,7 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { wc = (WindowCursor) repo.newObjectReader(); } + @Override @After public void tearDown() throws Exception { if (wc != null) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackIndexTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackIndexTestCase.java index b6aa4bcec..9a43742da 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackIndexTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackIndexTestCase.java @@ -62,6 +62,7 @@ public abstract class PackIndexTestCase extends RepositoryTestCase { PackIndex denseIdx; + @Override public void setUp() throws Exception { super.setUp(); smallIdx = PackIndex.open(getFileForPack34be9032()); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java index a4aa8bcee..91dac09a5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackReverseIndexTest.java @@ -65,6 +65,7 @@ public class PackReverseIndexTest extends RepositoryTestCase { /** * Set up tested class instance, test constructor by the way. */ + @Override @Before public void setUp() throws Exception { super.setUp(); 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 e4dfe7587..76df03876 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 @@ -131,6 +131,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { private RevCommit c5; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -143,6 +144,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { write(alt, db.getObjectDatabase().getDirectory().getAbsolutePath() + "\n"); } + @Override @After public void tearDown() throws Exception { if (writer != null) { @@ -882,6 +884,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { entries.add(me.cloneEntry()); } Collections.sort(entries, new Comparator() { + @Override public int compare(MutableEntry o1, MutableEntry o2) { return Long.signum(o1.getOffset() - o2.getOffset()); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java index 5999acf69..b5df7a66c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java @@ -100,6 +100,7 @@ public class RefDirectoryTest extends LocalDiskRepositoryTestCase { private RevTag v1_0; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -547,6 +548,7 @@ public class RefDirectoryTest extends LocalDiskRepositoryTestCase { ListenerHandle listener = Repository.getGlobalListenerList() .addRefsChangedListener(new RefsChangedListener() { + @Override public void onRefsChanged(RefsChangedEvent event) { count[0]++; } @@ -1271,6 +1273,7 @@ public class RefDirectoryTest extends LocalDiskRepositoryTestCase { newRepo.getListenerList().addRefsChangedListener( new RefsChangedListener() { + @Override public void onRefsChanged(RefsChangedEvent event) { try { refDb.getRefs("ref"); @@ -1440,23 +1443,28 @@ public class RefDirectoryTest extends LocalDiskRepositoryTestCase { private static final class StrictWorkMonitor implements ProgressMonitor { private int lastWork, totalWork; + @Override public void start(int totalTasks) { // empty } + @Override public void beginTask(String title, int total) { this.totalWork = total; lastWork = 0; } + @Override public void update(int completed) { lastWork += completed; } + @Override public void endTask() { assertEquals("Units of work recorded", totalWork, lastWork); } + @Override public boolean isCancelled() { return false; } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java index c6653bfdb..c5ab76683 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java @@ -93,6 +93,7 @@ public class UnpackedObjectTest extends LocalDiskRepositoryTestCase { return rng; } + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -105,6 +106,7 @@ public class UnpackedObjectTest extends LocalDiskRepositoryTestCase { wc = (WindowCursor) repo.newObjectReader(); } + @Override @After public void tearDown() throws Exception { if (wc != null) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/LocalDiskRefTreeDatabaseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/LocalDiskRefTreeDatabaseTest.java index 47f70d7bd..67a781990 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/LocalDiskRefTreeDatabaseTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/LocalDiskRefTreeDatabaseTest.java @@ -77,6 +77,7 @@ public class LocalDiskRefTreeDatabaseTest extends LocalDiskRepositoryTestCase { private RevCommit A; private RevCommit B; + @Override @Before public void setUp() throws Exception { FileRepository init = createWorkRepository(); 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 e4d0f1d29..9aef94369 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 @@ -711,6 +711,7 @@ public class RefTreeDatabaseTest { RefTreeDatabaseTest.this.refdb = refs; } + @Override public RefDatabase getRefDatabase() { return refs; } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java index 733f1668b..3c1ff9860 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java @@ -86,6 +86,7 @@ public class IndexDiffTest extends RepositoryTestCase { final ObjectId id = inserter.insert(Constants.OBJ_BLOB, IO.readFully(f)); return new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.REGULAR_FILE); ent.setLength(f.length()); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ThreadSafeProgressMonitorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ThreadSafeProgressMonitorTest.java index 2845f8acf..545a188a9 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ThreadSafeProgressMonitorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ThreadSafeProgressMonitorTest.java @@ -62,6 +62,7 @@ public class ThreadSafeProgressMonitorTest { final ThreadSafeProgressMonitor pm = new ThreadSafeProgressMonitor(mock); runOnThread(new Runnable() { + @Override public void run() { try { pm.start(1); @@ -128,6 +129,7 @@ public class ThreadSafeProgressMonitorTest { final CountDownLatch doEndWorker = new CountDownLatch(1); final Thread bg = new Thread() { + @Override public void run() { assertFalse(pm.isCancelled()); @@ -175,24 +177,29 @@ public class ThreadSafeProgressMonitorTest { int value; + @Override public void update(int completed) { value += completed; } + @Override public void start(int totalTasks) { value = totalTasks; } + @Override public void beginTask(String title, int totalWork) { taskTitle = title; value = totalWork; } + @Override public void endTask() { taskTitle = null; value = 0; } + @Override public boolean isCancelled() { return false; } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NLSTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NLSTest.java index a74ea9874..65f2d0945 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NLSTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NLSTest.java @@ -123,6 +123,7 @@ public class NLSTest { this.locale = locale; } + @Override public TranslationBundle call() throws Exception { NLS.setLocale(locale); barrier.await(); // wait for the other thread to set its locale diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/DateRevQueueTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/DateRevQueueTest.java index 766a27986..e5e51f727 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/DateRevQueueTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/DateRevQueueTest.java @@ -50,10 +50,12 @@ import static org.junit.Assert.assertNull; import org.junit.Test; public class DateRevQueueTest extends RevQueueTestCase { + @Override protected DateRevQueue create() { return new DateRevQueue(); } + @Override @Test public void testEmpty() throws Exception { super.testEmpty(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java index 8877c380d..a4252ee11 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FIFORevQueueTest.java @@ -52,10 +52,12 @@ import java.util.ArrayList; import org.junit.Test; public class FIFORevQueueTest extends RevQueueTestCase { + @Override protected FIFORevQueue create() { return new FIFORevQueue(); } + @Override @Test public void testEmpty() throws Exception { super.testEmpty(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java index 1b2c5e2f6..eaf0f8ad5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/LIFORevQueueTest.java @@ -53,10 +53,12 @@ import java.util.Collections; import org.junit.Test; public class LIFORevQueueTest extends RevQueueTestCase { + @Override protected LIFORevQueue create() { return new LIFORevQueue(); } + @Override @Test public void testEmpty() throws Exception { super.testEmpty(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevQueueTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevQueueTestCase.java index 51cf2f1b3..bedbedd66 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevQueueTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevQueueTestCase.java @@ -53,6 +53,7 @@ public abstract class RevQueueTestCase extends RevWalkTestCase { protected T q; + @Override public void setUp() throws Exception { super.setUp(); q = create(); 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 db19f004d..2ff08dd71 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 @@ -69,6 +69,7 @@ public class RevWalkPathFilter6012Test extends RevWalkTestCase { private HashMap byName; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java index a131e5e63..5c46659c0 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java @@ -161,6 +161,7 @@ public class SubmoduleAddTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java index 2b4649847..c7a009c5b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java @@ -321,6 +321,7 @@ public class SubmoduleInitTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleStatusTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleStatusTest.java index 51c180cd9..61df9d93f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleStatusTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleStatusTest.java @@ -92,6 +92,7 @@ public class SubmoduleStatusTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -124,6 +125,7 @@ public class SubmoduleStatusTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -164,6 +166,7 @@ public class SubmoduleStatusTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -215,6 +218,7 @@ public class SubmoduleStatusTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -261,6 +265,7 @@ public class SubmoduleStatusTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -316,6 +321,7 @@ public class SubmoduleStatusTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java index 54a6f77b4..13db44a9c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java @@ -95,6 +95,7 @@ public class SubmoduleSyncTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -156,6 +157,7 @@ public class SubmoduleSyncTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java index bcdd5e21b..7064f6097 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java @@ -93,6 +93,7 @@ public class SubmoduleUpdateTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(commit); @@ -136,6 +137,7 @@ public class SubmoduleUpdateTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -171,6 +173,7 @@ public class SubmoduleUpdateTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java index 72b4611df..2b032e13c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java @@ -87,6 +87,7 @@ import org.junit.Test; public class SubmoduleWalkTest extends RepositoryTestCase { private TestRepository testDb; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -118,6 +119,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -165,6 +167,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -217,6 +220,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -253,6 +257,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -286,6 +291,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path1) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id1); @@ -293,6 +299,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { }); editor.add(new PathEdit(path2) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id2); @@ -330,6 +337,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(subId); @@ -337,6 +345,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { }); editor.add(new PathEdit(DOT_GIT_MODULES) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.REGULAR_FILE); ent.setObjectId(gitmodulesBlob); @@ -375,6 +384,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { .add(DOT_GIT_MODULES, gitmodules.toText()) .edit(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(subId); @@ -412,6 +422,7 @@ public class SubmoduleWalkTest extends RepositoryTestCase { .add(DOT_GIT_MODULES, gitmodules.toText()) .edit(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(subId); 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 ba449508f..2fea8a92a 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 @@ -62,6 +62,7 @@ public class NetRCTest extends RepositoryTestCase { private File configFile; + @Override @Before public void setUp() throws Exception { super.setUp(); 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 8ec39bf56..fc520ab17 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 @@ -68,6 +68,7 @@ public class OpenSshConfigTest extends RepositoryTestCase { private OpenSshConfig osc; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushOptionsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushOptionsTest.java index c346d7904..f26201d56 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushOptionsTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushOptionsTest.java @@ -86,6 +86,7 @@ public class PushOptionsTest extends RepositoryTestCase { private ObjectId obj2; private ReceivePack receivePack; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -115,6 +116,7 @@ public class PushOptionsTest extends RepositoryTestCase { } } + @Override @After public void tearDown() { Transport.unregister(testProtocol); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java index 28473c79f..bd3faf4ef 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java @@ -432,12 +432,14 @@ public class PushProcessTest extends SampleDataRepositoryTestCase { // nothing here } + @Override public void push(ProgressMonitor monitor, Map refsToUpdate, OutputStream out) throws TransportException { push(monitor, refsToUpdate); } + @Override public void push(ProgressMonitor monitor, Map refsToUpdate) throws TransportException { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java index d66ace53e..0fa266a65 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java @@ -546,6 +546,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas } private static final class HidePrivateHook extends AbstractAdvertiseRefsHook { + @Override public Map getAdvertisedRefs(Repository r, RevWalk revWalk) { Map refs = new HashMap(r.getAllRefs()); assertNotNull(refs.remove(R_PRIVATE)); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SpiTransport.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SpiTransport.java index bb6c73809..71b909e03 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SpiTransport.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SpiTransport.java @@ -64,14 +64,17 @@ public class SpiTransport extends Transport { */ public static final TransportProtocol PROTO = new TransportProtocol() { + @Override public String getName() { return "Test SPI Transport Protocol"; } + @Override public Set getSchemes() { return Collections.singleton(SCHEME); } + @Override public Transport open(URIish uri, Repository local, String remoteName) throws NotSupportedException, TransportException { throw new NotSupportedException("not supported"); @@ -82,16 +85,19 @@ public class SpiTransport extends Transport { super(local, uri); } + @Override public FetchConnection openFetch() throws NotSupportedException, TransportException { throw new NotSupportedException("not supported"); } + @Override public PushConnection openPush() throws NotSupportedException, TransportException { throw new NotSupportedException("not supported"); } + @Override public void close() { // Intentionally left blank } 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 193c50f1f..e34cb9779 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 @@ -87,6 +87,7 @@ public class FileTreeIteratorTest extends RepositoryTestCase { private long[] mtime; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -383,6 +384,7 @@ public class FileTreeIteratorTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -417,6 +419,7 @@ public class FileTreeIteratorTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -452,6 +455,7 @@ public class FileTreeIteratorTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -486,6 +490,7 @@ public class FileTreeIteratorTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); @@ -521,6 +526,7 @@ public class FileTreeIteratorTest extends RepositoryTestCase { DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java index bb4b066bf..2f797e361 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java @@ -89,6 +89,7 @@ public class IndexDiffFilterTest extends RepositoryTestCase { private Git git; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilterTest.java index 9f0f06732..cba35d804 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilterTest.java @@ -66,6 +66,7 @@ public class InterIndexDiffFilterTest extends LocalDiskRepositoryTestCase { private Repository db; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java index 5edc1924f..d921aabdc 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java @@ -259,6 +259,7 @@ public class PathFilterGroupTest { DirCacheEditor dce = dc.editor(); dce.add(new DirCacheEditor.PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.REGULAR_FILE); } @@ -277,6 +278,7 @@ public class PathFilterGroupTest { DirCache dc = DirCache.newInCore(); DirCacheEditor dce = dc.editor(); dce.add(new DirCacheEditor.PathEdit(path + "/README") { + @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.REGULAR_FILE); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java index c213157b3..6b5ef7ec6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java @@ -166,6 +166,7 @@ public class UnionInputStreamTest { assertEquals(-1, u.read()); u.add(new ByteArrayInputStream(new byte[] { 20, 30 }) { + @Override public long skip(long n) { return 0; } @@ -180,11 +181,13 @@ public class UnionInputStreamTest { final UnionInputStream u = new UnionInputStream(); final boolean closed[] = new boolean[2]; u.add(new ByteArrayInputStream(new byte[] { 1 }) { + @Override public void close() { closed[0] = true; } }); u.add(new ByteArrayInputStream(new byte[] { 2 }) { + @Override public void close() { closed[1] = true; } @@ -211,11 +214,13 @@ public class UnionInputStreamTest { final UnionInputStream u = new UnionInputStream(); final boolean closed[] = new boolean[2]; u.add(new ByteArrayInputStream(new byte[] { 1 }) { + @Override public void close() { closed[0] = true; } }); u.add(new ByteArrayInputStream(new byte[] { 2 }) { + @Override public void close() { closed[1] = true; } @@ -234,6 +239,7 @@ public class UnionInputStreamTest { public void testExceptionDuringClose() { final UnionInputStream u = new UnionInputStream(); u.add(new ByteArrayInputStream(new byte[] { 1 }) { + @Override public void close() throws IOException { throw new IOException("I AM A TEST"); } diff --git a/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs index 808ec3a2c..2db1c4f21 100644 --- a/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 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 4d32235e6..4c8cf53ee 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 @@ -146,14 +146,17 @@ public class CommitGraphPane extends JTable { PersonIdent lastAuthor; + @Override public int getColumnCount() { return 3; } + @Override public int getRowCount() { return allCommits != null ? allCommits.size() : 0; } + @Override public Object getValueAt(final int rowIndex, final int columnIndex) { final PlotCommit c = allCommits.get(rowIndex); switch (columnIndex) { @@ -180,6 +183,7 @@ public class CommitGraphPane extends JTable { static class NameCellRender extends DefaultTableCellRenderer { private static final long serialVersionUID = 1L; + @Override public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { @@ -201,6 +205,7 @@ public class CommitGraphPane extends JTable { private final DateFormat fmt = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$ + @Override public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { @@ -223,6 +228,7 @@ public class CommitGraphPane extends JTable { PlotCommit commit; + @Override @SuppressWarnings("unchecked") public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, diff --git a/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs index 4f1759fb3..763144c86 100644 --- a/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java index 16ec1463c..0ef47a415 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java @@ -134,6 +134,7 @@ public class AddCommand extends GitCommand { * * @return the DirCache after Add */ + @Override public DirCache call() throws GitAPIException, NoFilepatternException { if (filepatterns.isEmpty()) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddNoteCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddNoteCommand.java index 4235e3786..fa88fb78e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddNoteCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddNoteCommand.java @@ -81,6 +81,7 @@ public class AddNoteCommand extends GitCommand { super(repo); } + @Override public Note call() throws GitAPIException { checkCallable(); NoteMap map = NoteMap.newEmptyMap(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java index d74e99139..45311f7f9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java @@ -109,6 +109,7 @@ public class ApplyCommand extends GitCommand { * @throws PatchFormatException * @throws PatchApplyException */ + @Override public ApplyResult call() throws GitAPIException, PatchFormatException, PatchApplyException { checkCallable(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java index 2a2e07ddd..ce73d0e6b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java @@ -198,6 +198,7 @@ public class BlameCommand extends GitCommand { * * @return list of lines */ + @Override public BlameResult call() throws GitAPIException { checkCallable(); try (BlameGenerator gen = new BlameGenerator(repo, path)) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java index c17ae5c00..bb94e5494 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java @@ -196,6 +196,7 @@ public class CheckoutCommand extends GitCommand { * if the checkout results in a conflict * @return the newly created branch */ + @Override public Ref call() throws GitAPIException, RefAlreadyExistsException, RefNotFoundException, InvalidRefNameException, CheckoutConflictException { @@ -455,6 +456,7 @@ public class CheckoutCommand extends GitCommand { final String filterCommand = treeWalk .getFilterCommand(Constants.ATTR_FILTER_TYPE_SMUDGE); editor.add(new PathEdit(path) { + @Override public void apply(DirCacheEntry ent) { int stage = ent.getStage(); if (stage > DirCacheEntry.STAGE_0) { @@ -491,6 +493,7 @@ public class CheckoutCommand extends GitCommand { final String filterCommand = treeWalk .getFilterCommand(Constants.ATTR_FILTER_TYPE_SMUDGE); editor.add(new PathEdit(treeWalk.getPathString()) { + @Override public void apply(DirCacheEntry ent) { ent.setObjectId(blobId); ent.setFileMode(mode); 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 276bf96ea..d3af7a619 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java @@ -116,6 +116,7 @@ public class CherryPickCommand extends GitCommand { * @throws NoMessageException * @throws NoHeadException */ + @Override public CherryPickResult call() throws GitAPIException, NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, NoHeadException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java index 7e331fd84..153513aa0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java @@ -94,6 +94,7 @@ public class CleanCommand extends GitCommand> { * @throws GitAPIException * @throws NoWorkTreeException */ + @Override public Set call() throws NoWorkTreeException, GitAPIException { Set files = new TreeSet(); try { 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 b065b9484..baa6d7fce 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java @@ -127,6 +127,7 @@ public class CloneCommand extends TransportCommand { * @throws org.eclipse.jgit.api.errors.TransportException * @throws GitAPIException */ + @Override public Git call() throws GitAPIException, InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException { Repository repository = null; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java index e1793f31a..f3bc91aed 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java @@ -168,6 +168,7 @@ public class CommitCommand extends GitCommand { * if there are either pre-commit or commit-msg hooks present in * the repository and one of them rejects the commit. */ + @Override public RevCommit call() throws GitAPIException, NoHeadException, NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java index 69d82bcc6..39420d0ee 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java @@ -120,6 +120,7 @@ public class CreateBranchCommand extends GitCommand { * invalid * @return the newly created branch */ + @Override public Ref call() throws GitAPIException, RefAlreadyExistsException, RefNotFoundException, InvalidRefNameException { checkCallable(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java index ecc1ce5a7..dcfad6a44 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java @@ -97,6 +97,7 @@ public class DeleteBranchCommand extends GitCommand> { * @throws CannotDeleteCurrentBranchException * @return the list with the (full) names of the deleted branches */ + @Override public List call() throws GitAPIException, NotMergedException, CannotDeleteCurrentBranchException { checkCallable(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java index 3aeec48d9..0d312dd40 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java @@ -80,6 +80,7 @@ public class DeleteTagCommand extends GitCommand> { /** * @return the list with the full names of the deleted tags */ + @Override public List call() throws GitAPIException { checkCallable(); List result = new ArrayList(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java index be456662d..a119fcc84 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java @@ -305,6 +305,7 @@ public class DescribeCommand extends GitCommand { return null; Candidate best = Collections.min(candidates, new Comparator() { + @Override public int compare(Candidate o1, Candidate o2) { return o1.depth - o2.depth; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java index 3e3a7a89c..b137fc53c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java @@ -109,6 +109,7 @@ public class DiffCommand extends GitCommand> { * * @return a DiffEntry for each path which is different */ + @Override public List call() throws GitAPIException { final DiffFormatter diffFmt; if (out != null && !showNameAndStatusOnly) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java index de512761a..1f4dcdd3e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java @@ -112,6 +112,7 @@ public class FetchCommand extends TransportCommand { * @throws org.eclipse.jgit.api.errors.TransportException * when an error occurs during transport */ + @Override public FetchResult call() throws GitAPIException, InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException { checkCallable(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java index 2cd5f59a7..96995693a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java @@ -147,6 +147,7 @@ public class Git implements AutoCloseable { * * @since 3.2 */ + @Override public void close() { if (closeRepo) repo.close(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/GitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/GitCommand.java index e9751f94a..2a23408b5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/GitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/GitCommand.java @@ -126,5 +126,6 @@ public abstract class GitCommand implements Callable { * @throws GitAPIException * or subclass thereof when an error occurs */ + @Override public abstract T call() throws GitAPIException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java index 37a788e85..649484cf6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java @@ -73,6 +73,7 @@ public class InitCommand implements Callable { * * @return the newly created {@code Git} object with associated repository */ + @Override public Git call() throws GitAPIException { try { RepositoryBuilder builder = new RepositoryBuilder(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java index efcfd1682..438ec89ff 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java @@ -101,6 +101,7 @@ public class ListBranchCommand extends GitCommand> { super(repo); } + @Override public List call() throws GitAPIException { checkCallable(); List resultRefs; @@ -126,6 +127,7 @@ public class ListBranchCommand extends GitCommand> { } Collections.sort(resultRefs, new Comparator() { + @Override public int compare(Ref o1, Ref o2) { return o1.getName().compareTo(o2.getName()); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java index ff963ede8..cdb32ca2f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java @@ -77,6 +77,7 @@ public class ListNotesCommand extends GitCommand> { /** * @return the requested notes */ + @Override public List call() throws GitAPIException { checkCallable(); List notes = new ArrayList(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java index a3b701be8..6d46cdf9a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java @@ -74,6 +74,7 @@ public class ListTagCommand extends GitCommand> { /** * @return the tags available */ + @Override public List call() throws GitAPIException { checkCallable(); Map refList; @@ -87,6 +88,7 @@ public class ListTagCommand extends GitCommand> { throw new JGitInternalException(e.getMessage(), e); } Collections.sort(tags, new Comparator() { + @Override public int compare(Ref o1, Ref o2) { return o1.getName().compareTo(o2.getName()); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java index bb1a73814..47b259981 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java @@ -132,6 +132,7 @@ public class LogCommand extends GitCommand> { * @throws NoHeadException * of the references ref cannot be resolved */ + @Override public Iterable call() throws GitAPIException, NoHeadException { checkCallable(); if (pathFilters.size() > 0) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java index f3527fd80..9ad71250e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java @@ -153,6 +153,7 @@ public class LsRemoteCommand extends * @throws org.eclipse.jgit.api.errors.TransportException * for errors that occurs during transport */ + @Override public Collection call() throws GitAPIException, InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java index 2daa0d1a3..de7b604cf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java @@ -134,10 +134,12 @@ public class MergeCommand extends GitCommand { */ FF_ONLY; + @Override public String toConfigValue() { return "--" + name().toLowerCase(Locale.ROOT).replace('_', '-'); //$NON-NLS-1$ } + @Override public boolean matchConfigValue(String in) { if (StringUtils.isEmptyOrNull(in)) return false; @@ -221,6 +223,7 @@ public class MergeCommand extends GitCommand { * * @return the result of the merge */ + @Override @SuppressWarnings("boxing") public MergeResult call() throws GitAPIException, NoHeadException, ConcurrentRefUpdateException, CheckoutConflictException, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java index 6141e0c53..aa8075d16 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java @@ -185,6 +185,7 @@ public class MergeResult { * @since 3.0 **/ MERGED_NOT_COMMITTED { + @Override public String toString() { return "Merged-not-committed"; //$NON-NLS-1$ } @@ -212,6 +213,7 @@ public class MergeResult { * files (i.e. local modifications prevent checkout of files). */ CHECKOUT_CONFLICT { + @Override public String toString() { return "Checkout Conflict"; //$NON-NLS-1$ } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java index 9bc35adc0..49d1a824e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java @@ -197,6 +197,7 @@ public class PullCommand extends TransportCommand { * @throws org.eclipse.jgit.api.errors.TransportException * @throws GitAPIException */ + @Override public PullResult call() throws GitAPIException, WrongRepositoryStateException, InvalidConfigurationException, DetachedHeadException, InvalidRemoteException, CanceledException, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java index be15ab13b..01b57bde8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java @@ -126,6 +126,7 @@ public class PushCommand extends * when an error occurs with the transport * @throws GitAPIException */ + @Override public Iterable call() throws GitAPIException, InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java index d10cc3d71..617c37d61 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java @@ -258,6 +258,7 @@ public class RebaseCommand extends GitCommand { * @throws NoHeadException * @throws RefNotFoundException */ + @Override public RebaseResult call() throws GitAPIException, NoHeadException, RefNotFoundException, WrongRepositoryStateException { newHead = null; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java index 4536af1be..04caa0f15 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java @@ -92,6 +92,7 @@ public class ReflogCommand extends GitCommand> { * @throws GitAPIException * @throws InvalidRefNameException */ + @Override public Collection call() throws GitAPIException, InvalidRefNameException { checkCallable(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RemoveNoteCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RemoveNoteCommand.java index 1c4880c1e..fd8aac75b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RemoveNoteCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RemoveNoteCommand.java @@ -79,6 +79,7 @@ public class RemoveNoteCommand extends GitCommand { super(repo); } + @Override public Note call() throws GitAPIException { checkCallable(); try (RevWalk walk = new RevWalk(repo); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java index 044a48611..ce3a29f36 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java @@ -96,6 +96,7 @@ public class RenameBranchCommand extends GitCommand { * if rename is tried without specifying the old name and HEAD * is detached */ + @Override public Ref call() throws GitAPIException, RefNotFoundException, InvalidRefNameException, RefAlreadyExistsException, DetachedHeadException { checkCallable(); 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 106988d4d..412219cea 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java @@ -141,6 +141,7 @@ public class ResetCommand extends GitCommand { * @return the Ref after reset * @throws GitAPIException */ + @Override public Ref call() throws GitAPIException, CheckoutConflictException { checkCallable(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java index 9d79ed029..20683d5c0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java @@ -120,6 +120,7 @@ public class RevertCommand extends GitCommand { * @throws UnmergedPathsException * @throws NoMessageException */ + @Override public RevCommit call() throws NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, GitAPIException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java index fd2cbe012..069a9cfac 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java @@ -136,6 +136,7 @@ public class RmCommand extends GitCommand { * * @return the DirCache after Rm */ + @Override public DirCache call() throws GitAPIException, NoFilepatternException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ShowNoteCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ShowNoteCommand.java index 168ea51e7..dbff4636e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ShowNoteCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ShowNoteCommand.java @@ -74,6 +74,7 @@ public class ShowNoteCommand extends GitCommand { super(repo); } + @Override public Note call() throws GitAPIException { checkCallable(); NoteMap map = NoteMap.newEmptyMap(); 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 fc8bb874f..10ec2a6a5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java @@ -157,6 +157,7 @@ public class StashApplyCommand extends GitCommand { * @throws NoHeadException * @throws StashApplyFailureException */ + @Override public ObjectId call() throws GitAPIException, WrongRepositoryStateException, NoHeadException, StashApplyFailureException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java index ee9b7fcf7..2cbfead8c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java @@ -236,6 +236,7 @@ public class StashCreateCommand extends GitCommand { * @return stashed commit or null if no changes to stash * @throws GitAPIException */ + @Override public RevCommit call() throws GitAPIException { checkCallable(); @@ -305,6 +306,7 @@ public class StashCreateCommand extends GitCommand { untracked.add(entry); else wtEdits.add(new PathEdit(entry) { + @Override public void apply(DirCacheEntry ent) { ent.copyMetaData(entry); } 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 6e1d0f270..e215bdf7d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java @@ -171,6 +171,7 @@ public class StashDropCommand extends GitCommand { * @return commit id of stash reference or null if no more stashed changes * @throws GitAPIException */ + @Override public ObjectId call() throws GitAPIException { checkCallable(); 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 aedc9a6e1..a2946f9c1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java @@ -76,6 +76,7 @@ public class StashListCommand extends GitCommand> { super(repo); } + @Override public Collection call() throws GitAPIException, InvalidRefNameException { checkCallable(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java index 9752195b9..1d5f54213 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java @@ -134,6 +134,7 @@ public class StatusCommand extends GitCommand { * @return a {@link Status} object telling about each path where working * tree, index or HEAD differ from each other. */ + @Override public Status call() throws GitAPIException, NoWorkTreeException { if (workingTreeIt == null) workingTreeIt = new FileTreeIterator(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 b0f772e0a..0519d454e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java @@ -149,6 +149,7 @@ public class SubmoduleAddCommand extends * @return the newly created {@link Repository} * @throws GitAPIException */ + @Override public Repository call() throws GitAPIException { checkCallable(); if (path == null || path.length() == 0) 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 1dbe3681b..8f91b6792 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java @@ -91,6 +91,7 @@ public class SubmoduleInitCommand extends GitCommand> { return this; } + @Override public Collection call() throws GitAPIException { checkCallable(); 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 a1ea790d0..29d4b7375 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java @@ -91,6 +91,7 @@ public class SubmoduleStatusCommand extends return this; } + @Override public Map call() throws GitAPIException { checkCallable(); 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 088eedc2d..8dc9ff9ab 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java @@ -108,6 +108,7 @@ public class SubmoduleSyncCommand extends GitCommand> { return null; } + @Override public Map call() throws GitAPIException { checkCallable(); 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 342d7f42f..bd2fb8668 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java @@ -137,6 +137,7 @@ public class SubmoduleUpdateCommand extends * @throws WrongRepositoryStateException * @throws GitAPIException */ + @Override public Collection call() throws InvalidConfigurationException, NoHeadException, ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException, diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java index 39dd42cc5..bdbb8620d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java @@ -121,6 +121,7 @@ public class TagCommand extends GitCommand { * when called on a git repo without a HEAD reference * @since 2.0 */ + @Override public Ref call() throws GitAPIException, ConcurrentRefUpdateException, InvalidTagNameException, NoHeadException { checkCallable(); 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 b1cbb914d..324b99eb5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java @@ -55,6 +55,7 @@ import org.eclipse.jgit.util.StringUtils; public class DiffConfig { /** Key for {@link Config#get(SectionParser)}. */ public static final Config.SectionParser KEY = new SectionParser() { + @Override public DiffConfig parse(final Config cfg) { return new DiffConfig(cfg); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java index 2f5c9ea84..80ac1b662 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/HistogramDiff.java @@ -130,6 +130,7 @@ public class HistogramDiff extends LowLevelDiffAlgorithm { maxChainLength = maxLen; } + @Override public void diffNonCommon(EditList edits, HashedSequenceComparator cmp, HashedSequence a, HashedSequence b, Edit region) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java index 9810a6ab2..e1bda116b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java @@ -460,6 +460,7 @@ if (k < beginK || k > endK) } class ForwardEditPaths extends EditPaths { + @Override final int snake(int k, int x) { for (; x < endA && k + x < endB; x++) if (!cmp.equals(a, x, b, k + x)) @@ -467,18 +468,22 @@ if (k < beginK || k > endK) return x; } + @Override final int getLeft(final int x) { return x; } + @Override final int getRight(final int x) { return x + 1; } + @Override final boolean isBetter(final int left, final int right) { return left > right; } + @Override final void adjustMinMaxK(final int k, final int x) { if (x >= endA || k + x >= endB) { if (k > backward.middleK) @@ -488,6 +493,7 @@ if (k < beginK || k > endK) } } + @Override final boolean meets(int d, int k, int x, long snake) { if (k < backward.beginK || k > backward.endK) return false; @@ -502,6 +508,7 @@ if (k < beginK || k > endK) } class BackwardEditPaths extends EditPaths { + @Override final int snake(int k, int x) { for (; x > beginA && k + x > beginB; x--) if (!cmp.equals(a, x - 1, b, k + x - 1)) @@ -509,18 +516,22 @@ if (k < beginK || k > endK) return x; } + @Override final int getLeft(final int x) { return x - 1; } + @Override final int getRight(final int x) { return x; } + @Override final boolean isBetter(final int left, final int right) { return left < right; } + @Override final void adjustMinMaxK(final int k, final int x) { if (x <= beginA || k + x <= beginB) { if (k > forward.middleK) @@ -530,6 +541,7 @@ if (k < beginK || k > endK) } } + @Override final boolean meets(int d, int k, int x, long snake) { if (k < forward.beginK || k > forward.endK) return false; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java index b26e1bc42..5bfee753a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java @@ -107,6 +107,7 @@ public class RawText extends Sequence { } /** @return total number of items in the sequence. */ + @Override public int size() { // The line map is always 2 entries larger than the number of lines in // the file. Index 0 is padded out/unused. The last index is the total diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java index 8865b62c2..0e8399002 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java @@ -70,6 +70,7 @@ public class RenameDetector { private static final int EXACT_RENAME_SCORE = 100; private static final Comparator DIFF_COMPARATOR = new Comparator() { + @Override public int compare(DiffEntry a, DiffEntry b) { int cmp = nameOf(a).compareTo(nameOf(b)); if (cmp == 0) 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 b0cf8be07..17ddd35e6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java @@ -111,6 +111,7 @@ public class DirCache { private static final byte[] NO_CHECKSUM = {}; static final Comparator ENT_CMP = new Comparator() { + @Override public int compare(final DirCacheEntry o1, final DirCacheEntry o2) { final int cr = cmp(o1, o2); if (cr != 0) 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 cfebe2d07..676a6ab9c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java @@ -218,6 +218,7 @@ public class DirCacheBuilder extends BaseDirCacheEditor { return e; } + @Override public void finish() { if (!sorted) resort(); 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 c987c964c..0cc2b7653 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java @@ -74,6 +74,7 @@ import org.eclipse.jgit.util.Paths; */ public class DirCacheEditor extends BaseDirCacheEditor { private static final Comparator EDIT_CMP = new Comparator() { + @Override public int compare(final PathEdit o1, final PathEdit o2) { final byte[] a = o1.path; final byte[] b = o2.path; @@ -123,6 +124,7 @@ public class DirCacheEditor extends BaseDirCacheEditor { return super.commit(); } + @Override public void finish() { if (!edits.isEmpty()) { applyEdits(); @@ -383,6 +385,7 @@ public class DirCacheEditor extends BaseDirCacheEditor { super(ent); } + @Override public void apply(final DirCacheEntry ent) { throw new UnsupportedOperationException(JGitText.get().noApplyInDelete); } @@ -432,6 +435,7 @@ public class DirCacheEditor extends BaseDirCacheEditor { return path; } + @Override public void apply(final DirCacheEntry ent) { throw new UnsupportedOperationException(JGitText.get().noApplyInDelete); } 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 8bcf4bf3e..a06f9d3f4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java @@ -80,6 +80,7 @@ public class DirCacheTree { private static final DirCacheTree[] NO_CHILDREN = {}; private static final Comparator TREE_CMP = new Comparator() { + @Override public int compare(final DirCacheTree o1, final DirCacheTree o2) { final byte[] a = o1.encodedName; final byte[] b = o2.encodedName; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java index 0aa0075ee..10c84c4ec 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java @@ -70,6 +70,7 @@ abstract class AbstractHead implements Head { this.newHeads = newHeads; } + @Override public List getNextHeads(char c) { if (matches(c)) return newHeads; 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 8af52288f..a7bd2eafb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java @@ -159,6 +159,7 @@ final class GroupHead extends AbstractHead { this.end = end; } + @Override public final boolean matches(char c) { return start <= c && c <= end; } @@ -167,6 +168,7 @@ final class GroupHead extends AbstractHead { private static final class DigitPattern implements CharacterPattern { static final GroupHead.DigitPattern INSTANCE = new DigitPattern(); + @Override public final boolean matches(char c) { return Character.isDigit(c); } @@ -175,6 +177,7 @@ final class GroupHead extends AbstractHead { private static final class LetterPattern implements CharacterPattern { static final GroupHead.LetterPattern INSTANCE = new LetterPattern(); + @Override public final boolean matches(char c) { return Character.isLetter(c); } @@ -183,6 +186,7 @@ final class GroupHead extends AbstractHead { private static final class LowerPattern implements CharacterPattern { static final GroupHead.LowerPattern INSTANCE = new LowerPattern(); + @Override public final boolean matches(char c) { return Character.isLowerCase(c); } @@ -191,6 +195,7 @@ final class GroupHead extends AbstractHead { private static final class UpperPattern implements CharacterPattern { static final GroupHead.UpperPattern INSTANCE = new UpperPattern(); + @Override public final boolean matches(char c) { return Character.isUpperCase(c); } @@ -199,6 +204,7 @@ final class GroupHead extends AbstractHead { private static final class WhitespacePattern implements CharacterPattern { static final GroupHead.WhitespacePattern INSTANCE = new WhitespacePattern(); + @Override public final boolean matches(char c) { return Character.isWhitespace(c); } @@ -211,6 +217,7 @@ final class GroupHead extends AbstractHead { this.expectedCharacter = c; } + @Override public final boolean matches(char c) { return this.expectedCharacter == c; } @@ -221,6 +228,7 @@ final class GroupHead extends AbstractHead { private static String punctCharacters = "-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~"; //$NON-NLS-1$ + @Override public boolean matches(char c) { return punctCharacters.indexOf(c) != -1; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java index 78a61b9c5..f9ddd9e65 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java @@ -56,6 +56,7 @@ final class LastHead implements Head { // defined because of javadoc and visibility modifier. } + @Override public List getNextHeads(char c) { return FileNameMatcher.EMPTY_HEAD_LIST; } 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 d18cd9748..c3c7714c1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java @@ -168,6 +168,7 @@ public class RepoCommand extends GitCommand { /** A default implementation of {@link RemoteReader} callback. */ public static class DefaultRemoteReader implements RemoteReader { + @Override public ObjectId sha1(String uri, String ref) throws GitAPIException { Map map = Git .lsRemoteRepository() @@ -177,6 +178,7 @@ public class RepoCommand extends GitCommand { return r != null ? r.getObjectId() : null; } + @Override public byte[] readFile(String uri, String ref, String path) throws GitAPIException, IOException { File dir = FileUtils.createTempDir("jgit_", ".git", null); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java index ad2eeb020..c1aca6a13 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java @@ -95,6 +95,7 @@ abstract class GitHook implements Callable { * If the hook has been run and a returned an exit code * different from zero. */ + @Override public abstract T call() throws IOException, AbortedByHookException; /** diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java index 4c13e2ff6..61f7b8340 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java @@ -51,10 +51,12 @@ public interface IMatcher { * Matcher that does not match any pattern. */ public static final IMatcher NO_MATCH = new IMatcher() { + @Override public boolean matches(String path, boolean assumeDirectory) { return false; } + @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { return false; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java index 3ebc6afb2..cc0fe937b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java @@ -55,6 +55,7 @@ public class LeadingAsteriskMatcher extends NameMatcher { "Pattern must have leading asterisk: " + pattern); //$NON-NLS-1$ } + @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { // faster local access, same as in string.indexOf() diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java index 888b989b6..00651237d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java @@ -70,6 +70,7 @@ public class NameMatcher extends AbstractMatcher { this.subPattern = pattern.substring(1); } + @Override public boolean matches(String path, boolean assumeDirectory) { int end = 0; int firstChar = 0; @@ -86,6 +87,7 @@ public class NameMatcher extends AbstractMatcher { return false; } + @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { // faster local access, same as in string.indexOf() diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java index adf13292b..9bb93cd88 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java @@ -170,6 +170,7 @@ public class PathMatcher extends AbstractMatcher { } } + @Override public boolean matches(String path, boolean assumeDirectory) { if (matchers == null) return simpleMatch(path, assumeDirectory); @@ -209,6 +210,7 @@ public class PathMatcher extends AbstractMatcher { return false; } + @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { throw new UnsupportedOperationException( diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java index c7064ac85..2e148f4a6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java @@ -55,6 +55,7 @@ public class TrailingAsteriskMatcher extends NameMatcher { "Pattern must have trailing asterisk: " + pattern); //$NON-NLS-1$ } + @Override public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { // faster local access, same as in string.indexOf() diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java index 2f24e0241..93ea13c72 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java @@ -61,10 +61,12 @@ public final class WildMatcher extends AbstractMatcher { super(WILDMATCH, false); } + @Override public final boolean matches(String path, boolean assumeDirectory) { return true; } + @Override public final boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { return true; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LagCheck.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LagCheck.java index 35327ea0b..757c19ac9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LagCheck.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LagCheck.java @@ -86,6 +86,7 @@ class LagCheck implements AutoCloseable { rw.setRetainBody(false); } + @Override public void close() { if (rw != null) { rw.close(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/ProposalRound.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/ProposalRound.java index ddd7059fc..1eaa33d2f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/ProposalRound.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/ProposalRound.java @@ -122,6 +122,7 @@ class ProposalRound extends Round { return a == null && b == null; } + @Override void start() throws IOException { for (Proposal p : todo) { p.notifyState(RUNNING); @@ -268,6 +269,7 @@ class ProposalRound extends Round { } } + @Override void success() { for (Proposal p : todo) { p.success(); 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 396fbdd72..a0ac60809 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 @@ -240,6 +240,7 @@ public class RemoteGitReplica extends KetchReplica { ReceiveCommand.abort(tmp); } + @Override protected void blockingFetch(Repository repo, ReplicaFetchRequest req) throws NotSupportedException, TransportException { try (Transport transport = Transport.open(repo, uri)) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java index ba3b39360..cc467853b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java @@ -293,6 +293,7 @@ public class DfsPackCompactor { // older packs, allowing the PackWriter to be handed newer objects // first and older objects last. Collections.sort(srcPacks, new Comparator() { + @Override public int compare(DfsPackFile a, DfsPackFile b) { return a.getPackDescription().compareTo(b.getPackDescription()); } @@ -358,6 +359,7 @@ public class DfsPackCompactor { want.add(new ObjectIdWithOffset(id, ent.getOffset())); } Collections.sort(want, new Comparator() { + @Override public int compare(ObjectIdWithOffset a, ObjectIdWithOffset b) { return Long.signum(a.offset - b.offset); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java index 683094c32..358a92138 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackDescription.java @@ -309,6 +309,7 @@ public class DfsPackDescription implements Comparable { * @param b * the other pack. */ + @Override public int compareTo(DfsPackDescription b) { // Cluster by PackSource, pushing UNREACHABLE_GARBAGE to the end. PackSource as = getPackSource(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java index 3baf118d4..5b5588058 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java @@ -149,6 +149,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { return null; } + @Override public Collection getCachedPacksAndUpdate( BitmapBuilder needBitmap) throws IOException { for (DfsPackFile pack : db.getPacks()) { @@ -274,6 +275,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { } private static final Comparator> FOUND_OBJECT_SORT = new Comparator>() { + @Override public int compare(FoundObject a, FoundObject b) { int cmp = a.packIndex - b.packIndex; if (cmp == 0) @@ -392,6 +394,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { return new AsyncObjectLoaderQueue() { private FoundObject cur; + @Override public boolean next() throws MissingObjectException, IOException { if (idItr.hasNext()) { cur = idItr.next(); @@ -403,14 +406,17 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { } } + @Override public T getCurrent() { return cur.id; } + @Override public ObjectId getObjectId() { return cur.id; } + @Override public ObjectLoader open() throws IOException { if (cur.pack == null) throw new MissingObjectException(cur.id, @@ -418,10 +424,12 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { return cur.pack.load(DfsReader.this, cur.offset); } + @Override public boolean cancel(boolean mayInterruptIfRunning) { return true; } + @Override public void release() { // Nothing to clean up. } @@ -447,6 +455,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { private long sz; + @Override public boolean next() throws MissingObjectException, IOException { if (idItr.hasNext()) { cur = idItr.next(); @@ -462,22 +471,27 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { } } + @Override public T getCurrent() { return cur.id; } + @Override public ObjectId getObjectId() { return cur.id; } + @Override public long getSize() { return sz; } + @Override public boolean cancel(boolean mayInterruptIfRunning) { return true; } + @Override public void release() { // Nothing to clean up. } @@ -529,16 +543,19 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { return -1; } + @Override public DfsObjectToPack newObjectToPack(AnyObjectId objectId, int type) { return new DfsObjectToPack(objectId, type); } private static final Comparator OFFSET_SORT = new Comparator() { + @Override public int compare(DfsObjectToPack a, DfsObjectToPack b) { return Long.signum(a.getOffset() - b.getOffset()); } }; + @Override public void selectObjectRepresentation(PackWriter packer, ProgressMonitor monitor, Iterable objects) throws IOException, MissingObjectException { @@ -564,6 +581,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { } private static final Comparator PACK_SORT_FOR_REUSE = new Comparator() { + @Override public int compare(DfsPackFile af, DfsPackFile bf) { DfsPackDescription ad = af.getPackDescription(); DfsPackDescription bd = bf.getPackDescription(); @@ -606,6 +624,7 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { return tmp; } + @Override public void copyObjectAsIs(PackOutputStream out, ObjectToPack otp, boolean validate) throws IOException, StoredObjectRepresentationNotAvailableException { @@ -613,12 +632,14 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { src.pack.copyAsIs(out, src, validate, this); } + @Override public void writeObjects(PackOutputStream out, List list) throws IOException { for (ObjectToPack otp : list) out.writeObject(otp); } + @Override public void copyPackAsIs(PackOutputStream out, CachedPack pack) throws IOException { ((DfsCachedPack) pack).copyAsIs(out, this); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRepository.java index ef8845084..a5dd51470 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRepository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRepository.java @@ -143,10 +143,12 @@ public abstract class DfsRepository extends Repository { AttributesNodeProvider { private EmptyAttributesNode emptyAttributesNode = new EmptyAttributesNode(); + @Override public AttributesNode getInfoAttributesNode() throws IOException { return emptyAttributesNode; } + @Override public AttributesNode getGlobalAttributesNode() throws IOException { return emptyAttributesNode; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java index bdcf9f9a1..a31a47e11 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java @@ -225,6 +225,7 @@ public class InMemoryRepository extends DfsRepository { data = buf; } + @Override public int read(ByteBuffer dst) { int n = Math.min(dst.remaining(), data.length - position); if (n == 0) @@ -234,30 +235,37 @@ public class InMemoryRepository extends DfsRepository { return n; } + @Override public void close() { open = false; } + @Override public boolean isOpen() { return open; } + @Override public long position() { return position; } + @Override public void position(long newPosition) { position = (int) newPosition; } + @Override public long size() { return data.length; } + @Override public int blockSize() { return 0; } + @Override public void setReadAheadBytes(int b) { // Unnecessary on a byte array. } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java index 30e973ecf..b78ff2abf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java @@ -58,6 +58,7 @@ abstract class BasePackBitmapIndex extends PackBitmapIndex { this.bitmaps = bitmaps; } + @Override public EWAHCompressedBitmap getBitmap(AnyObjectId objectId) { StoredBitmap sb = bitmaps.get(objectId); return sb != null ? sb.getBitmap() : null; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java index b18a06f9c..7855a460c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java @@ -370,6 +370,7 @@ public class BitmapIndexImpl implements BitmapIndex { private int type; private IntIterator cached = dynamic; + @Override public boolean hasNext() { if (!cached.hasNext()) { if (commits.hasNext()) { @@ -391,6 +392,7 @@ public class BitmapIndexImpl implements BitmapIndex { return true; } + @Override public BitmapObject next() { if (!hasNext()) throw new NoSuchElementException(); @@ -408,6 +410,7 @@ public class BitmapIndexImpl implements BitmapIndex { return out; } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CheckoutEntryImpl.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CheckoutEntryImpl.java index e968119ad..4b4337d1e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CheckoutEntryImpl.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CheckoutEntryImpl.java @@ -65,10 +65,12 @@ public class CheckoutEntryImpl implements CheckoutEntry { to = comment.substring(p2 + " to ".length(), p3); //$NON-NLS-1$ } + @Override public String getFromBranch() { return from; } + @Override public String getToBranch() { return to; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java index cf3f4db28..353024c9d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java @@ -967,6 +967,7 @@ public class GC { File tmpPack = null; Map tmpExts = new TreeMap( new Comparator() { + @Override public int compare(PackExt o1, PackExt o2) { // INDEX entries must be returned last, so the pack // scanner does pick up the new pack until all the @@ -1165,6 +1166,7 @@ public class GC { */ public long numberOfBitmaps; + @Override public String toString() { final StringBuilder b = new StringBuilder(); b.append("numberOfPackedObjects=").append(numberOfPackedObjects); //$NON-NLS-1$ @@ -1398,6 +1400,7 @@ public class GC { try (DirectoryStream stream = Files.newDirectoryStream(dir, new DirectoryStream.Filter() { + @Override public boolean accept(Path file) throws IOException { Path fileName = file.getFileName(); return Files.isRegularFile(file) && fileName != null 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 fcc8d7178..d2fcacf3e 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 @@ -110,6 +110,7 @@ public class LockFile { /** Filter to skip over active lock files when listing a directory. */ static final FilenameFilter FILTER = new FilenameFilter() { + @Override public boolean accept(File dir, String name) { return !name.endsWith(SUFFIX); } 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 b73152222..2f4d2d633 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 @@ -188,6 +188,7 @@ public class ObjectDirectory extends FileObjectDatabase { /** * @return the location of the objects directory. */ + @Override public final File getDirectory() { return objects; } @@ -260,6 +261,7 @@ public class ObjectDirectory extends FileObjectDatabase { * index file could not be opened, read, or is not recognized as * a Git pack file index. */ + @Override public PackFile openPack(final File pack) throws IOException { final String p = pack.getName(); @@ -444,6 +446,7 @@ public class ObjectDirectory extends FileObjectDatabase { return null; } + @Override ObjectLoader openLooseObject(WindowCursor curs, AnyObjectId id) throws IOException { File path = fileFor(id); @@ -459,6 +462,7 @@ public class ObjectDirectory extends FileObjectDatabase { } } + @Override long getObjectSize(WindowCursor curs, AnyObjectId id) throws IOException { if (unpackedObjectCache.isUnpacked(id)) { @@ -679,6 +683,7 @@ public class ObjectDirectory extends FileObjectDatabase { && old != scanPacks(old); } + @Override Config getConfig() { return config; } @@ -949,6 +954,7 @@ public class ObjectDirectory extends FileObjectDatabase { * identity of the loose object to map to the directory. * @return location of the object, if it were to exist as a loose object. */ + @Override public File fileFor(AnyObjectId objectId) { String n = objectId.name(); String d = n.substring(0, 2); @@ -989,6 +995,7 @@ public class ObjectDirectory extends FileObjectDatabase { repository = r; } + @Override void close() { repository.close(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java index 956e8de0a..d80abaa9c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java @@ -133,6 +133,7 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex { positionEntries.add(new PositionEntry(entries.get(i), i)); } Collections.sort(entries, new Comparator() { + @Override public int compare(ObjectToPack a, ObjectToPack b) { return Long.signum(a.getOffset() - b.getOffset()); } @@ -274,14 +275,17 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex { // Add order is from oldest to newest. The reverse add order is the // output order. return new Iterable() { + @Override public Iterator iterator() { return new Iterator() { private int index = byAddOrder.size() - 1; + @Override public boolean hasNext() { return index >= 0; } + @Override public StoredEntry next() { if (!hasNext()) throw new NoSuchElementException(); @@ -315,6 +319,7 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex { bestXorOffset, item.getFlags()); } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java index 2c462a78b..6b5b8826e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java @@ -137,6 +137,7 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex return newPackIndex.ofObjectType(bitmap, type); } + @Override public Iterator iterator() { if (oldPackIndex == null) return Collections. emptyList().iterator(); @@ -145,6 +146,7 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex return new Iterator() { private Entry entry; + @Override public boolean hasNext() { while (entry == null && it.hasNext()) { StoredBitmap sb = it.next(); @@ -154,6 +156,7 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex return entry != null; } + @Override public Entry next() { if (!hasNext()) throw new NoSuchElementException(); @@ -163,6 +166,7 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex return res; } + @Override public void remove() { throw new UnsupportedOperationException(); } 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 dc927d8f9..d90e2cf2b 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 @@ -94,6 +94,7 @@ import org.eclipse.jgit.util.RawParseUtils; 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) { return b.packLastModified - a.packLastModified; } @@ -292,6 +293,7 @@ public class PackFile implements Iterable { * * @see PackIndex#iterator() */ + @Override public Iterator iterator() { try { return idx().iterator(); 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 f36bd4d70..ac1b7a367 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 @@ -184,6 +184,7 @@ public abstract class PackIndex * * @return iterator over pack index entries */ + @Override public abstract Iterator iterator(); /** @@ -366,6 +367,7 @@ public abstract class PackIndex protected abstract MutableEntry initEntry(); + @Override public boolean hasNext() { return returnedNumber < getObjectCount(); } @@ -374,8 +376,10 @@ public abstract class PackIndex * Implementation must update {@link #returnedNumber} before returning * element. */ + @Override public abstract MutableEntry next(); + @Override public void remove() { throw new UnsupportedOperationException(); } 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 e5a729dbf..8a0845624 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 @@ -240,6 +240,7 @@ class PackIndexV1 extends PackIndex { @Override protected MutableEntry initEntry() { return new MutableEntry() { + @Override protected void ensureId() { idBuffer.fromRaw(idxdata[levelOne], levelTwo - Constants.OBJECT_ID_LENGTH); @@ -247,6 +248,7 @@ class PackIndexV1 extends PackIndex { }; } + @Override public MutableEntry next() { for (; levelOne < idxdata.length; levelOne++) { if (idxdata[levelOne] == 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 d87336f99..5c2986a04 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 @@ -311,6 +311,7 @@ class PackIndexV2 extends PackIndex { @Override protected MutableEntry initEntry() { return new MutableEntry() { + @Override protected void ensureId() { idBuffer.fromRaw(names[levelOne], levelTwo - Constants.OBJECT_ID_LENGTH / 4); @@ -318,6 +319,7 @@ class PackIndexV2 extends PackIndex { }; } + @Override public MutableEntry next() { for (; levelOne < names.length; levelOne++) { if (levelTwo < names[levelOne].length) { 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 023c08c77..542570a2d 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 @@ -194,6 +194,7 @@ public class RefDirectory extends RefDatabase { return logWriter; } + @Override public void create() throws IOException { FileUtils.mkdir(refsDir); FileUtils.mkdir(new File(refsDir, R_HEADS.substring(R_REFS.length()))); @@ -534,6 +535,7 @@ public class RefDirectory extends RefDatabase { fireRefsChanged(); } + @Override public RefDirectoryUpdate newUpdate(String name, boolean detach) throws IOException { boolean detachingSymbolicRef = false; @@ -1126,10 +1128,12 @@ public class RefDirectory extends RefDatabase { this.snapShot = snapshot; } + @Override public FileSnapshot getSnapShot() { return snapShot; } + @Override public LooseRef peel(ObjectIdRef newLeaf) { return this; } @@ -1145,10 +1149,12 @@ public class RefDirectory extends RefDatabase { this.snapShot = snapshot; } + @Override public FileSnapshot getSnapShot() { return snapShot; } + @Override public LooseRef peel(ObjectIdRef newLeaf) { return this; } @@ -1164,6 +1170,7 @@ public class RefDirectory extends RefDatabase { this.snapShot = snapShot; } + @Override public FileSnapshot getSnapShot() { return snapShot; } @@ -1176,6 +1183,7 @@ public class RefDirectory extends RefDatabase { return id; } + @Override public LooseRef peel(ObjectIdRef newLeaf) { ObjectId peeledObjectId = newLeaf.getPeeledObjectId(); ObjectId objectId = getObjectId(); @@ -1199,10 +1207,12 @@ public class RefDirectory extends RefDatabase { this.snapShot = snapshot; } + @Override public FileSnapshot getSnapShot() { return snapShot; } + @Override public LooseRef peel(ObjectIdRef newLeaf) { // We should never try to peel the symbolic references. throw new UnsupportedOperationException(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogEntryImpl.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogEntryImpl.java index 60f04b8d1..16b2a460e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogEntryImpl.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogEntryImpl.java @@ -93,6 +93,7 @@ public class ReflogEntryImpl implements Serializable, ReflogEntry { /* (non-Javadoc) * @see org.eclipse.jgit.internal.storage.file.ReflogEntry#getOldId() */ + @Override public ObjectId getOldId() { return oldId; } @@ -100,6 +101,7 @@ public class ReflogEntryImpl implements Serializable, ReflogEntry { /* (non-Javadoc) * @see org.eclipse.jgit.internal.storage.file.ReflogEntry#getNewId() */ + @Override public ObjectId getNewId() { return newId; } @@ -107,6 +109,7 @@ public class ReflogEntryImpl implements Serializable, ReflogEntry { /* (non-Javadoc) * @see org.eclipse.jgit.internal.storage.file.ReflogEntry#getWho() */ + @Override public PersonIdent getWho() { return who; } @@ -114,6 +117,7 @@ public class ReflogEntryImpl implements Serializable, ReflogEntry { /* (non-Javadoc) * @see org.eclipse.jgit.internal.storage.file.ReflogEntry#getComment() */ + @Override public String getComment() { return comment; } @@ -128,6 +132,7 @@ public class ReflogEntryImpl implements Serializable, ReflogEntry { /* (non-Javadoc) * @see org.eclipse.jgit.internal.storage.file.ReflogEntry#parseCheckout() */ + @Override public CheckoutEntry parseCheckout() { if (getComment().startsWith(CheckoutEntryImpl.CHECKOUT_MOVING_FROM)) return new CheckoutEntryImpl(this); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java index 2f583b275..490da4695 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java @@ -74,6 +74,7 @@ class ReflogReaderImpl implements ReflogReader { /* (non-Javadoc) * @see org.eclipse.jgit.internal.storage.file.ReflogReaader#getLastEntry() */ + @Override public ReflogEntry getLastEntry() throws IOException { return getReverseEntry(0); } @@ -81,6 +82,7 @@ class ReflogReaderImpl implements ReflogReader { /* (non-Javadoc) * @see org.eclipse.jgit.internal.storage.file.ReflogReaader#getReverseEntries() */ + @Override public List getReverseEntries() throws IOException { return getReverseEntries(Integer.MAX_VALUE); } @@ -88,6 +90,7 @@ class ReflogReaderImpl implements ReflogReader { /* (non-Javadoc) * @see org.eclipse.jgit.internal.storage.file.ReflogReaader#getReverseEntry(int) */ + @Override public ReflogEntry getReverseEntry(int number) throws IOException { if (number < 0) throw new IllegalArgumentException(); @@ -116,6 +119,7 @@ class ReflogReaderImpl implements ReflogReader { /* (non-Javadoc) * @see org.eclipse.jgit.internal.storage.file.ReflogReaader#getReverseEntries(int) */ + @Override public List getReverseEntries(int max) throws IOException { final byte[] log; try { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataInput.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataInput.java index a7330681f..452636dca 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataInput.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataInput.java @@ -64,11 +64,13 @@ class SimpleDataInput implements DataInput { this.fd = fd; } + @Override public int readInt() throws IOException { readFully(buf, 0, 4); return NB.decodeInt32(buf, 0); } + @Override public long readLong() throws IOException { readFully(buf, 0, 8); return NB.decodeInt64(buf, 0); @@ -79,54 +81,67 @@ class SimpleDataInput implements DataInput { return NB.decodeUInt32(buf, 0); } + @Override public void readFully(byte[] b) throws IOException { readFully(b, 0, b.length); } + @Override public void readFully(byte[] b, int off, int len) throws IOException { IO.readFully(fd, b, off, len); } + @Override public int skipBytes(int n) throws IOException { throw new UnsupportedOperationException(); } + @Override public boolean readBoolean() throws IOException { throw new UnsupportedOperationException(); } + @Override public byte readByte() throws IOException { throw new UnsupportedOperationException(); } + @Override public int readUnsignedByte() throws IOException { throw new UnsupportedOperationException(); } + @Override public short readShort() throws IOException { throw new UnsupportedOperationException(); } + @Override public int readUnsignedShort() throws IOException { throw new UnsupportedOperationException(); } + @Override public char readChar() throws IOException { throw new UnsupportedOperationException(); } + @Override public float readFloat() throws IOException { throw new UnsupportedOperationException(); } + @Override public double readDouble() throws IOException { throw new UnsupportedOperationException(); } + @Override public String readLine() throws IOException { throw new UnsupportedOperationException(); } + @Override public String readUTF() throws IOException { throw new UnsupportedOperationException(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataOutput.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataOutput.java index d9c899ae5..373a49465 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataOutput.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/SimpleDataOutput.java @@ -64,61 +64,75 @@ class SimpleDataOutput implements DataOutput { this.fd = fd; } + @Override public void writeShort(int v) throws IOException { NB.encodeInt16(buf, 0, v); fd.write(buf, 0, 2); } + @Override public void writeInt(int v) throws IOException { NB.encodeInt32(buf, 0, v); fd.write(buf, 0, 4); } + @Override public void writeLong(long v) throws IOException { NB.encodeInt64(buf, 0, v); fd.write(buf, 0, 8); } + @Override public void write(int b) throws IOException { throw new UnsupportedOperationException(); } + @Override public void write(byte[] b) throws IOException { throw new UnsupportedOperationException(); } + @Override public void write(byte[] b, int off, int len) throws IOException { throw new UnsupportedOperationException(); } + @Override public void writeBoolean(boolean v) throws IOException { throw new UnsupportedOperationException(); } + @Override public void writeByte(int v) throws IOException { throw new UnsupportedOperationException(); } + @Override public void writeChar(int v) throws IOException { throw new UnsupportedOperationException(); } + @Override public void writeFloat(float v) throws IOException { throw new UnsupportedOperationException(); } + @Override public void writeDouble(double v) throws IOException { throw new UnsupportedOperationException(); } + @Override public void writeBytes(String s) throws IOException { throw new UnsupportedOperationException(); } + @Override public void writeChars(String s) throws IOException { throw new UnsupportedOperationException(); } + @Override public void writeUTF(String s) throws IOException { throw new UnsupportedOperationException(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java index a742d1747..27215502b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java @@ -125,6 +125,7 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { return null; } + @Override public Collection getCachedPacksAndUpdate( BitmapBuilder needBitmap) throws IOException { for (PackFile pack : db.getPacks()) { @@ -146,10 +147,12 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { return matches; } + @Override public boolean has(AnyObjectId objectId) throws IOException { return db.has(objectId); } + @Override public ObjectLoader open(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException { @@ -170,6 +173,7 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { return db.getShallowCommits(); } + @Override public long getObjectSize(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException { @@ -183,10 +187,12 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { return sz; } + @Override public LocalObjectToPack newObjectToPack(AnyObjectId objectId, int type) { return new LocalObjectToPack(objectId, type); } + @Override public void selectObjectRepresentation(PackWriter packer, ProgressMonitor monitor, Iterable objects) throws IOException, MissingObjectException { @@ -196,6 +202,7 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { } } + @Override public void copyObjectAsIs(PackOutputStream out, ObjectToPack otp, boolean validate) throws IOException, StoredObjectRepresentationNotAvailableException { @@ -203,6 +210,7 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { src.pack.copyAsIs(out, src, validate, this); } + @Override public void writeObjects(PackOutputStream out, List list) throws IOException { for (ObjectToPack otp : list) @@ -245,6 +253,7 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { return cnt - need; } + @Override public void copyPackAsIs(PackOutputStream out, CachedPack pack) throws IOException { ((LocalCachedPack) pack).copyAsIs(out, this); 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 4f79ea972..1e2b23932 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 @@ -50,6 +50,7 @@ import org.eclipse.jgit.lib.CoreConfig; class WriteConfig { /** Key for {@link Config#get(SectionParser)}. */ static final Config.SectionParser KEY = new SectionParser() { + @Override public WriteConfig parse(final Config cfg) { return new WriteConfig(cfg); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndex.java index 2a2a463b8..0f22de08e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndex.java @@ -421,6 +421,7 @@ public class DeltaIndex { return start - resPtr; } + @Override @SuppressWarnings("nls") public String toString() { String[] units = { "bytes", "KiB", "MiB", "GiB" }; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java index 42927426b..635cb8d8d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java @@ -213,6 +213,7 @@ final class DeltaTask implements Callable { // Sort by starting index to identify gaps later. Collections.sort(topPaths, new Comparator() { + @Override public int compare(WeightedPath a, WeightedPath b) { return a.slice.beginIndex - b.slice.beginIndex; } @@ -244,6 +245,7 @@ final class DeltaTask implements Callable { this.slice = s; } + @Override public int compareTo(WeightedPath o) { int cmp = Long.signum(weight - o.weight); if (cmp != 0) { @@ -290,6 +292,7 @@ final class DeltaTask implements Callable { slices.add(s); } + @Override public Object call() throws Exception { or = block.templateReader.newReader(); try { 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 14e4fa6fd..37354d3e6 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 @@ -170,12 +170,14 @@ public class PackWriter implements AutoCloseable { new ConcurrentHashMap, Boolean>(); private static final Iterable instancesIterable = new Iterable() { + @Override public Iterator iterator() { return new Iterator() { private final Iterator> it = instances.keySet().iterator(); private PackWriter next; + @Override public boolean hasNext() { if (next != null) return true; @@ -189,6 +191,7 @@ public class PackWriter implements AutoCloseable { return false; } + @Override public PackWriter next() { if (hasNext()) { PackWriter result = next; @@ -198,6 +201,7 @@ public class PackWriter implements AutoCloseable { throw new NoSuchElementException(); } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -1254,6 +1258,7 @@ public class PackWriter implements AutoCloseable { // bigger ones, because source files grow and hardly ever shrink. // Arrays.sort(list, 0, cnt, new Comparator() { + @Override public int compare(ObjectToPack a, ObjectToPack b) { int cmp = (a.isDoNotDelta() ? 1 : 0) - (b.isDoNotDelta() ? 1 : 0); @@ -1399,6 +1404,7 @@ public class PackWriter implements AutoCloseable { // can schedule these for us. for (final DeltaTask task : taskBlock.tasks) { executor.execute(new Runnable() { + @Override public void run() { try { task.call(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java index 77311abaa..2c2c80eb8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java @@ -91,6 +91,7 @@ class PackWriterBitmapPreparer { private static final int DAY_IN_SECONDS = 24 * 60 * 60; private static final Comparator ORDER_BY_CARDINALITY = new Comparator() { + @Override public int compare(BitmapBuilderEntry a, BitmapBuilderEntry b) { return Integer.signum(a.getBuilder().cardinality() - b.getBuilder().cardinality()); @@ -579,20 +580,24 @@ class PackWriterBitmapPreparer { this.reusedCommits = reuse; } + @Override public Iterator iterator() { // Member variables referenced by this iterator will have synthetic // accessors generated for them if they are made private. return new Iterator() { int pos = commitStartPos; + @Override public boolean hasNext() { return pos < commitsByOldest.length; } + @Override public RevCommit next() { return commitsByOldest[pos++]; } + @Override public void remove() { throw new UnsupportedOperationException(); } 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 11081d59e..f964bf2b4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java @@ -159,6 +159,7 @@ public abstract class AnyObjectId implements Comparable { * @return < 0 if this id comes before other; 0 if this id is equal to * other; > 0 if this id comes after other. */ + @Override public final int compareTo(final AnyObjectId other) { if (this == other) return 0; @@ -261,6 +262,7 @@ public abstract class AnyObjectId implements Comparable { return abbr.prefixCompare(this) == 0; } + @Override public final int hashCode() { return w2; } @@ -276,6 +278,7 @@ public abstract class AnyObjectId implements Comparable { return other != null ? equals(this, other) : false; } + @Override public final boolean equals(final Object o) { if (o instanceof AnyObjectId) return equals((AnyObjectId) o); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java index a3859abb2..54c80522b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java @@ -68,10 +68,12 @@ public abstract class BatchingProgressMonitor implements ProgressMonitor { delayStartUnit = unit; } + @Override public void start(int totalTasks) { // Ignore the number of tasks. } + @Override public void beginTask(String title, int work) { endTask(); task = new Task(title, work); @@ -79,11 +81,13 @@ public abstract class BatchingProgressMonitor implements ProgressMonitor { task.delay(delayStartTime, delayStartUnit); } + @Override public void update(int completed) { if (task != null) task.update(this, completed); } + @Override public void endTask() { if (task != null) { task.end(this); @@ -91,6 +95,7 @@ public abstract class BatchingProgressMonitor implements ProgressMonitor { } } + @Override public boolean isCancelled() { return false; } @@ -178,6 +183,7 @@ public abstract class BatchingProgressMonitor implements ProgressMonitor { timerFuture = WorkQueue.getExecutor().schedule(this, time, unit); } + @Override public void run() { display = true; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BitmapIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BitmapIndex.java index 9ddff2548..00f42a49a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BitmapIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BitmapIndex.java @@ -108,6 +108,7 @@ public interface BitmapIndex { * * @return an Iterator. */ + @Override Iterator iterator(); } @@ -166,6 +167,7 @@ public interface BitmapIndex { * the other bitmap * @return the current builder. */ + @Override BitmapBuilder or(Bitmap other); /** @@ -176,6 +178,7 @@ public interface BitmapIndex { * the other bitmap * @return the current builder. */ + @Override BitmapBuilder andNot(Bitmap other); /** @@ -185,6 +188,7 @@ public interface BitmapIndex { * the other bitmap * @return the current builder. */ + @Override BitmapBuilder xor(Bitmap other); /** @return the fully built immutable bitmap */ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java index 5ed129ed0..90c42ea16 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java @@ -217,6 +217,7 @@ class ConfigSnapshot { } private static class LineComparator implements Comparator { + @Override public int compare(ConfigLine a, ConfigLine b) { return compare2( a.section, a.subsection, a.name, @@ -286,14 +287,17 @@ class ConfigSnapshot { public Iterator iterator() { final Iterator i = names.values().iterator(); return new Iterator() { + @Override public boolean hasNext() { return i.hasNext(); } + @Override public String next() { return i.next(); } + @Override public void remove() { throw new UnsupportedOperationException(); } 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 83efd43aa..40aba636d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CoreConfig.java @@ -58,6 +58,7 @@ import org.eclipse.jgit.lib.Config.SectionParser; public class CoreConfig { /** Key for {@link Config#get(SectionParser)}. */ public static final Config.SectionParser KEY = new SectionParser() { + @Override public CoreConfig parse(final Config cfg) { return new CoreConfig(cfg); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/EmptyProgressMonitor.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/EmptyProgressMonitor.java index eabcbbf63..c236c35f3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/EmptyProgressMonitor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/EmptyProgressMonitor.java @@ -51,22 +51,27 @@ package org.eclipse.jgit.lib; */ public abstract class EmptyProgressMonitor implements ProgressMonitor { + @Override public void start(int totalTasks) { // empty } + @Override public void beginTask(String title, int totalWork) { // empty } + @Override public void update(int completed) { // empty } + @Override public void endTask() { // empty } + @Override public boolean isCancelled() { return false; } 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 f295f5b72..a489461f8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/FileMode.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/FileMode.java @@ -86,6 +86,7 @@ public abstract class FileMode { @SuppressWarnings("synthetic-access") public static final FileMode TREE = new FileMode(TYPE_TREE, Constants.OBJ_TREE) { + @Override public boolean equals(final int modeBits) { return (modeBits & TYPE_MASK) == TYPE_TREE; } @@ -95,6 +96,7 @@ public abstract class FileMode { @SuppressWarnings("synthetic-access") public static final FileMode SYMLINK = new FileMode(TYPE_SYMLINK, Constants.OBJ_BLOB) { + @Override public boolean equals(final int modeBits) { return (modeBits & TYPE_MASK) == TYPE_SYMLINK; } @@ -104,6 +106,7 @@ public abstract class FileMode { @SuppressWarnings("synthetic-access") public static final FileMode REGULAR_FILE = new FileMode(0100644, Constants.OBJ_BLOB) { + @Override public boolean equals(final int modeBits) { return (modeBits & TYPE_MASK) == TYPE_FILE && (modeBits & 0111) == 0; } @@ -113,6 +116,7 @@ public abstract class FileMode { @SuppressWarnings("synthetic-access") public static final FileMode EXECUTABLE_FILE = new FileMode(0100755, Constants.OBJ_BLOB) { + @Override public boolean equals(final int modeBits) { return (modeBits & TYPE_MASK) == TYPE_FILE && (modeBits & 0111) != 0; } @@ -122,6 +126,7 @@ public abstract class FileMode { @SuppressWarnings("synthetic-access") public static final FileMode GITLINK = new FileMode(TYPE_GITLINK, Constants.OBJ_COMMIT) { + @Override public boolean equals(final int modeBits) { return (modeBits & TYPE_MASK) == TYPE_GITLINK; } @@ -131,6 +136,7 @@ public abstract class FileMode { @SuppressWarnings("synthetic-access") public static final FileMode MISSING = new FileMode(TYPE_MISSING, Constants.OBJ_BAD) { + @Override public boolean equals(final int modeBits) { return modeBits == 0; } @@ -258,6 +264,7 @@ public abstract class FileMode { } /** Format this mode as an octal string (for debugging only). */ + @Override public String toString() { return Integer.toOctalString(modeBits); } 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 af6a4fb91..b845fad03 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java @@ -342,6 +342,7 @@ public class IndexDiff { } private WorkingTreeIteratorFactory wTreeIt = new WorkingTreeIteratorFactory() { + @Override public WorkingTreeIterator getWorkingTreeIterator(Repository repo) { return new FileTreeIterator(repo); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/NullProgressMonitor.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/NullProgressMonitor.java index d05c8c6b0..497beb033 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/NullProgressMonitor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/NullProgressMonitor.java @@ -56,22 +56,27 @@ public class NullProgressMonitor implements ProgressMonitor { // Do not let others instantiate } + @Override public void start(int totalTasks) { // Do not report. } + @Override public void beginTask(String title, int totalWork) { // Do not report. } + @Override public void update(int completed) { // Do not report. } + @Override public boolean isCancelled() { return false; } + @Override public void endTask() { // Do not report. } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdRef.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdRef.java index c286f5e46..636716bcb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdRef.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdRef.java @@ -67,11 +67,13 @@ public abstract class ObjectIdRef implements Ref { super(st, name, id); } + @Override @Nullable public ObjectId getPeeledObjectId() { return null; } + @Override public boolean isPeeled() { return false; } @@ -99,11 +101,13 @@ public abstract class ObjectIdRef implements Ref { peeledObjectId = p; } + @Override @NonNull public ObjectId getPeeledObjectId() { return peeledObjectId; } + @Override public boolean isPeeled() { return true; } @@ -127,11 +131,13 @@ public abstract class ObjectIdRef implements Ref { super(st, name, id); } + @Override @Nullable public ObjectId getPeeledObjectId() { return null; } + @Override public boolean isPeeled() { return true; } @@ -161,30 +167,36 @@ public abstract class ObjectIdRef implements Ref { this.objectId = id; } + @Override @NonNull public String getName() { return name; } + @Override public boolean isSymbolic() { return false; } + @Override @NonNull public Ref getLeaf() { return this; } + @Override @NonNull public Ref getTarget() { return this; } + @Override @Nullable public ObjectId getObjectId() { return objectId; } + @Override @NonNull public Storage getStorage() { return storage; 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 faed64bfe..43fc7bfb9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java @@ -111,6 +111,7 @@ public class ObjectIdSubclassMap * object to find. * @return true if the mapping exists for this object; false otherwise. */ + @Override public boolean contains(final AnyObjectId toFind) { return get(toFind) != null; } @@ -187,16 +188,19 @@ public class ObjectIdSubclassMap return size == 0; } + @Override public Iterator iterator() { return new Iterator() { private int found; private int i; + @Override public boolean hasNext() { return found < size; } + @Override public V next() { while (i < table.length) { final V v = table[i++]; @@ -208,6 +212,7 @@ public class ObjectIdSubclassMap throw new NoSuchElementException(); } + @Override public void remove() { throw new UnsupportedOperationException(); } 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 4c51279d0..9cd2d1d29 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java @@ -107,41 +107,50 @@ public abstract class ObjectInserter implements AutoCloseable { return delegate().buffer(); } + @Override public ObjectId idFor(int type, byte[] data) { return delegate().idFor(type, data); } + @Override public ObjectId idFor(int type, byte[] data, int off, int len) { return delegate().idFor(type, data, off, len); } + @Override public ObjectId idFor(int objectType, long length, InputStream in) throws IOException { return delegate().idFor(objectType, length, in); } + @Override public ObjectId idFor(TreeFormatter formatter) { return delegate().idFor(formatter); } + @Override public ObjectId insert(int type, byte[] data) throws IOException { return delegate().insert(type, data); } + @Override public ObjectId insert(int type, byte[] data, int off, int len) throws IOException { return delegate().insert(type, data, off, len); } + @Override public ObjectId insert(int objectType, long length, InputStream in) throws IOException { return delegate().insert(objectType, length, in); } + @Override public PackParser newPackParser(InputStream in) throws IOException { return delegate().newPackParser(in); } + @Override public ObjectReader newReader() { final ObjectReader dr = delegate().newReader(); return new ObjectReader.Filter() { @@ -157,10 +166,12 @@ public abstract class ObjectInserter implements AutoCloseable { }; } + @Override public void flush() throws IOException { delegate().flush(); } + @Override public void close() { delegate().close(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java index 372da9893..b79a02c64 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java @@ -286,6 +286,7 @@ public abstract class ObjectReader implements AutoCloseable { return new AsyncObjectLoaderQueue() { private T cur; + @Override public boolean next() throws MissingObjectException, IOException { if (idItr.hasNext()) { cur = idItr.next(); @@ -295,22 +296,27 @@ public abstract class ObjectReader implements AutoCloseable { } } + @Override public T getCurrent() { return cur; } + @Override public ObjectId getObjectId() { return cur; } + @Override public ObjectLoader open() throws IOException { return ObjectReader.this.open(cur, OBJ_ANY); } + @Override public boolean cancel(boolean mayInterruptIfRunning) { return true; } + @Override public void release() { // Since we are sequential by default, we don't // have any state to clean up if we terminate early. @@ -370,6 +376,7 @@ public abstract class ObjectReader implements AutoCloseable { private long sz; + @Override public boolean next() throws MissingObjectException, IOException { if (idItr.hasNext()) { cur = idItr.next(); @@ -380,22 +387,27 @@ public abstract class ObjectReader implements AutoCloseable { } } + @Override public T getCurrent() { return cur; } + @Override public ObjectId getObjectId() { return cur; } + @Override public long getSize() { return sz; } + @Override public boolean cancel(boolean mayInterruptIfRunning) { return true; } + @Override public void release() { // Since we are sequential by default, we don't // have any state to clean up if we terminate early. 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 627ccaa20..45757e42f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java @@ -336,6 +336,7 @@ public class PersonIdent implements Serializable { /** * Hashcode is based only on the email address and timestamp. */ + @Override public int hashCode() { int hc = getEmailAddress().hashCode(); hc *= 31; @@ -343,6 +344,7 @@ public class PersonIdent implements Serializable { return hc; } + @Override public boolean equals(final Object o) { if (o instanceof PersonIdent) { final PersonIdent p = (PersonIdent) o; @@ -370,6 +372,7 @@ public class PersonIdent implements Serializable { return r.toString(); } + @Override @SuppressWarnings("nls") public String toString() { final StringBuilder r = new StringBuilder(); 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 c6e10299e..91b0319f4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefComparator.java @@ -60,6 +60,7 @@ public class RefComparator implements Comparator { /** Singleton instance of RefComparator */ public static final RefComparator INSTANCE = new RefComparator(); + @Override public int compare(final Ref o1, final Ref o2) { return compareTo(o1, o2); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/SymbolicRef.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/SymbolicRef.java index eeab921a7..71d5cd7ac 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/SymbolicRef.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/SymbolicRef.java @@ -70,15 +70,18 @@ public class SymbolicRef implements Ref { this.target = target; } + @Override @NonNull public String getName() { return name; } + @Override public boolean isSymbolic() { return true; } + @Override @NonNull public Ref getLeaf() { Ref dst = getTarget(); @@ -87,26 +90,31 @@ public class SymbolicRef implements Ref { return dst; } + @Override @NonNull public Ref getTarget() { return target; } + @Override @Nullable public ObjectId getObjectId() { return getLeaf().getObjectId(); } + @Override @NonNull public Storage getStorage() { return Storage.LOOSE; } + @Override @Nullable public ObjectId getPeeledObjectId() { return getLeaf().getPeeledObjectId(); } + @Override public boolean isPeeled() { return getLeaf().isPeeled(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ThreadSafeProgressMonitor.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ThreadSafeProgressMonitor.java index ff85f9b8f..5824a55ff 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ThreadSafeProgressMonitor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ThreadSafeProgressMonitor.java @@ -87,12 +87,14 @@ public class ThreadSafeProgressMonitor implements ProgressMonitor { this.process = new Semaphore(0); } + @Override public void start(int totalTasks) { if (!isMainThread()) throw new IllegalStateException(); pm.start(totalTasks); } + @Override public void beginTask(String title, int totalWork) { if (!isMainThread()) throw new IllegalStateException(); @@ -156,11 +158,13 @@ public class ThreadSafeProgressMonitor implements ProgressMonitor { pm.update(cnt); } + @Override public void update(int completed) { if (0 == pendingUpdates.getAndAdd(completed)) process.release(); } + @Override public boolean isCancelled() { lock.lock(); try { @@ -170,6 +174,7 @@ public class ThreadSafeProgressMonitor implements ProgressMonitor { } } + @Override public void endTask() { if (!isMainThread()) throw new IllegalStateException(); 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 b8d236c1d..bd393dd2f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java @@ -52,6 +52,7 @@ import org.eclipse.jgit.util.SystemReader; public class UserConfig { /** Key for {@link Config#get(SectionParser)}. */ public static final Config.SectionParser KEY = new SectionParser() { + @Override public UserConfig parse(final Config cfg) { return new UserConfig(cfg); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/WorkQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/WorkQueue.java index 9735d19e5..07b87f58d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/WorkQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/WorkQueue.java @@ -67,6 +67,7 @@ class WorkQueue { private final ThreadFactory baseFactory = Executors .defaultThreadFactory(); + @Override public Thread newThread(Runnable taskBody) { Thread thr = baseFactory.newThread(taskBody); thr.setName("JGit-WorkQueue"); //$NON-NLS-1$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeConfig.java index 83b143b90..d05939182 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeConfig.java @@ -167,6 +167,7 @@ public class MergeConfig { this.branch = branch; } + @Override public MergeConfig parse(Config cfg) { return new MergeConfig(branch, cfg); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeResult.java index 106f9c779..ff3c8ab17 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeResult.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeResult.java @@ -133,14 +133,17 @@ public class MergeResult implements Iterable { * @return an iterator over the MergeChunks. The iterator does not support * the remove operation */ + @Override public Iterator iterator() { return new Iterator() { int idx; + @Override public boolean hasNext() { return (idx < chunks.size()); } + @Override public MergeChunk next() { ConflictState state = states[chunks.get(idx++)]; int srcIdx = chunks.get(idx++); @@ -149,6 +152,7 @@ public class MergeResult implements Iterable { return new MergeChunk(srcIdx, begin, end, state); } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java b/org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java index a768c25a2..396ad7884 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java @@ -72,6 +72,7 @@ public class NLS { public static final Locale ROOT_LOCALE = new Locale("", "", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ private static final InheritableThreadLocal local = new InheritableThreadLocal() { + @Override protected NLS initialValue() { return new NLS(Locale.getDefault()); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java index db4944851..2e7327ca3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java @@ -67,6 +67,7 @@ import org.eclipse.jgit.util.io.UnionInputStream; */ public class DefaultNoteMerger implements NoteMerger { + @Override public Note merge(Note base, Note ours, Note theirs, ObjectReader reader, ObjectInserter inserter) throws IOException { if (ours == null) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java b/org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java index 79fbb09ec..7827a9aa0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java @@ -140,6 +140,7 @@ class FanoutBucket extends InMemoryNoteBucket { private Iterator itr; + @Override public boolean hasNext() { if (itr != null && itr.hasNext()) return true; @@ -164,6 +165,7 @@ class FanoutBucket extends InMemoryNoteBucket { return false; } + @Override public Note next() { if (hasNext()) return itr.next(); @@ -171,6 +173,7 @@ class FanoutBucket extends InMemoryNoteBucket { throw new NoSuchElementException(); } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -259,6 +262,7 @@ class FanoutBucket extends InMemoryNoteBucket { return inserter.insert(build(true, inserter)); } + @Override ObjectId getTreeId() { try (ObjectInserter.Formatter f = new ObjectInserter.Formatter()) { return f.idFor(build(false, null)); 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 41f7501e5..1be525162 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java @@ -122,10 +122,12 @@ class LeafBucket extends InMemoryNoteBucket { return new Iterator() { private int idx; + @Override public boolean hasNext() { return idx < cnt; } + @Override public Note next() { if (hasNext()) return notes[idx++]; @@ -133,6 +135,7 @@ class LeafBucket extends InMemoryNoteBucket { throw new NoSuchElementException(); } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -144,6 +147,7 @@ class LeafBucket extends InMemoryNoteBucket { return cnt; } + @Override InMemoryNoteBucket set(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or) throws IOException { int p = search(noteOn); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java index 25b2ae89e..44c59260e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java @@ -201,6 +201,7 @@ public class NoteMap implements Iterable { * @return an iterator that iterates over notes of this NoteMap. Non note * entries are ignored by this iterator. */ + @Override public Iterator iterator() { try { return root.iterator(new MutableObjectId(), reader); 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 eb2bfac1b..ed7978729 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java @@ -266,6 +266,7 @@ public class CombinedHunkHeader extends HunkHeader { } } + @Override void extractFileLines(final StringBuilder sb, final String[] text, final int[] offsets) { final byte[] buf = file.buf; 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 55cf235cf..bdeb01c3a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java @@ -147,6 +147,7 @@ public class PlotWalk extends RevWalk { } class PlotRefComparator implements Comparator { + @Override public int compare(Ref o1, Ref o2) { try { RevObject obj1 = parseAny(o1.getObjectId()); 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 843c2afa2..4923d0f74 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AbstractRevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AbstractRevQueue.java @@ -107,6 +107,7 @@ abstract class AbstractRevQueue extends Generator { * * @return the first commit of this queue. */ + @Override public abstract RevCommit next(); /** Remove all entries from this queue. */ 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 30d140a74..db5379e50 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java @@ -83,6 +83,7 @@ abstract class BlockRevQueue extends AbstractRevQueue { * @param q * the other queue we will steal entries from. */ + @Override public void shareFreeList(final 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 0802bfafd..cd7c074cc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java @@ -82,6 +82,7 @@ public class DateRevQueue extends AbstractRevQueue { } } + @Override public void add(final RevCommit c) { sinceLastIndex++; if (++inQueue > REBUILD_INDEX_COUNT @@ -126,6 +127,7 @@ public class DateRevQueue extends AbstractRevQueue { } } + @Override public RevCommit next() { final Entry q = head; if (q == null) @@ -161,6 +163,7 @@ public class DateRevQueue extends AbstractRevQueue { return head != null ? head.commit : null; } + @Override public void clear() { head = null; free = null; @@ -170,6 +173,7 @@ public class DateRevQueue extends AbstractRevQueue { last = -1; } + @Override boolean everbodyHasFlag(final int f) { for (Entry q = head; q != null; q = q.next) { if ((q.commit.flags & f) == 0) @@ -178,6 +182,7 @@ public class DateRevQueue extends AbstractRevQueue { return true; } + @Override boolean anybodyHasFlag(final int f) { for (Entry q = head; q != null; q = q.next) { if ((q.commit.flags & f) != 0) @@ -191,6 +196,7 @@ public class DateRevQueue extends AbstractRevQueue { return outputType | SORT_COMMIT_TIME_DESC; } + @Override public String toString() { final StringBuilder s = new StringBuilder(); for (Entry q = head; q != null; q = q.next) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java index 59a360f86..f932593e8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java @@ -138,14 +138,17 @@ public interface DepthWalk { return new Commit(id); } + @Override public int getDepth() { return depth; } + @Override public RevFlag getUnshallowFlag() { return UNSHALLOW; } + @Override public RevFlag getReinterestingFlag() { return REINTERESTING; } @@ -239,14 +242,17 @@ public interface DepthWalk { return new Commit(id); } + @Override public int getDepth() { return depth; } + @Override public RevFlag getUnshallowFlag() { return UNSHALLOW; } + @Override public RevFlag getReinterestingFlag() { return REINTERESTING; } 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 b8f63aaa5..14156042c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java @@ -64,6 +64,7 @@ public class FIFORevQueue extends BlockRevQueue { super(s); } + @Override public void add(final RevCommit c) { Block b = tail; if (b == null) { @@ -107,6 +108,7 @@ public class FIFORevQueue extends BlockRevQueue { head = b; } + @Override public RevCommit next() { final Block b = head; if (b == null) @@ -122,12 +124,14 @@ public class FIFORevQueue extends BlockRevQueue { return c; } + @Override public void clear() { head = null; tail = null; free.clear(); } + @Override boolean everbodyHasFlag(final int f) { for (Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) @@ -137,6 +141,7 @@ public class FIFORevQueue extends BlockRevQueue { return true; } + @Override boolean anybodyHasFlag(final int f) { for (Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) @@ -154,6 +159,7 @@ public class FIFORevQueue extends BlockRevQueue { } } + @Override public String toString() { final StringBuilder s = new StringBuilder(); for (Block q = head; q != null; q = q.next) { 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 9abaf8dcc..f9da5b17b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java @@ -63,6 +63,7 @@ public class LIFORevQueue extends BlockRevQueue { super(s); } + @Override public void add(final RevCommit c) { Block b = head; if (b == null || !b.canUnpop()) { @@ -74,6 +75,7 @@ public class LIFORevQueue extends BlockRevQueue { b.unpop(c); } + @Override public RevCommit next() { final Block b = head; if (b == null) @@ -87,11 +89,13 @@ public class LIFORevQueue extends BlockRevQueue { return c; } + @Override public void clear() { head = null; free.clear(); } + @Override boolean everbodyHasFlag(final int f) { for (Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) @@ -101,6 +105,7 @@ public class LIFORevQueue extends BlockRevQueue { return true; } + @Override boolean anybodyHasFlag(final int f) { for (Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) @@ -110,6 +115,7 @@ public class LIFORevQueue extends BlockRevQueue { return false; } + @Override public String toString() { final StringBuilder s = new StringBuilder(); for (Block q = head; q != null; q = q.next) { 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 9c3af5a5d..f98a7d637 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java @@ -243,6 +243,7 @@ public class ObjectWalk extends RevWalk { addObject(o); } + @Override public void sort(RevSort s) { super.sort(s); boundary = hasRevSort(RevSort.BOUNDARY); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java index 0998a3a22..dae52f85d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java @@ -99,6 +99,7 @@ public class RevFlag { return walker; } + @Override public String toString() { return name; } 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 ca30fd98d..1afdeb610 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlagSet.java @@ -132,14 +132,17 @@ public class RevFlagSet extends AbstractSet { return new Iterator() { private RevFlag current; + @Override public boolean hasNext() { return i.hasNext(); } + @Override public RevFlag next() { return current = i.next(); } + @Override public void remove() { mask &= ~current.mask; i.remove(); 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 5052a4dea..95986782c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java @@ -78,6 +78,7 @@ public class RevObjectList extends AbstractList { // Initialized above. } + @Override public void add(final int index, final E element) { if (index != size) throw new UnsupportedOperationException(MessageFormat.format( @@ -87,6 +88,7 @@ public class RevObjectList extends AbstractList { size++; } + @Override @SuppressWarnings("unchecked") public E set(int index, E element) { Block s = contents; @@ -107,6 +109,7 @@ public class RevObjectList extends AbstractList { return (E) old; } + @Override @SuppressWarnings("unchecked") public E get(int index) { Block s = contents; @@ -120,6 +123,7 @@ public class RevObjectList extends AbstractList { return s != null ? (E) s.contents[index] : null; } + @Override public int size() { return size; } 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 a7f7cd463..572ebcd2e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java @@ -944,14 +944,17 @@ public class RevWalk implements Iterable, AutoCloseable { final Iterator objItr = have.iterator(); if (need.isEmpty()) { return new AsyncRevObjectQueue() { + @Override public RevObject next() { return objItr.hasNext() ? objItr.next() : null; } + @Override public boolean cancel(boolean mayInterruptIfRunning) { return true; } + @Override public void release() { // In-memory only, no action required. } @@ -960,6 +963,7 @@ public class RevWalk implements Iterable, AutoCloseable { final AsyncObjectLoaderQueue lItr = reader.open(need, reportMissing); return new AsyncRevObjectQueue() { + @Override public RevObject next() throws MissingObjectException, IncorrectObjectTypeException, IOException { if (objItr.hasNext()) @@ -983,10 +987,12 @@ public class RevWalk implements Iterable, AutoCloseable { return r; } + @Override public boolean cancel(boolean mayInterruptIfRunning) { return lItr.cancel(mayInterruptIfRunning); } + @Override public void release() { lItr.release(); } @@ -1316,6 +1322,7 @@ public class RevWalk implements Iterable, AutoCloseable { * @return an iterator over this walker's commits. * @see RevWalkException */ + @Override public Iterator iterator() { final RevCommit first; try { @@ -1331,10 +1338,12 @@ public class RevWalk implements Iterable, AutoCloseable { return new Iterator() { RevCommit next = first; + @Override public boolean hasNext() { return next != null; } + @Override public RevCommit next() { try { final RevCommit r = next; @@ -1349,6 +1358,7 @@ public class RevWalk implements Iterable, AutoCloseable { } } + @Override public void remove() { throw new UnsupportedOperationException(); } 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 14a98a10b..6b90d29f1 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 @@ -286,6 +286,7 @@ public abstract class RevFilter { * * @return another copy of this filter, suitable for another thread. */ + @Override public abstract RevFilter clone(); @Override 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 38a0fa2aa..6cfd352ec 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 @@ -185,6 +185,7 @@ public class FileBasedConfig extends StoredConfig { * @throws IOException * the file could not be written. */ + @Override public void save() throws IOException { final byte[] out; final String text = toText(); 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 3176cb30e..c64aa2d78 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 @@ -1044,6 +1044,7 @@ public class PackConfig { getBitmapInactiveBranchAgeInDays())); } + @Override public String toString() { final StringBuilder b = new StringBuilder(); b.append("maxDeltaDepth=").append(getMaxDeltaDepth()); //$NON-NLS-1$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AbstractAdvertiseRefsHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AbstractAdvertiseRefsHook.java index 2d730a10f..6f1369458 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AbstractAdvertiseRefsHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AbstractAdvertiseRefsHook.java @@ -57,12 +57,14 @@ import org.eclipse.jgit.revwalk.RevWalk; * @since 2.0 */ public abstract class AbstractAdvertiseRefsHook implements AdvertiseRefsHook { + @Override public void advertiseRefs(UploadPack uploadPack) throws ServiceMayNotContinueException { uploadPack.setAdvertisedRefs(getAdvertisedRefs( uploadPack.getRepository(), uploadPack.getRevWalk())); } + @Override public void advertiseRefs(BaseReceivePack receivePack) throws ServiceMayNotContinueException { Map refs = getAdvertisedRefs(receivePack.getRepository(), diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHook.java index c3af74a7c..96d7c240c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHook.java @@ -56,10 +56,12 @@ public interface AdvertiseRefsHook { * {@link BaseReceivePack#setAdvertisedRefs(java.util.Map,java.util.Set)}. */ public static final AdvertiseRefsHook DEFAULT = new AdvertiseRefsHook() { + @Override public void advertiseRefs(UploadPack uploadPack) { // Do nothing. } + @Override public void advertiseRefs(BaseReceivePack receivePack) { // Do nothing. } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHookChain.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHookChain.java index 00942aba4..22ea5cba9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHookChain.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHookChain.java @@ -79,12 +79,14 @@ public class AdvertiseRefsHookChain implements AdvertiseRefsHook { return new AdvertiseRefsHookChain(newHooks, i); } + @Override public void advertiseRefs(BaseReceivePack rp) throws ServiceMayNotContinueException { for (int i = 0; i < count; i++) hooks[i].advertiseRefs(rp); } + @Override public void advertiseRefs(UploadPack rp) throws ServiceMayNotContinueException { for (int i = 0; i < count; i++) 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 59ff1bd99..69028fab3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseConnection.java @@ -71,18 +71,22 @@ public abstract class BaseConnection implements Connection { private Writer messageWriter; + @Override public Map getRefsMap() { return advertisedRefs; } + @Override public final Collection getRefs() { return advertisedRefs.values(); } + @Override public final Ref getRef(final String name) { return advertisedRefs.get(name); } + @Override public String getMessages() { return messageWriter != null ? messageWriter.toString() : ""; //$NON-NLS-1$ } @@ -94,6 +98,7 @@ public abstract class BaseConnection implements Connection { * server does not advertise this version. * @since 4.0 */ + @Override public String getPeerUserAgent() { return peerUserAgent; } @@ -109,6 +114,7 @@ public abstract class BaseConnection implements Connection { peerUserAgent = agent; } + @Override public abstract void close(); /** diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseFetchConnection.java index cc2770771..41b8c2d76 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseFetchConnection.java @@ -64,12 +64,14 @@ import org.eclipse.jgit.lib.Ref; */ abstract class BaseFetchConnection extends BaseConnection implements FetchConnection { + @Override public final void fetch(final ProgressMonitor monitor, final Collection want, final Set have) throws TransportException { fetch(monitor, want, have, null); } + @Override public final void fetch(final ProgressMonitor monitor, final Collection want, final Set have, OutputStream out) throws TransportException { @@ -81,6 +83,7 @@ abstract class BaseFetchConnection extends BaseConnection implements * Default implementation of {@link FetchConnection#didFetchIncludeTags()} - * returning false. */ + @Override public boolean didFetchIncludeTags() { return false; } 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 0dd907f97..128ec4e28 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java @@ -280,6 +280,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection private static class FetchConfig { static final SectionParser KEY = new SectionParser() { + @Override public FetchConfig parse(final Config cfg) { return new FetchConfig(cfg); } @@ -292,6 +293,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection } } + @Override public final void fetch(final ProgressMonitor monitor, final Collection want, final Set have) throws TransportException { @@ -301,6 +303,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection /** * @since 3.0 */ + @Override public final void fetch(final ProgressMonitor monitor, final Collection want, final Set have, OutputStream outputStream) throws TransportException { @@ -308,18 +311,22 @@ public abstract class BasePackFetchConnection extends BasePackConnection doFetch(monitor, want, have, outputStream); } + @Override public boolean didFetchIncludeTags() { return false; } + @Override public boolean didFetchTestConnectivity() { return false; } + @Override public void setPackLockMessage(final String message) { lockMessage = message; } + @Override public Collection getPackLocks() { if (packLock != null) return Collections.singleton(packLock); 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 86cc484e3..bb5922d21 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java @@ -152,6 +152,7 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen pushOptions = transport.getPushOptions(); } + @Override public void push(final ProgressMonitor monitor, final Map refUpdates) throws TransportException { @@ -161,6 +162,7 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen /** * @since 3.0 */ + @Override public void push(final ProgressMonitor monitor, final Map refUpdates, OutputStream outputStream) throws TransportException { 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 b20a06864..080fbd643 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java @@ -333,6 +333,7 @@ public abstract class BaseReceivePack { /** Configuration for receive operations. */ protected static class ReceiveConfig { static final SectionParser KEY = new SectionParser() { + @Override public ReceiveConfig parse(final Config cfg) { return new ReceiveConfig(cfg); } 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 8038fa4d3..559c40394 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java @@ -180,6 +180,7 @@ class BundleFetchConnection extends BaseFetchConnection { return line.toString(); } + @Override public boolean didFetchTestConnectivity() { return false; } @@ -207,10 +208,12 @@ class BundleFetchConnection extends BaseFetchConnection { } } + @Override public void setPackLockMessage(final String message) { lockMessage = message; } + @Override public Collection getPackLocks() { if (packLock != null) return Collections.singleton(packLock); 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 da288ec31..9a272a4fd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java @@ -112,6 +112,7 @@ public interface Connection extends AutoCloseable { * Implementers shouldn't throw checked exceptions. This override narrows * the signature to prevent them from doing so. */ + @Override public void close(); /** diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java index 6757aaf10..843f6cc0e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java @@ -85,14 +85,17 @@ public class CredentialsProviderUserInfo implements UserInfo, return uri; } + @Override public String getPassword() { return password; } + @Override public String getPassphrase() { return passphrase; } + @Override public boolean promptPassphrase(String msg) { CredentialItem.StringType v = newPrompt(msg); if (provider.get(uri, v)) { @@ -104,6 +107,7 @@ public class CredentialsProviderUserInfo implements UserInfo, } } + @Override public boolean promptPassword(String msg) { CredentialItem.Password p = new CredentialItem.Password(msg); if (provider.get(uri, p)) { @@ -119,15 +123,18 @@ public class CredentialsProviderUserInfo implements UserInfo, return new CredentialItem.StringType(msg, true); } + @Override public boolean promptYesNo(String msg) { CredentialItem.YesNoType v = new CredentialItem.YesNoType(msg); return provider.get(uri, v) && v.getValue(); } + @Override public void showMessage(String msg) { provider.get(uri, new CredentialItem.InformationalMessage(msg)); } + @Override public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { CredentialItem.StringType[] v = new CredentialItem.StringType[prompt.length]; 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 1beec906e..40b2c47df 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java @@ -111,6 +111,7 @@ public class Daemon { repositoryResolver = (RepositoryResolver) RepositoryResolver.NONE; uploadPackFactory = new UploadPackFactory() { + @Override public UploadPack create(DaemonClient req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { @@ -122,6 +123,7 @@ public class Daemon { }; receivePackFactory = new ReceivePackFactory() { + @Override public ReceivePack create(DaemonClient req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { @@ -298,6 +300,7 @@ public class Daemon { run = true; acceptThread = new Thread(processors, "Git-Daemon-Accept") { //$NON-NLS-1$ + @Override public void run() { while (isRunning()) { try { @@ -344,6 +347,7 @@ public class Daemon { dc.setRemoteAddress(((InetSocketAddress) peer).getAddress()); new Thread(processors, "Git-Daemon-Client " + peer.toString()) { //$NON-NLS-1$ + @Override public void run() { try { dc.execute(s); 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 ec6f24273..80b2caebc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java @@ -65,6 +65,7 @@ public abstract class DaemonService { DaemonService(final String cmdName, final String cfgName) { command = cmdName.startsWith("git-") ? cmdName : "git-" + cmdName; //$NON-NLS-1$ //$NON-NLS-2$ configKey = new SectionParser() { + @Override public ServiceConfig parse(final Config cfg) { return new ServiceConfig(DaemonService.this, cfg, cfgName); } 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 70128077d..23fd7e39c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/DefaultSshSessionFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/DefaultSshSessionFactory.java @@ -59,6 +59,7 @@ import com.jcraft.jsch.Session; * connection will immediately fail. */ class DefaultSshSessionFactory extends JschConfigSessionFactory { + @Override protected void configure(final OpenSshConfig.Host hc, final Session session) { // No additional configuration required. } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HMACSHA1NonceGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HMACSHA1NonceGenerator.java index 319ae1edc..d43be8974 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HMACSHA1NonceGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HMACSHA1NonceGenerator.java @@ -82,6 +82,7 @@ public class HMACSHA1NonceGenerator implements NonceGenerator { } } + @Override public synchronized String createNonce(Repository repo, long timestamp) throws IllegalStateException { String path; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalFetchConnection.java index 7fc404811..bea8d60ec 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalFetchConnection.java @@ -87,6 +87,7 @@ class InternalFetchConnection extends BasePackFetchConnection { } worker = new Thread("JGit-Upload-Pack") { //$NON-NLS-1$ + @Override public void run() { try { final UploadPack rp = uploadPackFactory.create(req, remote); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalPushConnection.java index ab76e0f1e..8a1884e5f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalPushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/InternalPushConnection.java @@ -79,6 +79,7 @@ class InternalPushConnection extends BasePackPushConnection { } worker = new Thread("JGit-Receive-Pack") { //$NON-NLS-1$ + @Override public void run() { try { final ReceivePack rp = receivePackFactory.create(req, remote); 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 fa27bfce5..f445bcbcf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java @@ -87,10 +87,12 @@ public class JschSession implements RemoteSession { this.uri = uri; } + @Override public Process exec(String command, int timeout) throws IOException { return new JschProcess(command, timeout); } + @Override public void disconnect() { if (sock.isConnected()) sock.disconnect(); 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 38f3a2ac7..6051f39c0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java @@ -311,6 +311,7 @@ public class OpenSshConfig { static String userName() { return AccessController.doPrivileged(new PrivilegedAction() { + @Override public String run() { return System.getProperty("user.name"); //$NON-NLS-1$ } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHook.java index 1e662751b..8e395018c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHook.java @@ -62,6 +62,7 @@ import java.util.Collection; public interface PostReceiveHook { /** A simple no-op hook. */ public static final PostReceiveHook NULL = new PostReceiveHook() { + @Override public void onPostReceive(final ReceivePack rp, final Collection commands) { // Do nothing. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHookChain.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHookChain.java index da86525dc..3bdcd6895 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHookChain.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHookChain.java @@ -77,6 +77,7 @@ public class PostReceiveHookChain implements PostReceiveHook { return new PostReceiveHookChain(newHooks, i); } + @Override public void onPostReceive(ReceivePack rp, Collection commands) { for (int i = 0; i < count; i++) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHook.java index 53eeab1df..5b37bcdf0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHook.java @@ -58,6 +58,7 @@ import org.eclipse.jgit.storage.pack.PackStatistics; public interface PostUploadHook { /** A simple no-op hook. */ public static final PostUploadHook NULL = new PostUploadHook() { + @Override public void onPostUpload(PackStatistics stats) { // Do nothing. } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHookChain.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHookChain.java index 4e2eaeaff..26323badc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHookChain.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHookChain.java @@ -78,6 +78,7 @@ public class PostUploadHookChain implements PostUploadHook { return new PostUploadHookChain(newHooks, i); } + @Override public void onPostUpload(PackStatistics stats) { for (int i = 0; i < count; i++) hooks[i].onPostUpload(stats); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHook.java index 9a743a515..27b2df08c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHook.java @@ -78,6 +78,7 @@ import java.util.Collection; public interface PreReceiveHook { /** A simple no-op hook. */ public static final PreReceiveHook NULL = new PreReceiveHook() { + @Override public void onPreReceive(final ReceivePack rp, final Collection commands) { // Do nothing. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHookChain.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHookChain.java index bd4441fed..7b1c8fb3f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHookChain.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHookChain.java @@ -76,6 +76,7 @@ public class PreReceiveHookChain implements PreReceiveHook { return new PreReceiveHookChain(newHooks, i); } + @Override public void onPreReceive(ReceivePack rp, Collection commands) { for (int i = 0; i < count; i++) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java index 0360f120e..7d9638cfc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java @@ -58,12 +58,14 @@ import org.eclipse.jgit.lib.ObjectId; public interface PreUploadHook { /** A simple no-op hook. */ public static final PreUploadHook NULL = new PreUploadHook() { + @Override public void onBeginNegotiateRound(UploadPack up, Collection wants, int cntOffered) throws ServiceMayNotContinueException { // Do nothing. } + @Override public void onEndNegotiateRound(UploadPack up, Collection wants, int cntCommon, int cntNotFound, boolean ready) @@ -71,6 +73,7 @@ public interface PreUploadHook { // Do nothing. } + @Override public void onSendPack(UploadPack up, Collection wants, Collection haves) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java index 7f515e038..c9f88dd16 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHookChain.java @@ -79,6 +79,7 @@ public class PreUploadHookChain implements PreUploadHook { return new PreUploadHookChain(newHooks, i); } + @Override public void onBeginNegotiateRound(UploadPack up, Collection wants, int cntOffered) throws ServiceMayNotContinueException { @@ -86,6 +87,7 @@ public class PreUploadHookChain implements PreUploadHook { hooks[i].onBeginNegotiateRound(up, wants, cntOffered); } + @Override public void onEndNegotiateRound(UploadPack up, Collection wants, int cntCommon, int cntNotFound, boolean ready) @@ -94,6 +96,7 @@ public class PreUploadHookChain implements PreUploadHook { hooks[i].onEndNegotiateRound(up, wants, cntCommon, cntNotFound, ready); } + @Override public void onSendPack(UploadPack up, Collection wants, Collection haves) 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 d436e08df..706e72706 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java @@ -140,6 +140,7 @@ public class PushCertificateStore implements AutoCloseable { * If {@link #get(String)} was called, closes the cached object reader created * by that method. Does not close the underlying repository. */ + @Override public void close() { if (reader != null) { reader.close(); 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 393e25a2a..169df3be2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java @@ -273,6 +273,7 @@ public class ReceivePack extends BaseReceivePack { if (reportStatus) { if (echoCommandFailures && msgOut != null) { sendStatusReport(false, unpackError, new Reporter() { + @Override void sendString(final String s) throws IOException { msgOut.write(Constants.encode(s + "\n")); //$NON-NLS-1$ } @@ -285,6 +286,7 @@ public class ReceivePack extends BaseReceivePack { } } sendStatusReport(true, unpackError, new Reporter() { + @Override void sendString(final String s) throws IOException { pckOut.writeString(s + "\n"); //$NON-NLS-1$ } @@ -292,6 +294,7 @@ public class ReceivePack extends BaseReceivePack { pckOut.end(); } else if (msgOut != null) { sendStatusReport(false, unpackError, new Reporter() { + @Override void sendString(final String s) throws IOException { msgOut.write(Constants.encode(s + "\n")); //$NON-NLS-1$ } 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 e46195fc1..d4f85f2af 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java @@ -59,6 +59,7 @@ import org.eclipse.jgit.lib.Ref; public interface RefFilter { /** The default filter, allows all refs to be shown. */ public static final RefFilter DEFAULT = new RefFilter() { + @Override public Map filter (final 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 1440b83cf..64f6c3fb9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java @@ -556,6 +556,7 @@ public class RefSpec implements Serializable { return true; } + @Override public int hashCode() { int hc = 0; if (getSource() != null) @@ -565,6 +566,7 @@ public class RefSpec implements Serializable { return hc; } + @Override public boolean equals(final Object obj) { if (!(obj instanceof RefSpec)) return false; @@ -588,6 +590,7 @@ public class RefSpec implements Serializable { return a.equals(b); } + @Override public String toString() { final StringBuilder r = new StringBuilder(); if (isForceUpdate()) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SignedPushConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SignedPushConfig.java index 942e7d774..83b4acaea 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SignedPushConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SignedPushConfig.java @@ -55,6 +55,7 @@ public class SignedPushConfig { /** Key for {@link Config#get(SectionParser)}. */ public static final SectionParser KEY = new SectionParser() { + @Override public SignedPushConfig parse(Config cfg) { return new SignedPushConfig(cfg); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java index 72c9c8b93..5507e9b05 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java @@ -70,6 +70,7 @@ public class TransferConfig { /** Key for {@link Config#get(SectionParser)}. */ public static final Config.SectionParser KEY = new SectionParser() { + @Override public TransferConfig parse(final Config cfg) { return new TransferConfig(cfg); } @@ -207,6 +208,7 @@ public class TransferConfig { return RefFilter.DEFAULT; return new RefFilter() { + @Override public Map filter(Map refs) { Map result = new HashMap(); for (Map.Entry e : refs.entrySet()) { 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 64bdbe7d4..269d11644 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java @@ -1447,5 +1447,6 @@ public abstract class Transport implements AutoCloseable { * Implementers shouldn't throw checked exceptions. This override narrows * the signature to prevent them from doing so. */ + @Override public abstract void close(); } 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 23c506b12..74d9e7ff4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java @@ -101,23 +101,28 @@ public class TransportAmazonS3 extends HttpTransport implements WalkTransport { static final String S3_SCHEME = "amazon-s3"; //$NON-NLS-1$ static final TransportProtocol PROTO_S3 = new TransportProtocol() { + @Override public String getName() { return "Amazon S3"; //$NON-NLS-1$ } + @Override public Set getSchemes() { return Collections.singleton(S3_SCHEME); } + @Override public Set getRequiredFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.USER, URIishField.HOST, URIishField.PATH)); } + @Override public Set getOptionalFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.PASS)); } + @Override public Transport open(URIish uri, Repository local, String remoteName) throws NotSupportedException { return new TransportAmazonS3(local, uri); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java index 9b0834133..31d7909d1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundleFile.java @@ -74,6 +74,7 @@ class TransportBundleFile extends Transport implements TransportBundle { return JGitText.get().transportProtoBundleFile; } + @Override public Set getSchemes() { return schemeSet; } @@ -106,6 +107,7 @@ class TransportBundleFile extends Transport implements TransportBundle { return TransportLocal.PROTO_LOCAL.open(uri, local, remoteName); } + @Override public Transport open(URIish uri) throws NotSupportedException, TransportException { if ("bundle".equals(uri.getScheme())) { //$NON-NLS-1$ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java index c6e4c5080..7bf5b947d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java @@ -75,27 +75,33 @@ class TransportGitAnon extends TcpTransport implements PackTransport { static final int GIT_PORT = Daemon.DEFAULT_PORT; static final TransportProtocol PROTO_GIT = new TransportProtocol() { + @Override public String getName() { return JGitText.get().transportProtoGitAnon; } + @Override public Set getSchemes() { return Collections.singleton("git"); //$NON-NLS-1$ } + @Override public Set getRequiredFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.HOST, URIishField.PATH)); } + @Override public Set getOptionalFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.PORT)); } + @Override public int getDefaultPort() { return GIT_PORT; } + @Override public Transport open(URIish uri, Repository local, String remoteName) throws NotSupportedException { return new TransportGitAnon(local, uri); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java index 6bdf905e4..49a2042d9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java @@ -90,24 +90,29 @@ public class TransportGitSsh extends SshTransport implements PackTransport { .unmodifiableSet(new LinkedHashSet(Arrays .asList(schemeNames))); + @Override public String getName() { return JGitText.get().transportProtoSSH; } + @Override public Set getSchemes() { return schemeSet; } + @Override public Set getRequiredFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.HOST, URIishField.PATH)); } + @Override public Set getOptionalFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.USER, URIishField.PASS, URIishField.PORT)); } + @Override public int getDefaultPort() { return 22; } @@ -124,6 +129,7 @@ public class TransportGitSsh extends SshTransport implements PackTransport { return super.canHandle(uri, local, remoteName); } + @Override public Transport open(URIish uri, Repository local, String remoteName) throws NotSupportedException { return new TransportGitSsh(local, uri); @@ -215,6 +221,7 @@ public class TransportGitSsh extends SshTransport implements PackTransport { } private class ExtSession implements RemoteSession { + @Override public Process exec(String command, int timeout) throws TransportException { String ssh = SystemReader.getInstance().getenv("GIT_SSH"); //$NON-NLS-1$ @@ -250,6 +257,7 @@ public class TransportGitSsh extends SshTransport implements PackTransport { } } + @Override public void disconnect() { // Nothing to do } 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 fee9ae6a7..7c5289293 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java @@ -157,61 +157,74 @@ public class TransportHttp extends HttpTransport implements WalkTransport, .unmodifiableSet(new LinkedHashSet(Arrays .asList(schemeNames))); + @Override public String getName() { return JGitText.get().transportProtoHTTP; } + @Override public Set getSchemes() { return schemeSet; } + @Override public Set getRequiredFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.HOST, URIishField.PATH)); } + @Override public Set getOptionalFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.USER, URIishField.PASS, URIishField.PORT)); } + @Override public int getDefaultPort() { return 80; } + @Override public Transport open(URIish uri, Repository local, String remoteName) throws NotSupportedException { return new TransportHttp(local, uri); } + @Override public Transport open(URIish uri) throws NotSupportedException { return new TransportHttp(uri); } }; static final TransportProtocol PROTO_FTP = new TransportProtocol() { + @Override public String getName() { return JGitText.get().transportProtoFTP; } + @Override public Set getSchemes() { return Collections.singleton("ftp"); //$NON-NLS-1$ } + @Override public Set getRequiredFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.HOST, URIishField.PATH)); } + @Override public Set getOptionalFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.USER, URIishField.PASS, URIishField.PORT)); } + @Override public int getDefaultPort() { return 21; } + @Override public Transport open(URIish uri, Repository local, String remoteName) throws NotSupportedException { return new TransportHttp(local, uri); @@ -219,6 +232,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, }; private static final Config.SectionParser HTTP_KEY = new SectionParser() { + @Override public HttpConfig parse(final Config cfg) { return new HttpConfig(cfg); } @@ -863,6 +877,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, readAdvertisedRefs(); } + @Override protected void doPush(final ProgressMonitor monitor, final Map refUpdates, OutputStream outputStream) throws TransportException { @@ -975,16 +990,19 @@ public class TransportHttp extends HttpTransport implements WalkTransport, abstract void execute() throws IOException; class HttpExecuteStream extends InputStream { + @Override public int read() throws IOException { execute(); return -1; } + @Override public int read(byte[] b, int off, int len) throws IOException { execute(); return -1; } + @Override public long skip(long n) throws IOException { execute(); return 0; 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 1528c7142..32582ec48 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java @@ -100,6 +100,7 @@ class TransportLocal extends Transport implements PackTransport { return JGitText.get().transportProtoLocal; } + @Override public Set getSchemes() { return Collections.singleton("file"); //$NON-NLS-1$ } @@ -132,6 +133,7 @@ class TransportLocal extends Transport implements PackTransport { return new TransportLocal(local, uri, gitDir); } + @Override public Transport open(URIish uri) throws NotSupportedException, TransportException { File path = FS.DETECTED.resolve(new File("."), uri.getPath()); //$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 fa073ae2a..b99378dc9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java @@ -99,28 +99,34 @@ import com.jcraft.jsch.SftpException; */ public class TransportSftp extends SshTransport implements WalkTransport { static final TransportProtocol PROTO_SFTP = new TransportProtocol() { + @Override public String getName() { return JGitText.get().transportProtoSFTP; } + @Override public Set getSchemes() { return Collections.singleton("sftp"); //$NON-NLS-1$ } + @Override public Set getRequiredFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.HOST, URIishField.PATH)); } + @Override public Set getOptionalFields() { return Collections.unmodifiableSet(EnumSet.of(URIishField.USER, URIishField.PASS, URIishField.PORT)); } + @Override public int getDefaultPort() { return 22; } + @Override public Transport open(URIish uri, Repository local, String remoteName) throws NotSupportedException { return new TransportSftp(local, uri); @@ -251,6 +257,7 @@ public class TransportSftp extends SshTransport implements WalkTransport { } Collections.sort(packs, new Comparator() { + @Override public int compare(final String o1, final String o2) { return mtimes.get(o2).intValue() - mtimes.get(o1).intValue(); 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 3c5c8dadd..ffd4d41f2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java @@ -560,6 +560,7 @@ public class URIish implements Serializable { return r; } + @Override public int hashCode() { int hc = 0; if (getScheme() != null) @@ -577,6 +578,7 @@ public class URIish implements Serializable { return hc; } + @Override public boolean equals(final Object obj) { if (!(obj instanceof URIish)) return false; @@ -615,6 +617,7 @@ public class URIish implements Serializable { return format(true, false); } + @Override public String toString() { return format(false, false); } 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 201fb1874..3177b32e6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -1215,6 +1215,7 @@ public class UploadPack { */ public static final class AdvertisedRequestValidator implements RequestValidator { + @Override public void checkWants(UploadPack up, List wants) throws PackProtocolException, IOException { if (!up.isBiDirectionalPipe()) @@ -1231,6 +1232,7 @@ public class UploadPack { */ public static final class ReachableCommitRequestValidator implements RequestValidator { + @Override public void checkWants(UploadPack up, List wants) throws PackProtocolException, IOException { checkNotAdvertisedWants(up.getRevWalk(), wants, @@ -1244,6 +1246,7 @@ public class UploadPack { * @since 3.1 */ public static final class TipRequestValidator implements RequestValidator { + @Override public void checkWants(UploadPack up, List wants) throws PackProtocolException, IOException { if (!up.isBiDirectionalPipe()) @@ -1266,6 +1269,7 @@ public class UploadPack { */ public static final class ReachableCommitTipRequestValidator implements RequestValidator { + @Override public void checkWants(UploadPack up, List wants) throws PackProtocolException, IOException { checkNotAdvertisedWants(up.getRevWalk(), wants, @@ -1279,6 +1283,7 @@ public class UploadPack { * @since 3.1 */ public static final class AnyRequestValidator implements RequestValidator { + @Override public void checkWants(UploadPack up, List wants) throws PackProtocolException, IOException { // All requests are valid. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLogger.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLogger.java index 0588634d2..afc996518 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLogger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLogger.java @@ -59,6 +59,7 @@ import org.eclipse.jgit.internal.storage.pack.PackWriter; public interface UploadPackLogger { // TODO remove in JGit 5.0 /** A simple no-op logger. */ public static final UploadPackLogger NULL = new UploadPackLogger() { + @Override public void onPackStatistics(PackWriter.Statistics stats) { // Do nothing. } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLoggerChain.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLoggerChain.java index 4ea0319d9..9a8c12c64 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLoggerChain.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLoggerChain.java @@ -84,6 +84,7 @@ public class UploadPackLoggerChain implements UploadPackLogger { /** * @since 3.0 */ + @Override public void onPackStatistics(PackWriter.Statistics stats) { for (int i = 0; i < count; i++) loggers[i].onPackStatistics(stats); 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 13d4a24b0..0319d9386 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java @@ -223,6 +223,7 @@ class WalkFetchConnection extends BaseFetchConnection { workQueue = new LinkedList(); } + @Override public boolean didFetchTestConnectivity() { return true; } @@ -248,10 +249,12 @@ class WalkFetchConnection extends BaseFetchConnection { } } + @Override public Collection getPackLocks() { return packLocks; } + @Override public void setPackLockMessage(final String message) { lockMessage = message; } 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 7b449c752..39f11f96e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java @@ -134,12 +134,14 @@ class WalkPushConnection extends BaseConnection implements PushConnection { dest = w; } + @Override public void push(final ProgressMonitor monitor, final Map refUpdates) throws TransportException { push(monitor, refUpdates, null); } + @Override public void push(final ProgressMonitor monitor, final Map refUpdates, OutputStream out) throws TransportException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java index ed37feab3..534e3d734 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnection.java @@ -94,95 +94,118 @@ public class JDKHttpConnection implements HttpConnection { .openConnection(proxy); } + @Override public int getResponseCode() throws IOException { return wrappedUrlConnection.getResponseCode(); } + @Override public URL getURL() { return wrappedUrlConnection.getURL(); } + @Override public String getResponseMessage() throws IOException { return wrappedUrlConnection.getResponseMessage(); } + @Override public Map> getHeaderFields() { return wrappedUrlConnection.getHeaderFields(); } + @Override public void setRequestProperty(String key, String value) { wrappedUrlConnection.setRequestProperty(key, value); } + @Override public void setRequestMethod(String method) throws ProtocolException { wrappedUrlConnection.setRequestMethod(method); } + @Override public void setUseCaches(boolean usecaches) { wrappedUrlConnection.setUseCaches(usecaches); } + @Override public void setConnectTimeout(int timeout) { wrappedUrlConnection.setConnectTimeout(timeout); } + @Override public void setReadTimeout(int timeout) { wrappedUrlConnection.setReadTimeout(timeout); } + @Override public String getContentType() { return wrappedUrlConnection.getContentType(); } + @Override public InputStream getInputStream() throws IOException { return wrappedUrlConnection.getInputStream(); } + @Override public String getHeaderField(String name) { return wrappedUrlConnection.getHeaderField(name); } + @Override public int getContentLength() { return wrappedUrlConnection.getContentLength(); } + @Override public void setInstanceFollowRedirects(boolean followRedirects) { wrappedUrlConnection.setInstanceFollowRedirects(followRedirects); } + @Override public void setDoOutput(boolean dooutput) { wrappedUrlConnection.setDoOutput(dooutput); } + @Override public void setFixedLengthStreamingMode(int contentLength) { wrappedUrlConnection.setFixedLengthStreamingMode(contentLength); } + @Override public OutputStream getOutputStream() throws IOException { return wrappedUrlConnection.getOutputStream(); } + @Override public void setChunkedStreamingMode(int chunklen) { wrappedUrlConnection.setChunkedStreamingMode(chunklen); } + @Override public String getRequestMethod() { return wrappedUrlConnection.getRequestMethod(); } + @Override public boolean usingProxy() { return wrappedUrlConnection.usingProxy(); } + @Override public void connect() throws IOException { wrappedUrlConnection.connect(); } + @Override public void setHostnameVerifier(HostnameVerifier hostnameverifier) { ((HttpsURLConnection) wrappedUrlConnection) .setHostnameVerifier(hostnameverifier); } + @Override public void configure(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws NoSuchAlgorithmException, KeyManagementException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnectionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnectionFactory.java index d1c875d40..b9f009f1b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnectionFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/JDKHttpConnectionFactory.java @@ -52,10 +52,12 @@ import java.net.URL; * @since 3.3 */ public class JDKHttpConnectionFactory implements HttpConnectionFactory { + @Override public HttpConnection create(URL url) throws IOException { return new JDKHttpConnection(url); } + @Override public HttpConnection create(URL url, Proxy proxy) throws IOException { return new JDKHttpConnection(url, proxy); 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 6964e7fa2..44d90aba0 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 @@ -91,6 +91,7 @@ public class FileResolver implements RepositoryResolver { setExportAll(exportAll); } + @Override public Repository open(final C req, final String name) throws RepositoryNotFoundException, ServiceNotEnabledException { if (isUnreasonableName(name)) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/ReceivePackFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/ReceivePackFactory.java index 4cf49f553..73c2ed80c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/ReceivePackFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/ReceivePackFactory.java @@ -55,6 +55,7 @@ import org.eclipse.jgit.transport.ReceivePack; public interface ReceivePackFactory { /** A factory disabling the ReceivePack service for all repositories */ public static final ReceivePackFactory DISABLED = new ReceivePackFactory() { + @Override public ReceivePack create(Object req, Repository db) throws ServiceNotEnabledException { throw new ServiceNotEnabledException(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/RepositoryResolver.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/RepositoryResolver.java index c7f0d32cb..80211e581 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/RepositoryResolver.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/RepositoryResolver.java @@ -56,6 +56,7 @@ import org.eclipse.jgit.transport.ServiceMayNotContinueException; public interface RepositoryResolver { /** Resolver configured to open nothing. */ public static final RepositoryResolver NONE = new RepositoryResolver() { + @Override public Repository open(Object req, String name) throws RepositoryNotFoundException { throw new RepositoryNotFoundException(name); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/UploadPackFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/UploadPackFactory.java index f0d2ba865..d7ed0f68c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/UploadPackFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/UploadPackFactory.java @@ -55,6 +55,7 @@ import org.eclipse.jgit.transport.UploadPack; public interface UploadPackFactory { /** A factory disabling the UploadPack service for all repositories. */ public static final UploadPackFactory DISABLED = new UploadPackFactory() { + @Override public UploadPack create(Object req, Repository db) throws ServiceNotEnabledException { throw new ServiceNotEnabledException(); 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 c038f0772..2d6abd1ad 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/CanonicalTreeParser.java @@ -249,6 +249,7 @@ public class CanonicalTreeParser extends AbstractTreeIterator { return p; } + @Override public CanonicalTreeParser createSubtreeIterator(final ObjectReader reader) throws IncorrectObjectTypeException, IOException { return createSubtreeIterator(reader, new MutableObjectId()); @@ -280,6 +281,7 @@ public class CanonicalTreeParser extends AbstractTreeIterator { return currPtr == 0; } + @Override public boolean eof() { return currPtr == raw.length; } 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 b9293ebfb..c0b29ef93 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java @@ -353,6 +353,7 @@ public class NameConflictTreeWalk extends TreeWalk { dfConflict = null; } + @Override void stopWalk() throws IOException { if (!needsStopWalk()) { return; 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 5dfebe9ca..01156c338 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java @@ -559,6 +559,7 @@ public class TreeWalk implements AutoCloseable, AttributesProvider { * @return a {@link Set} of {@link Attribute}s that match the current entry. * @since 4.2 */ + @Override public Attributes getAttributes() { if (attrs != null) return attrs; 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 52477cb57..4eb530e98 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java @@ -715,6 +715,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { } private static final Comparator ENTRY_CMP = new Comparator() { + @Override public int compare(Entry a, Entry b) { return Paths.compare( a.encodedName, 0, a.encodedNameLen, a.getMode().getBits(), @@ -1154,6 +1155,7 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { b.get(encodedName = new byte[encodedNameLen]); } + @Override public String toString() { return getMode().toString() + " " + getName(); //$NON-NLS-1$ } 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 112ce8fb9..7d2b33f43 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeOptions.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeOptions.java @@ -56,6 +56,7 @@ import org.eclipse.jgit.lib.CoreConfig.SymLinks; public class WorkingTreeOptions { /** Key for {@link Config#get(SectionParser)}. */ public static final Config.SectionParser KEY = new SectionParser() { + @Override public WorkingTreeOptions parse(final Config cfg) { return new WorkingTreeOptions(cfg); } 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 d85ea8cc5..103b0e227 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 @@ -113,6 +113,7 @@ public class PathFilter extends TreeFilter { return this; } + @Override @SuppressWarnings("nls") public String toString() { return "PATH(\"" + pathStr + "\")"; 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 7601956c4..174a4f5b0 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 @@ -173,6 +173,7 @@ public class PathFilterGroup { return this; } + @Override public String toString() { return "FAST_" + path.toString(); //$NON-NLS-1$ } @@ -267,6 +268,7 @@ public class PathFilterGroup { return this; } + @Override public String toString() { final StringBuilder r = new StringBuilder(); r.append("FAST("); //$NON-NLS-1$ 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 7d99e58f3..9f468ec3f 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 @@ -220,6 +220,7 @@ public abstract class TreeFilter { * * @return another copy of this filter, suitable for another thread. */ + @Override public abstract TreeFilter clone(); @Override diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/BlockList.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/BlockList.java index 9d0ad736f..c86c588ac 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/BlockList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/BlockList.java @@ -309,10 +309,12 @@ public class BlockList extends AbstractList { private T[] block = directory[0]; + @Override public boolean hasNext() { return index < size; } + @Override public T next() { if (size <= index) throw new NoSuchElementException(); @@ -329,6 +331,7 @@ public class BlockList extends AbstractList { return res; } + @Override public void remove() { if (index == 0) throw new IllegalStateException(); 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 2f570ee51..f189b3586 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java @@ -409,6 +409,7 @@ public abstract class FS { protected File userHomeImpl() { final String home = AccessController .doPrivileged(new PrivilegedAction() { + @Override public String run() { return System.getProperty("user.home"); //$NON-NLS-1$ } @@ -1342,6 +1343,7 @@ public abstract class FS { this.out = output; } + @Override public void run() { try { copy(); 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 0e9172e8c..dffd66569 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 @@ -83,18 +83,22 @@ public class FS_Win32 extends FS { super(src); } + @Override public FS newInstance() { return new FS_Win32(this); } + @Override public boolean supportsExecute() { return false; } + @Override public boolean canExecute(final File f) { return false; } + @Override public boolean setExecute(final File f, final 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 f8ea5d0aa..e62083e9c 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 @@ -77,6 +77,7 @@ public class FS_Win32_Cygwin extends FS_Win32 { public static boolean isCygwin() { final String path = AccessController .doPrivileged(new PrivilegedAction() { + @Override public String run() { return System.getProperty("java.library.path"); //$NON-NLS-1$ } @@ -106,10 +107,12 @@ public class FS_Win32_Cygwin extends FS_Win32 { super(src); } + @Override public FS newInstance() { return new FS_Win32_Cygwin(this); } + @Override public File resolve(final File dir, final String pn) { String useCygPath = System.getProperty("jgit.usecygpath"); //$NON-NLS-1$ if (useCygPath != null && useCygPath.equals("true")) { //$NON-NLS-1$ @@ -133,6 +136,7 @@ public class FS_Win32_Cygwin extends FS_Win32 { protected File userHomeImpl() { final String home = AccessController .doPrivileged(new PrivilegedAction() { + @Override public String run() { return System.getenv("HOME"); //$NON-NLS-1$ } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java index 7bc3c88c5..4aafa3a2c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/GitDateParser.java @@ -75,6 +75,7 @@ public class GitDateParser { private static ThreadLocal>> formatCache = new ThreadLocal>>() { + @Override protected Map> initialValue() { return new HashMap>(); } 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 9f828adc2..13e61a797 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java @@ -303,15 +303,18 @@ public class HttpSupport { } private static class DummyX509TrustManager implements X509TrustManager { + @Override public X509Certificate[] getAcceptedIssuers() { return null; } + @Override public void checkClientTrusted(X509Certificate[] certs, String authType) { // no check } + @Override public void checkServerTrusted(X509Certificate[] certs, String authType) { // no check @@ -319,6 +322,7 @@ public class HttpSupport { } private static class DummyHostnameVerifier implements HostnameVerifier { + @Override public boolean verify(String hostname, SSLSession session) { // always accept return true; 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 f7688e360..658dd06d4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/IntList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/IntList.java @@ -138,6 +138,7 @@ public class IntList { entries = n; } + @Override public String toString() { final StringBuilder r = new StringBuilder(); r.append('['); 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 dc4004fce..e3639f5c6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java @@ -159,6 +159,7 @@ public class LongList { entries = n; } + @Override public String toString() { final StringBuilder r = new StringBuilder(); r.append('['); 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 4eeecdbf2..e85bd659b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/RawCharSequence.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/RawCharSequence.java @@ -74,14 +74,17 @@ public final class RawCharSequence implements CharSequence { endPtr = end; } + @Override public char charAt(final int index) { return (char) (buffer[startPtr + index] & 0xff); } + @Override public int length() { return endPtr - startPtr; } + @Override public CharSequence subSequence(final int start, final int end) { return new RawCharSequence(buffer, startPtr + start, startPtr + end); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java index 0853e9536..96c1a89f2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/RefList.java @@ -100,20 +100,24 @@ public class RefList implements Iterable { this.cnt = src.cnt; } + @Override public Iterator iterator() { return new Iterator() { private int idx; + @Override public boolean hasNext() { return idx < cnt; } + @Override public Ref next() { if (idx < cnt) return list[idx++]; throw new NoSuchElementException(); } + @Override public void remove() { throw new UnsupportedOperationException(); } 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 c72727b54..510e81821 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/RefMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/RefMap.java @@ -304,12 +304,14 @@ public class RefMap extends AbstractMap { } } + @Override public boolean hasNext() { if (next == null) next = peek(); return next != null; } + @Override public Entry next() { if (hasNext()) { Entry r = next; @@ -367,6 +369,7 @@ public class RefMap extends AbstractMap { return null; } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -379,14 +382,17 @@ public class RefMap extends AbstractMap { this.ref = ref; } + @Override public String getKey() { return toMapKey(ref); } + @Override public Ref getValue() { return ref; } + @Override public Ref setValue(Ref value) { Ref prior = put(getKey(), value); ref = value; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java index b36fc2391..2cd803585 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java @@ -87,22 +87,27 @@ public abstract class SystemReader { private static class Default extends SystemReader { private volatile String hostname; + @Override public String getenv(String variable) { return System.getenv(variable); } + @Override public String getProperty(String key) { return System.getProperty(key); } + @Override public FileBasedConfig openSystemConfig(Config parent, FS fs) { File configFile = fs.getGitSystemConfig(); if (configFile == null) { return new FileBasedConfig(null, fs) { + @Override public void load() { // empty, do not load } + @Override public boolean isOutdated() { // regular class would bomb here return false; @@ -112,11 +117,13 @@ public abstract class SystemReader { return new FileBasedConfig(parent, configFile, fs); } + @Override public FileBasedConfig openUserConfig(Config parent, FS fs) { final File home = fs.userHome(); return new FileBasedConfig(parent, new File(home, ".gitconfig"), fs); //$NON-NLS-1$ } + @Override public String getHostname() { if (hostname == null) { try { @@ -331,6 +338,7 @@ public abstract class SystemReader { private String getOsName() { return AccessController.doPrivileged(new PrivilegedAction() { + @Override public String run() { return getProperty("os.name"); //$NON-NLS-1$ } 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 57bcfbd5e..9509db0db 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java @@ -363,6 +363,7 @@ public abstract class TemporaryBuffer extends OutputStream { overflow.write(last.buffer, 0, last.count); } + @Override public void close() throws IOException { if (overflow != null) { try { @@ -441,11 +442,13 @@ public abstract class TemporaryBuffer extends OutputStream { this.directory = directory; } + @Override protected OutputStream overflow() throws IOException { onDiskFile = File.createTempFile("jgit_", ".buf", directory); //$NON-NLS-1$ //$NON-NLS-2$ return new BufferedOutputStream(new FileOutputStream(onDiskFile)); } + @Override public long length() { if (onDiskFile == null) { return super.length(); @@ -453,6 +456,7 @@ public abstract class TemporaryBuffer extends OutputStream { return onDiskFile.length(); } + @Override public byte[] toByteArray() throws IOException { if (onDiskFile == null) { return super.toByteArray(); @@ -471,6 +475,7 @@ public abstract class TemporaryBuffer extends OutputStream { return out; } + @Override public void writeTo(final OutputStream os, ProgressMonitor pm) throws IOException { if (onDiskFile == null) { 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 102438026..0c5edb007 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 @@ -176,6 +176,7 @@ public final class InterruptTimer { callingThread = Thread.currentThread(); } + @Override public synchronized void run() { while (!terminated && callingThread.isAlive()) { try { 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 6adadbbb8..a7a034740 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 @@ -115,6 +115,7 @@ public class TeeInputStream extends InputStream { return n; } + @Override public void close() throws IOException { byte[] b = skipBuffer(); for (;;) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/ThrowingPrintWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/ThrowingPrintWriter.java index c34c1fb68..5eca0d99e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/ThrowingPrintWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/ThrowingPrintWriter.java @@ -69,6 +69,7 @@ public class ThrowingPrintWriter extends Writer { public ThrowingPrintWriter(Writer out) { this.out = out; LF = AccessController.doPrivileged(new PrivilegedAction() { + @Override public String run() { return SystemReader.getInstance().getProperty("line.separator"); //$NON-NLS-1$ }