* [EGIT PATCH] Circument situations where Eclipse tries to decorate resources that do not exist
@ 2008-03-09 23:33 Robin Rosenberg
2008-03-10 23:40 ` Shawn O. Pearce
0 siblings, 1 reply; 2+ messages in thread
From: Robin Rosenberg @ 2008-03-09 23:33 UTC (permalink / raw)
To: git, Shawn O. Pearce
This happens when the workspace has not been refreshed properly, e.g.
when switching branches behind Eclipse's back.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../internal/decorators/GitResourceDecorator.java | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
This one seems hard to replicate though I think it shouldn't. Maybe Eclipse refereshes on demand
sometime and sometimes not. This stacktrace suggests this is the right thing to do.
java.lang.RuntimeException: Resource decorator failed to load tree contents on demand.
at org.spearce.egit.ui.internal.decorators.GitResourceDecorator.decorate(GitResourceDecorator.java:347)
at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:253)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:71)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:336)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:322)
at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:369)
at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:329)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/org.spearce.jgit/src/org/spearce/jgit/stgit' does not exist.
at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:310)
at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:193)
at org.eclipse.core.internal.resources.Resource.getSessionProperty(Resource.java:1079)
at org.spearce.egit.ui.internal.decorators.GitResourceDecorator.decorate(GitResourceDecorator.java:246)
... 9 more
-- robin
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 7eb008b..d0f9864 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
@@ -225,6 +225,13 @@ public class GitResourceDecorator extends LabelProvider implements
if (rsrc == null)
return;
+ // If the workspace has not been refreshed properly a resource might
+ // not actually exist, so we ignore these and do not decorate them
+ if (!rsrc.exists() && !rsrc.isPhantom()) {
+ Activator.trace("Tried to decorate non-existent resource "+rsrc);
+ return;
+ }
+
RepositoryMapping mapped = RepositoryMapping.getMapping(rsrc);
Activator.trace("decorate: " + element);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [EGIT PATCH] Circument situations where Eclipse tries to decorate resources that do not exist
2008-03-09 23:33 [EGIT PATCH] Circument situations where Eclipse tries to decorate resources that do not exist Robin Rosenberg
@ 2008-03-10 23:40 ` Shawn O. Pearce
0 siblings, 0 replies; 2+ messages in thread
From: Shawn O. Pearce @ 2008-03-10 23:40 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: git
Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> This happens when the workspace has not been refreshed properly, e.g.
> when switching branches behind Eclipse's back.
>
> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
> ---
> .../internal/decorators/GitResourceDecorator.java | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> This one seems hard to replicate though I think it shouldn't. Maybe Eclipse refereshes on demand
> sometime and sometimes not.
Yup. Earlier versions used to do a periodic refresh more often,
which really screwed up my Ant based build when Eclipse started
to _also_ build the same project to the same class folder at the
same time.
3.3.1.1 seems to not do this as often to me, and tends to wait for
a user-demanded refresh. But then every once in a while it just
starts building all of a sudden, which makes me think they still
are doing a periodic refresh. I don't know what is up with Eclipse.
And SWT is all about "we need access to the host native drawing APIs
to get good performance" but then Eclipse's resource system does
not appear to have filesystem monitors like inotify implemented for
the major OSes that Eclipse runs on. Yet another aspect I don't get.
Yea, yea, if it bothers me, write the patch and submit it to Eclipse.
I'm too busy working on Git support. I'll wait for someone else
to write it and submit it for me. They may be waiting for me to
finish Git support first. ;-)
> This stacktrace suggests this is the right thing to do.
Yea, I think so too. Sucks.
--
Shawn.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-10 23:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-09 23:33 [EGIT PATCH] Circument situations where Eclipse tries to decorate resources that do not exist Robin Rosenberg
2008-03-10 23:40 ` Shawn O. Pearce
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).