Fix infinite loop in FruchtermanReingoldLayout.#8217
Fix infinite loop in FruchtermanReingoldLayout.#8217ebarboni merged 1 commit intoapache:deliveryfrom
Conversation
Fixes GH8209 - infinite loop because isThereFreeSpaceNonFixedSpace always returns false. Only loop ~3 rotations. Increase force constant to improve result with reduced search.
java/java.graph/src/org/netbeans/modules/java/graph/FruchtermanReingoldLayout.java
Show resolved
Hide resolved
java/java.graph/src/org/netbeans/modules/java/graph/FruchtermanReingoldLayout.java
Show resolved
Hide resolved
|
@neilcsmith-net those issues can be likely closed with this PR although the complete fix would also include to not do this on EDT - but this goes beyond a hotix |
That's unfortunately akin to trying to run a Swing layout off of the EDT. Might be OK to wrap in something like https://bits.netbeans.org/24/javadoc/org-netbeans-api-progress/org/netbeans/api/progress/BaseProgressUtils.html#runOffEventDispatchThread-java.lang.Runnable-java.lang.String-java.util.concurrent.atomic.AtomicBoolean-boolean-int-int- |
yeah this shouldn't be done, the hope is that something in the computation can be detached from swing but I haven't looked into it so far. To get an idea I would:
if nothing helps or would make things too complicated I would:
|
Quick fix for #8209 - an infinite loop with large dependency tree because
isThereFreeSpaceNonFixedSpace()never returnstrue.Only loop ~3 rotations. Increased force constant seems to improve result with reduced search.