Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in LayerSweepTypeDecider #1084

Open
alexanderpann opened this issue Oct 31, 2024 · 2 comments
Open

NullPointerException in LayerSweepTypeDecider #1084

alexanderpann opened this issue Oct 31, 2024 · 2 comments
Labels
bug Erroneous behaviour.

Comments

@alexanderpann
Copy link

Unfortunately, I can share any reproducible example. I use ELK Layered, the offending option is hierarchy handling which is set to INCLUDE_CHILDREN. With SEPARATE_CHILDREN everything works. I think the diagram also has subdiagrams. This option is set a the root diagram level, no other direct layer options are set. Setting crossing minimization strategy to none to disable the layered sweeping didn't help, it seems to be a general problem. Any ideas how this can happen?

java.lang.NullPointerException: Cannot read field "id" because the return value of "org.eclipse.elk.alg.layered.graph.LNode.getLayer()" is null
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.p3order.LayerSweepTypeDecider.nodeInfoFor(LayerSweepTypeDecider.java:216)
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.p3order.LayerSweepTypeDecider.transferInfoTo(LayerSweepTypeDecider.java:145)
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.p3order.LayerSweepTypeDecider.useBottomUp(LayerSweepTypeDecider.java:113)
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.p3order.GraphInfoHolder.<init>(GraphInfoHolder.java:117)
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.initialize(LayerSweepCrossingMinimizer.java:604)
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.process(LayerSweepCrossingMinimizer.java:122)
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.process(LayerSweepCrossingMinimizer.java:1)
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.ElkLayered.hierarchicalLayout(ElkLayered.java:269)
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.ElkLayered.doCompoundLayout(ElkLayered.java:186)
at d.i.m.e.diagram.runtime//org.eclipse.elk.alg.layered.LayeredLayoutProvider.layout(LayeredLayoutProvider.java:53)
at d.i.m.e.diagram.runtime//org.eclipse.elk.core.RecursiveGraphLayoutEngine.executeAlgorithm(RecursiveGraphLayoutEngine.java:443)
at d.i.m.e.diagram.runtime//org.eclipse.elk.core.RecursiveGraphLayoutEngine.layoutRecursively(RecursiveGraphLayoutEngine.java:410)
at d.i.m.e.diagram.runtime//org.eclipse.elk.core.RecursiveGraphLayoutEngine.layout(RecursiveGraphLayoutEngine.java:104)
at d.i.m.e.diagram.runtime//org.eclipse.elk.core.RecursiveGraphLayoutEngine.layout(RecursiveGraphLayoutEngine.java:80)
at d.i.m.e.diagram.runtime//de.itemis.mps.editor.diagram.runtime.jgraph.ElkLayouter.layoutOnce(ElkLayouter.java:301)
at d.i.m.e.diagram.runtime//de.itemis.mps.editor.diagram.runtime.jgraph.ElkLayouter.layout(ElkLayouter.java:254)
@alexanderpann alexanderpann added the bug Erroneous behaviour. label Oct 31, 2024
@soerendomroes
Copy link
Contributor

Could you provide me with an example graph in elklive?

This might happen since the greedy switch heuristic also calls the layer sweep. But I cannot say for sure since I do not have an example to debug.

@soerendomroes
Copy link
Contributor

Unfortunately, I can share any reproducible example.

Oh my bad, this is probably a typo and you cannot share your model. Should you list the layout options that you set? Some are not made to be used together with INCLUDE_CHILDREN. Especially everything that somehow influences order other than portConstraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Erroneous behaviour.
Projects
None yet
Development

No branches or pull requests

2 participants