-
Notifications
You must be signed in to change notification settings - Fork 866
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
Fix infinite loop in FruchtermanReingoldLayout. #8217
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.