]> source.dussan.org Git - jgit.git/commit
Remove further unnecessary 'final' keywords 88/122788/2
authorHan-Wen Nienhuys <hanwen@google.com>
Wed, 16 May 2018 14:34:16 +0000 (16:34 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 18 May 2018 15:59:45 +0000 (17:59 +0200)
commitf3ec7cf3f0436a79e252251a31dbc62694555897
tree49a647fa520bb5a1016425df26357947f8dab95c
parent667e30678a6bad26f4d4d412e996b293e52e5b87
Remove further unnecessary 'final' keywords

Remove it from

 * package private functions.

 * try blocks

 * for loops

this was done with the following python script:

$ cat f.py
import sys
import re
import os

def replaceFinal(m):
  return m.group(1) + "(" +  m.group(2).replace('final ', '') + ")"

methodDecl = re.compile(r"^([\t ]*[a-zA-Z_ ]+)\(([^)]*)\)")

def subst(fn):
  input = open(fn)
  os.rename(fn, fn + "~")

  dest = open(fn, 'w')
  for l in input:
    l = methodDecl.sub(replaceFinal, l)
    dest.write(l)
  dest.close()

for root, dirs, files in os.walk(".", topdown=False):
  for f in files:
    if not f.endswith('.java'):
      continue

    full = os.path.join(root, f)
    print full
    subst(full)

Change-Id: If533a75a417594fc893e7c669d2c1f0f6caeb7ca
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
203 files changed:
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/FileSender.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ObjectFileServlet.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/TextFileServlet.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/AsIsFileService.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultReceivePackFactory.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java
org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AccessEvent.java
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/UploadTest.java
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AbbreviatedLongObjectId.java
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java
org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AmazonS3Client.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandRef.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Daemon.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/MergeBase.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java
org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitOnlyTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/WindowCacheGetTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/XInputStream.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter6012Test.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/CanonicalTreeParserTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/TreeFilterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/TemporaryBufferTest.java
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/blame/ReverseWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheTree.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjectToPack.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteArrayWindow.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteBufferWindow.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ByteWindow.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/CachedObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/DeltaBaseCache.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LocalObjectToPack.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV1.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV1.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexWriterV2.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackReverseIndex.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryRename.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCache.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategySimpleTwoWayInCore.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/BinaryHunk.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedFileHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/CombinedHunkHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockObjQueue.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BlockRevQueue.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BoundaryGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DateRevQueue.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DelayRevQueue.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FIFORevQueue.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FixUninterestingGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FollowFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/Generator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/LIFORevQueue.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/PendingGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevFlag.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObject.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TopoSortGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AndRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/AuthorRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitTimeRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/CommitterRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/MessageRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/OrRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/filter/RevFlagFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonClient.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/DaemonService.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchHeadRecord.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchResult.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/OperationResult.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/SideBandProgressMonitor.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TagOpt.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitAnon.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkEncryption.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/AbstractTreeIterator.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/EmptyTreeIterator.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/AndTreeFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/OrTreeFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java
org.eclipse.jgit/src/org/eclipse/jgit/util/CachedAuthenticator.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
org.eclipse.jgit/src/org/eclipse/jgit/util/LongMap.java
org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java
org.eclipse.jgit/src/org/eclipse/jgit/util/io/InterruptTimer.java