]> source.dussan.org Git - jgit.git/commitdiff
Update comments about PackStatistics 91/50291/1
authorTerry Parker <tparker@google.com>
Tue, 16 Jun 2015 17:05:29 +0000 (10:05 -0700)
committerTerry Parker <tparker@google.com>
Tue, 16 Jun 2015 17:08:18 +0000 (10:08 -0700)
Change-Id: I4862932dc38b58cc98400ed584cc506013846065
Signed-off-by: Terry Parker <tparker@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackStatistics.java

index 2582deb306b41afd88b774c94861422961f78889..bd0b0e7c33c8bcdec39183f210a601e3fa0862bc 100644 (file)
@@ -1032,8 +1032,8 @@ public class PackWriter implements AutoCloseable {
 
        /**
         * @return description of what this PackWriter did in order to create the
-        *         final pack stream. The object is only available to callers after
-        *         {@link #writePack(ProgressMonitor, ProgressMonitor, OutputStream)}
+        *         final pack stream. This should only be invoked after the calls to
+        *         create the pack/index/bitmap have completed.
         */
        public PackStatistics getStatistics() {
                return new PackStatistics(stats);
index ab9b5e7f616984c792868faafe836bfe51c9aede..24efb943c3d37aca319c24f53961b0837a58b341 100644 (file)
@@ -101,6 +101,12 @@ public class PackStatistics {
                 *            the accumulator of the statistics
                 */
                public ObjectType(ObjectType.Accumulator accumulator) {
+                       /*
+                        * For efficiency this wraps and serves up the Accumulator object
+                        * rather than making a deep clone. Normal usage of PackWriter is to
+                        * create a single pack/index/bitmap and only call getStatistics()
+                        * after all work is complete.
+                        */
                        objectType = accumulator;
                }
 
@@ -251,8 +257,12 @@ public class PackStatistics {
         *            the accumulator of the statistics
         */
        public PackStatistics(Accumulator accumulator) {
-               // Note: PackStatistics directly serves up the collections in the
-               // accumulator.
+               /*
+                * For efficiency this wraps and serves up the Accumulator object rather
+                * than making a deep clone. Normal usage of PackWriter is to create a
+                * single pack/index/bitmap and only call getStatistics() after all work
+                * is complete.
+                */
                statistics = accumulator;
        }