This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 163549 - StackOverflowError in OrthogonalLayout.invokeLayout
Summary: StackOverflowError in OrthogonalLayout.invokeLayout
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@platform
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-24 08:37 UTC by ecerulm
Modified: 2010-04-01 14:48 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
graph file that works ok (561 bytes, text/plain)
2009-04-24 08:50 UTC, ecerulm
Details
graph file that gives a NullPointerException (769 bytes, text/plain)
2009-04-24 08:51 UTC, ecerulm
Details
NullPointerException stacktrace (3.50 KB, text/plain)
2009-04-24 08:57 UTC, ecerulm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ecerulm 2009-04-24 08:37:18 UTC
Using a OrthogonalLayout in a simple graph with 18 nodes and 39 edges gives a StackOverflowError exception. The 
stacktrace show that DirectionalGraph.computeLongestPathLength is being called recursively too many times. 

java.lang.StackOverflowError
        at java.util.HashMap$KeyIterator.<init>(HashMap.java:826)
        at java.util.HashMap$KeyIterator.<init>(HashMap.java:826)
        at java.util.HashMap.newKeyIterator(HashMap.java:840)
        at java.util.HashMap$KeySet.iterator(HashMap.java:874)
        at java.util.HashSet.iterator(HashSet.java:153)
        at 
org.netbeans.modules.visual.graph.layout.orthogonalsupport.DirectionalGraph.computeLongestPathLength(DirectionalGraph.ja
va:524)
        at 
org.netbeans.modules.visual.graph.layout.orthogonalsupport.DirectionalGraph.computeLongestPathLength(DirectionalGraph.ja
va:528)
        at 
org.netbeans.modules.visual.graph.layout.orthogonalsupport.DirectionalGraph.computeLongestPathLength(DirectionalGraph.ja
va:528)
        at 
org.netbeans.modules.visual.graph.layout.orthogonalsupport.DirectionalGraph.computeLongestPathLength(DirectionalGraph.ja
va:528)
Comment 1 ecerulm 2009-04-24 08:50:49 UTC
Created attachment 80820 [details]
graph file that works ok
Comment 2 ecerulm 2009-04-24 08:51:45 UTC
Created attachment 80821 [details]
graph file that gives a NullPointerException
Comment 3 ecerulm 2009-04-24 08:56:31 UTC
I can only get the StackOverflowError when using certain names for the LabelWidgets in the graph. If I change those 
names (but still the same graph structure)  to the ones in a.dot (see http://www.netbeans.org/nonav/issues/showattachment.cgi/80821/a.dot) then I get a NullPointerException instead 

java.lang.NullPointerException
        at org.netbeans.modules.visual.graph.layout.orthogonalsupport.GTPlanarizer.insertEdge(GTPlanarizer.java:857)
        at 
org.netbeans.modules.visual.graph.layout.orthogonalsupport.GTPlanarizer.insertRemainingEdges(GTPlanarizer.java:818)
        at 
org.netbeans.modules.visual.graph.layout.orthogonalsupport.GTPlanarizer.createPlanarSubgraphs(GTPlanarizer.java:138)
   
If I use c.dot (http://www.netbeans.org/nonav/issues/showattachment.cgi/80820/c.dot) that still have the same structure 
as a.dot then it works fine. 
Comment 4 ecerulm 2009-04-24 08:57:08 UTC
Created attachment 80823 [details]
NullPointerException stacktrace