]> source.dussan.org Git - jgit.git/commit
Enable and fix "Statement unnecessarily nested within else clause" warnings 03/151203/2
authorDavid Pursehouse <david.pursehouse@gmail.com>
Thu, 17 Oct 2019 00:01:25 +0000 (09:01 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Thu, 17 Oct 2019 01:20:14 +0000 (10:20 +0900)
commit98cdca9b5a830f1c2ceca52379d662a68109d43e
treed843141173394b4ea4e435553885749096d4fb79
parent762f6212b4692b28f098ac597058bd6a489b8b49
Enable and fix "Statement unnecessarily nested within else clause" warnings

Since [1] the gerrit project includes jgit as a submodule, and has this
warning enabled, resulting in 100s of warnings in the console.

Also enable the warning here, and fix them.

At the same time, add missing braces around adjacent and nearby one-line
blocks.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/227897

Change-Id: I81df3fc7ed6eedf6874ce1a3bedfa727a1897e4c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
122 files changed:
org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/resolver/DefaultUploadPackFactory.java
org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
org.eclipse.jgit.junit.ssh/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java
org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/BuiltinLFS.java
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/AnyLongObjectId.java
org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.pgm/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
org.eclipse.jgit.ssh.apache.test/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.ssh.apache/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java
org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java
org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/proxy/HttpParser.java
org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/proxy/Socks5ClientConnector.java
org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSession.java
org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileSnapshotTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSerializerTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java
org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/GarbageCollectCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/Edit.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LagCheck.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRefDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GcLog.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/RefDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogEntryImpl.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObjectCache.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTreeBatch.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/http/NetscapeCookieFileCache.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFile.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/ThreeWayMerger.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMapMerger.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteParser.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProviderUserInfo.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/HMACSHA1NonceGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/FileResolver.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathSuffixFilter.java
org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
org.eclipse.jgit/src/org/eclipse/jgit/util/IO.java
org.eclipse.jgit/src/org/eclipse/jgit/util/RefMap.java
org.eclipse.jgit/src/org/eclipse/jgit/util/SshSupport.java
org.eclipse.jgit/src/org/eclipse/jgit/util/io/LimitedInputStream.java