Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
AW: [geclipse-dev] Dissapearing workspace in grid project

Hi Ariel, All,

> i now debugged it, the problem is that "thanks" to the NPE the
execution
> is 
> jumping "up" in the stack to line 153  (catch (Throwable) {} block) of

>    ResourceGridContainer.fetchChildren(...)

This brings me back to a well known problem described in Bug #209160. So
a short summary of all these problems would be that when
GridModel.getRoot() is called the first time, all persistent elements of
the model tree (all those contained in containers that are not lazy) are
initially loaded. This has two drawbacks:

1) If an exception occurs within this procedure the model tree is not
build up and the workspace is empty.
2) If an element creator directly or indirectly calls
GridModel.getRoot() we end up in an endless loop.

So the solution to all these problems would be to decouple the initial
model build from the ResourceGridContainer's constructor. In the last
few days I tried to solve this problem with two different approaches:

1) Create a new Thread in the ResourceGridContainer's constructor that
cares about the child loading.
2) Load the children of a ResourceGridContainer on demand, i.e. when a
method relying on the children (e.g. getChildren(), getChildCount(),
contains()), is called the first time.

Both methods are working in principle but both also have drawbacks. For
method 1 the drawback is that the project view is empty at startup and
gets populated as soon as the threads get a chance to execute. The
drawback of method 2 is that one has very carefully to decide which
access methods should trigger the loading of the container's children.
Doing there something wrong may in the best case have strange side
effects and in the worst case end up in a totally messed up workspace or
an again empty model.

So comments on this are highly welcome. Everybody who has suggestions is
invited to contribute to bug #209160.

Cheers, Mathias


Back to the top