]> source.dussan.org Git - jgit.git/commitdiff
PackWriter: Make internal class static 78/143178/4
authorDavid Pursehouse <david.pursehouse@gmail.com>
Sun, 2 Jun 2019 08:45:32 +0000 (17:45 +0900)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 6 Jun 2019 15:15:10 +0000 (17:15 +0200)
When Error Prone checks are enabled, the "ClassCanBeStatic" warning is
triggered:

  Inner class is non-static but does not reference enclosing class
  see https://errorprone.info/bugpattern/ClassCanBeStatic

Change-Id: I5a0e3bf0cf8c28176d9c98914c1c0dfab9c5736f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java

index 2f7e1a656a0d57c5303916ba15ab0a148329dc7e..714e8308f4e4f24eef31fc34f4ba5604b12d2c9a 100644 (file)
@@ -878,7 +878,7 @@ public class PackWriter implements AutoCloseable {
         * already been visited at this depth or shallower, it is not necessary to
         * re-visit at this depth.
         */
-       private class DepthAwareVisitationPolicy
+       private static class DepthAwareVisitationPolicy
                        implements ObjectWalk.VisitationPolicy {
                private final Map<ObjectId, Integer> lowestDepthVisited = new HashMap<>();