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

NPE when using MERGE_EDGES and self loops #382

Closed
dhuebner opened this issue Nov 6, 2018 · 5 comments
Closed

NPE when using MERGE_EDGES and self loops #382

dhuebner opened this issue Nov 6, 2018 · 5 comments
Assignees
Labels
alg-layered Affects the ELK Layered algorithm. bug Erroneous behaviour.
Milestone

Comments

@dhuebner
Copy link

dhuebner commented Nov 6, 2018

Version: 0.5.0-Snapshot
Layout: Layered

Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.elk.alg.layered.p5edges.loops.calculators.SelfLoopComponentDependencyGraphCalculator.calculateEdgeOrder(SelfLoopComponentDependencyGraphCalculator.java:242)
	at org.eclipse.elk.alg.layered.p5edges.loops.calculators.SelfLoopComponentDependencyGraphCalculator.calculateEdgeOrder(SelfLoopComponentDependencyGraphCalculator.java:302)
	at org.eclipse.elk.alg.layered.p5edges.loops.calculators.SelfLoopComponentDependencyGraphCalculator.calculateEdgeDependecies(SelfLoopComponentDependencyGraphCalculator.java:200)
	at org.eclipse.elk.alg.layered.intermediate.SelfLoopPlacer.process(SelfLoopPlacer.java:85)
	at org.eclipse.elk.alg.layered.intermediate.SelfLoopPlacer.process(SelfLoopPlacer.java:1)
	at org.eclipse.elk.alg.layered.ElkLayered.layout(ElkLayered.java:600)
	at org.eclipse.elk.alg.layered.ElkLayered.doLayout(ElkLayered.java:144)
	at org.eclipse.elk.alg.layered.LayeredLayoutProvider.layout(LayeredLayoutProvider.java:58)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.executeAlgorithm(RecursiveGraphLayoutEngine.java:248)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layoutRecursively(RecursiveGraphLayoutEngine.java:216)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layout(RecursiveGraphLayoutEngine.java:94)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layout(RecursiveGraphLayoutEngine.java:72)
....
@spoenemann spoenemann added the bug Erroneous behaviour. label Nov 8, 2018
@uruuru
Copy link
Contributor

uruuru commented Nov 8, 2018

That's in the new self loop code. @le-cds, any ideas?

Maybe an unassigned port side:

 if (targetPort.getPortSide() != side && targetIndexAllPorts < portIndex) {

@dhuebner can you share a graph to reproduce the problem or at least give a hint regarding the graph's structure?

@le-cds le-cds added this to the Release 0.5.0 milestone Dec 10, 2018
@le-cds
Copy link
Contributor

le-cds commented Dec 10, 2018

A simple graph that reproduces this issue would indeed be helpful. :)

@le-cds le-cds modified the milestones: Release 0.5.0, Release 0.6.0 Feb 20, 2019
@lredor
Copy link
Contributor

lredor commented May 15, 2019

I have a reproduction case for this NPE (or at least with a similar stack). I tried to minimize my case. The graph, without layout, is like this:
Sample With NPE

Steps to reproduce:

  • Import the graph file "Sample With NPE.elkg" in your workspace from Sample With NPE.zip
  • Open the Layout Graph view
  • Load the graph file in this view
  • Result: The following NPE is thrown:
java.lang.NullPointerException
	at org.eclipse.elk.alg.layered.p5edges.loops.calculators.SelfLoopComponentDependencyGraphCalculator.calculateEdgeOrder(SelfLoopComponentDependencyGraphCalculator.java:242)
	at org.eclipse.elk.alg.layered.p5edges.loops.calculators.SelfLoopComponentDependencyGraphCalculator.calculateEdgeDependecies(SelfLoopComponentDependencyGraphCalculator.java:200)
	at org.eclipse.elk.alg.layered.intermediate.SelfLoopPlacer.process(SelfLoopPlacer.java:85)
	at org.eclipse.elk.alg.layered.intermediate.SelfLoopPlacer.process(SelfLoopPlacer.java:1)
	at org.eclipse.elk.alg.layered.ElkLayered.hierarchicalLayout(ElkLayered.java:244)
	at org.eclipse.elk.alg.layered.ElkLayered.doCompoundLayout(ElkLayered.java:186)
	at org.eclipse.elk.alg.layered.LayeredLayoutProvider.layout(LayeredLayoutProvider.java:54)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.executeAlgorithm(RecursiveGraphLayoutEngine.java:248)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layoutRecursively(RecursiveGraphLayoutEngine.java:216)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layout(RecursiveGraphLayoutEngine.java:94)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layout(RecursiveGraphLayoutEngine.java:72)
	at org.eclipse.elk.core.debug.views.graph.LoadGraphAction.layout(LoadGraphAction.java:98)
	at org.eclipse.elk.core.debug.views.graph.LoadGraphAction.run(LoadGraphAction.java:81)
	...

@spoenemann
Copy link
Member

This might have been fixed in the meantime, see #417 (comment)

@le-cds le-cds added the alg-layered Affects the ELK Layered algorithm. label Jul 30, 2019
@le-cds
Copy link
Contributor

le-cds commented Aug 8, 2019

@lredor thanks for the test case. The exception is not thrown anymore. :)

@le-cds le-cds closed this as completed Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alg-layered Affects the ELK Layered algorithm. bug Erroneous behaviour.
Projects
None yet
Development

No branches or pull requests

5 participants