Community
Participate
Working Groups
I'm getting the following exception. I'm not 100% sure that there isn't an issue with the backing model, but as I am using IGraphContentProvider I'm not really sure what if anything could end up creating a situation where the following occurs: Daemon Thread [Thread-0] (Suspended (exception NullPointerException)) TreeLayoutObserver$TreeNode.isBetterParent(TreeLayoutObserver$TreeNode) line: 262 TreeLayoutObserver$TreeNode.findNewParent() line: 236 TreeLayoutObserver$1.connectionRemoved(LayoutContext, ConnectionLayout) line: 365 InternalLayoutContext.fireConnectionRemovedEvent(ConnectionLayout) line: 444 Graph.removeConnection(GraphConnection) line: 936 GraphConnection.setCurveDepth(int) line: 476 GraphModelFactory(AbstractStylingModelFactory).adjustCurves(List, int) line: 99 GraphModelFactory(AbstractStylingModelFactory).styleConnection(GraphConnection) line: 75 GraphModelFactory(AbstractStylingModelFactory).styleItem(GraphItem) line: 123 GraphModelFactory(AbstractStylingModelFactory).createConnection(Graph, Object, Object, Object) line: 182 GraphModelFactory.doBuildGraph(Graph) line: 105 GraphModelFactory.createGraphModel(Graph) line: 43 ButterGraphViewer(AbstractStructuredGraphViewer).inputChanged(Object, Object) line: 516 ButterGraphViewer(GraphViewer).inputChanged(Object, Object) line: 127 ButterGraphViewer(ContentViewer).setInput(Object) line: 280 ButterGraphViewer(StructuredViewer).setInput(Object) line: 1669 ButterGraphViewPart$1$2.selectionChanged(IWorkbenchPart, ISelection) line: 123 WindowSelectionService(AbstractSelectionService).fireSelection(IWorkbenchPart, ISelection) line: 156 AbstractSelectionService$1.selectionChanged(SelectionChangedEvent) line: 62 ...
[This is with 2.0 -- as there aren't version #s for Zest.]
One hint from that stack trace is that it occurs with either multiple connections between nodes or nodes connected to themselves (since a recent change such connections are curved, see bug 190223). I've added some null checks in TreeLayoutObserver that I think make sense in any case. I don't really know how these items could be null in such a case though, so if this doesn't fix your issue, it would be great if you could attach a snippet that causes this exception.
(In reply to comment #2) > One hint from that stack trace is that it occurs with either multiple > connections between nodes or nodes connected to themselves (since a recent > change such connections are curved, see bug 190223). I've added some null > checks in TreeLayoutObserver that I think make sense in any case. I don't > really know how these items could be null in such a case though, so if this > doesn't fix your issue, it would be great if you could attach a snippet that > causes this exception. That makes sense, it was coming up when I had two directed nodes connected to each other. Now that my model doesn't I don't see this error anymore. I'll keep an eye on it in any case. I'm using the version from git so I'll have any changes as they are made.
With the new null checks it might now work for your previous model as well. For me it worked with multiple connections even before, e.g. in [1]. If you confirm it works for you with multiple connections I'll resolve as fixed. [1] http://git.eclipse.org/c/gef/org.eclipse.zest.git/tree/org.eclipse.zest.examples/src/org/eclipse/zest/examples/jface/GraphJFaceSnippet8.java
Resolving as FIXED because of Fabian's last comment (and because there has been no reaction to this for more than 3 years). Please re-open in case this is still an issue.
Ups, forgot to actually change state...