git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [egit PATCH] avoiding output in the error log

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Aug 27, 2008, 20:28 UTC
Message-ID
<200808272228.07060.robin.rosenberg.lists@dewire.com>
In-Reply-To
<218798.11648.bm@omp221.mail.ukl.yahoo.com>
onsdagen den 27 augusti 2008 11.34.33 skrev robert_no.spam_m@yahoo.fr:
> Hi,this is a patch for egit. The purpose of the patch
> is to avoid a lot of output in the error log.
Welcome Robert!
Show 24 quoted lines
> 
> From 6f7be5d1a41d356a9b558ac81722e959095ff04d Mon Sep 17 00:00:00 2001
> From: robert <robert_no.spam_m@yahoo.fr>
> 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);
When doest his happen?
Show 13 quoted lines
>  								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));
> +		}

Shawn, you removed the test from the code in 4a230ea1. Perhaps you could care to comment on this patch to restore the test, though slightly different.

		if (r.isAccessible())
			r.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, null);
-- robin
Previous: robert_no.spam_m@yahoo.frNext: Shawn O. Pearce
Message 2 of 5 in “avoiding output in the error log”
  1. avoiding output in the error logrobert_no.spam_m@yahoo.fr, Aug 27, 2008
  2. Robin RosenbergAug 27, 2008
  3. Shawn O. PearceAug 27, 2008
  4. Robin RosenbergAug 27, 2008
  5. Shawn O. PearceAug 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.