No reason to create a new instance every time we need to shove
a null monitor into a variable because someone passed us null.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
.../org/spearce/jgit/lib/NullProgressMonitor.java | 3 +++
.../src/org/spearce/jgit/util/TemporaryBuffer.java | 2 +-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/NullProgressMonitor.java b/org.spearce.jgit/src/org/spearce/jgit/lib/NullProgressMonitor.java
index de75b90..191dc00 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/NullProgressMonitor.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/NullProgressMonitor.java
@@ -42,6 +42,9 @@ package org.spearce.jgit.lib;
* A NullProgressMonitor does not report progress anywhere.
*/
public class NullProgressMonitor implements ProgressMonitor {
+ /** Immutable instance of a null progress monitor. */
+ public static final NullProgressMonitor INSTANCE = new NullProgressMonitor();
+
public void start(int totalTasks) {
// Do not report.
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/util/TemporaryBuffer.java b/org.spearce.jgit/src/org/spearce/jgit/util/TemporaryBuffer.java
index 20db580..d597c38 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/util/TemporaryBuffer.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/util/TemporaryBuffer.java
@@ -200,7 +200,7 @@ public class TemporaryBuffer extends OutputStream {
public void writeTo(final OutputStream os, ProgressMonitor pm)
throws IOException {
if (pm == null)
- pm = new NullProgressMonitor();
+ pm = NullProgressMonitor.INSTANCE;
if (blocks != null) {
// Everything is in core so we can stream directly to the output.
//
--
1.5.6.74.g8a5e
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Tejun Heo | [PATCH 2/7] FUSE: pass nonblock flag to client |
| Paa Paa | Lower HD transfer rate with NCQ enabled? |
| Miklos Szeredi | [BUG] long freezes on thinkpad t60 |
| FUJITA Tomonori | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Elijah Newren | Re: Trying to use git-filter-branch to compress history by removing large, obsolet... |
| Matthieu Moy | [RFC] Clean way to disable pager |
| Johannes Sixt | Re: MinGW port - initial work uploaded |
| Wincent Colaiuta | Possible to make a totally empty repository for remote access? |
| slug bait | Problem with Intel 4-port NIC |
| Erik Carlseen | Installing OpenBSD 4.4 AMD64 with more than 4GB |
| BARDOU Pierre | OpenBGP load balancing between 2 ISP (multihoming) |
| RedShift | Re: Real men don't attack straw men |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Chad Dougherty | help |
| Linus Torvalds | Re: Missing linux/delay.h??? |
| Orest Zborowski | emacs interactive shell not working |
| VPN's on NetBSD | 8 hours ago | NetBSD |
| Why does uClinux 2.6.18 bootup block SuperIO UART IRQs that BIOS configured | 9 hours ago | Linux kernel |
| USB statistics | 11 hours ago | Linux kernel |
| Block Sub System query | 15 hours ago | Linux kernel |
| kernel module to intercept socket creation | 16 hours ago | Linux kernel |
| Image size changing during each build | 16 hours ago | Linux kernel |
| Soft lock bug | 21 hours ago | Linux kernel |
| sysctl - dynamic registration problem | 1 day ago | Linux kernel |
| Question on swap as ramdisk partition | 1 day ago | Linux kernel |
| serial driver xmit problem | 1 day ago | Linux kernel |
