From: Terry Parker Date: Tue, 16 Jun 2015 17:05:29 +0000 (-0700) Subject: Update comments about PackStatistics X-Git-Tag: v4.1.0.201509280440-r~99 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8b20f2c89030591b645a9e349d6f94c065ace0e6;p=jgit.git Update comments about PackStatistics Change-Id: I4862932dc38b58cc98400ed584cc506013846065 Signed-off-by: Terry Parker --- 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 2582deb306..bd0b0e7c33 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 @@ -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); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackStatistics.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackStatistics.java index ab9b5e7f61..24efb943c3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackStatistics.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackStatistics.java @@ -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; }