elk icon indicating copy to clipboard operation
elk copied to clipboard

Plain java hierarchical layout yields NPE in HierPortPosProcessor

Open uruuru opened this issue 5 years ago • 3 comments

It already seems to be fixed for 0.7.0 (at least it works for me with the snapshots), but for the record:

All hierarchical json models yield the NPE seen below. E.g.

../elk-models/realworld/ptolemy/hierarchical/algebraic_heateropentank_HeaterOpenTank.json

Layout is performed like so:

LayoutMetaDataService service = LayoutMetaDataService.getInstance();
service.registerLayoutMetaDataProviders(new LayeredMetaDataProvider());        
final ElkNode elkGraph = ElkGraphJson.forGraph(graph).toElk();
final RecursiveGraphLayoutEngine engine = new RecursiveGraphLayoutEngine();
engine.layout(elkGraph, new NullElkProgressMonitor());
java.lang.NullPointerException
        at org.eclipse.elk.alg.layered.intermediate.HierarchicalPortPositionProcessor.fixCoordinates(HierarchicalPortPositionProcessor.java:120)
        at org.eclipse.elk.alg.layered.intermediate.HierarchicalPortPositionProcessor.process(HierarchicalPortPositionProcessor.java:72)
        at org.eclipse.elk.alg.layered.intermediate.HierarchicalPortPositionProcessor.process(HierarchicalPortPositionProcessor.java:1)
        at org.eclipse.elk.alg.layered.ElkLayered.layout(ElkLayered.java:593)
        at org.eclipse.elk.alg.layered.ElkLayered.doLayout(ElkLayered.java:143)
        at org.eclipse.elk.alg.layered.LayeredLayoutProvider.layout(LayeredLayoutProvider.java:56)
        at org.eclipse.elk.core.RecursiveGraphLayoutEngine.executeAlgorithm(RecursiveGraphLayoutEngine.java:247)
        at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layoutRecursively(RecursiveGraphLayoutEngine.java:215)
        at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layoutRecursively(RecursiveGraphLayoutEngine.java:197)
        at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layoutRecursively(RecursiveGraphLayoutEngine.java:197)
        at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layout(RecursiveGraphLayoutEngine.java:93)
        at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layout(RecursiveGraphLayoutEngine.java:71)
        at ElkSpeed.main(ElkSpeed.java:41)

@le-cds any idea which ticket could have solved this?

uruuru avatar Jul 22 '20 17:07 uruuru

@le-cds any idea which ticket could have solved this?

Perhaps the orthogonal edge router refactoring, but I'm really not sure.

le-cds avatar Jul 30 '20 08:07 le-cds

I feel it was only the case for the plain Java layout, which confuses me even more.

uruuru avatar Jul 30 '20 09:07 uruuru

It still does no longer occur and I also don't know why it is fixed.

soerendomroes avatar Mar 15 '22 08:03 soerendomroes