#12 Exception in thread "AWT-EventQueue-0"

已关闭
kolja7 年之前创建 · 3 条评论
这个人很懒,什么都没留下。
Eren B. Yilmaz 评论于 7 年之前
所有者

it is a race condition caused by iterating through the lines in the pseudo code tree backwards. the vector somehow gets smaller and in the first iteration the index is out of bound.

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 36 >= 34
	at java.util.Vector.elementAt(Vector.java:474)
	at javax.swing.tree.VariableHeightLayoutCache.getNode(VariableHeightLayoutCache.java:994)
	at javax.swing.tree.VariableHeightLayoutCache.getMaxNodeWidth(VariableHeightLayoutCache.java:1007)
	at javax.swing.tree.VariableHeightLayoutCache.getPreferredWidth(VariableHeightLayoutCache.java:309)
	at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTreeUI.java:1900)
	at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:2003)
	at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:1991)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1662)
	at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:791)
	at java.awt.Container.layout(Container.java:1510)
	at java.awt.Container.doLayout(Container.java:1499)
	at java.awt.Container.validateTree(Container.java:1695)
	at java.awt.Container.validate(Container.java:1630)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:711)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:708)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1731)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
it is a race condition caused by iterating through the lines in the pseudo code tree backwards. the vector somehow gets smaller and in the first iteration the index is out of bound. ``` Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 36 >= 34 at java.util.Vector.elementAt(Vector.java:474) at javax.swing.tree.VariableHeightLayoutCache.getNode(VariableHeightLayoutCache.java:994) at javax.swing.tree.VariableHeightLayoutCache.getMaxNodeWidth(VariableHeightLayoutCache.java:1007) at javax.swing.tree.VariableHeightLayoutCache.getPreferredWidth(VariableHeightLayoutCache.java:309) at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTreeUI.java:1900) at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:2003) at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:1991) at javax.swing.JComponent.getPreferredSize(JComponent.java:1662) at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:791) at java.awt.Container.layout(Container.java:1510) at java.awt.Container.doLayout(Container.java:1499) at java.awt.Container.validateTree(Container.java:1695) at java.awt.Container.validate(Container.java:1630) at javax.swing.RepaintManager$3.run(RepaintManager.java:711) at javax.swing.RepaintManager$3.run(RepaintManager.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:708) at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1731) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) ```
Eren B. Yilmaz 评论于 7 年之前
所有者
I recommend reading https://stackoverflow.com/questions/18311972/swing-thread-safe-programming
Kolja Strohm 评论于 7 年之前
所有者

Im BetterStructure Branch wurde eine Änderung durchgeführt, welche das Problem beheben sollte. Es muss aber noch ausführlich getestet werden. Siehe 3847267d08 für mehr Details.

Im BetterStructure Branch wurde eine Änderung durchgeführt, welche das Problem beheben sollte. Es muss aber noch ausführlich getestet werden. Siehe https://koljastrohm-games.com:3000/GraphDrawer/NodeShuffler/commit/3847267d087ea670fe35f5b38cf50aebd26ee153 für mehr Details.
eren7 年之前 关闭
登录 并参与到对话中。
未选择里程碑
未指派成员
2 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。