[egit PATCH] avoiding output in the error log

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,this is a patch for egit. The purpose of the patch
is to avoid a lot of output in the error log.

>From 6f7be5d1a41d356a9b558ac81722e959095ff04d Mon Sep 17 00:00:00 2001
From: robert <robert_no.spam_m@xxxxxxxx>
Date: Mon, 25 Aug 2008 20:42:39 +0200
Subject: [PATCH] Checks added to avoid a lot of entries in the log

* IResource.exists() must be checked before calling setProperty on it.
* getActiveDecorator() was returning null in some case.
---
 .../internal/decorators/GitResourceDecorator.java  |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
index 5857eaf..7c10ec6 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
@@ -143,7 +143,9 @@ if (resources.size() > 0)
 					try {
 						m.accept(new IResourceVisitor() {
 							public boolean visit(IResource resource) throws CoreException {
-								getActiveDecorator().clearDecorationState(resource);
+								GitResourceDecorator decorator = getActiveDecorator();
+								if (decorator != null)
+									decorator.clearDecorationState(resource);
 								return true;
 							}
 						},
@@ -197,8 +199,10 @@ synchronized (resources) {
 	} // End ResCL
 
 	void clearDecorationState(IResource r) throws CoreException {
-		r.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, null);
-		fireLabelProviderChanged(new LabelProviderChangedEvent(this, r));
+		if (r.exists()) {
+			r.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, null);
+			fireLabelProviderChanged(new LabelProviderChangedEvent(this, r));
+		}
 	}
 
 	static ResCL myrescl = new ResCL();
-- 
1.6.0



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux