[sip-comm-dev] Array bounds exception


#1

Dear all,

sometimes SC shows an exception during startup phase (see below).

To me this seems a thread problem (parallel access to same data) because the
the checks and the usage in "expandRow()" are ok. The "run()" method listed
in the stack trace is the culprit IMHO:

It deals with the treeModel but synchronizes access only for a small amount
of time and then schedules a Swing.invokeLater() to refresh the rows. During
this time some other thread may access the treeModel and JTree and perform
actions while JTree is in the process of updating. Can somebody surround
the statements in run() with "synchronize(tempTreeModel)" and check if this
may solve the problem?.

Regards,
Werner

Console listing:

     [java] 19:43:15.650 SCHWERWIEGEND: util.UtilActivator.uncaughtException().76 An uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main] and
message was: 3 > 2
     [java] java.lang.ArrayIndexOutOfBoundsException: 3 > 2
     [java] at java.util.Vector.insertElementAt(Vector.java:571)
     [java] at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1520)
     [java] at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1287)
     [java] at javax.swing.tree.VariableHeightLayoutCache.ensurePathIsExpanded(VariableHeightLayoutCache.java:983)
     [java] at javax.swing.tree.VariableHeightLayoutCache.setExpandedState(VariableHeightLayoutCache.java:181)
     [java] at javax.swing.plaf.basic.BasicTreeUI.updateExpandedDescendants(BasicTreeUI.java:1672)
     [java] at javax.swing.plaf.basic.BasicTreeUI$Handler.treeExpanded(BasicTreeUI.java:3753)
     [java] at javax.swing.JTree.fireTreeExpanded(JTree.java:2662)
     [java] at javax.swing.JTree.setExpandedState(JTree.java:3433)
     [java] at javax.swing.JTree.expandPath(JTree.java:2171)
     [java] at javax.swing.JTree.expandRow(JTree.java:2186)
     [java] at net.java.sip.communicator.impl.gui.main.contactlist.TreeContactList.expandAllRows(TreeContactList.java:1101)
     [java] at net.java.sip.communicator.impl.gui.main.contactlist.TreeContactList.access$800(TreeContactList.java:31)
     [java] at net.java.sip.communicator.impl.gui.main.contactlist.TreeContactList$12.run(TreeContactList.java:958)
     [java] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
     [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:602)
     [java] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
     [java] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
     [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
     [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
     [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
     [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hi Werner,

As I mentioned in a previous mail, I've made quite a few changes in the contact list during last two weeks, so I hope this ArrayIndexOutOfBoundsException would disappear now (r7152). Should you still experience it though, don't hesitate to ping me or file an issue.

Thanks for the report and sorry for the lag on this one.

Cheers,
Yana

···

On May 2, 2010, at 1:02 PM, Werner Dittmann wrote:

Dear all,

sometimes SC shows an exception during startup phase (see below).

To me this seems a thread problem (parallel access to same data) because the
the checks and the usage in "expandRow()" are ok. The "run()" method listed
in the stack trace is the culprit IMHO:

It deals with the treeModel but synchronizes access only for a small amount
of time and then schedules a Swing.invokeLater() to refresh the rows. During
this time some other thread may access the treeModel and JTree and perform
actions while JTree is in the process of updating. Can somebody surround
the statements in run() with "synchronize(tempTreeModel)" and check if this
may solve the problem?.

Regards,
Werner

Console listing:

    [java] 19:43:15.650 SCHWERWIEGEND: util.UtilActivator.uncaughtException().76 An uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main] and
message was: 3 > 2
    [java] java.lang.ArrayIndexOutOfBoundsException: 3 > 2
    [java] at java.util.Vector.insertElementAt(Vector.java:571)
    [java] at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1520)
    [java] at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1287)
    [java] at javax.swing.tree.VariableHeightLayoutCache.ensurePathIsExpanded(VariableHeightLayoutCache.java:983)
    [java] at javax.swing.tree.VariableHeightLayoutCache.setExpandedState(VariableHeightLayoutCache.java:181)
    [java] at javax.swing.plaf.basic.BasicTreeUI.updateExpandedDescendants(BasicTreeUI.java:1672)
    [java] at javax.swing.plaf.basic.BasicTreeUI$Handler.treeExpanded(BasicTreeUI.java:3753)
    [java] at javax.swing.JTree.fireTreeExpanded(JTree.java:2662)
    [java] at javax.swing.JTree.setExpandedState(JTree.java:3433)
    [java] at javax.swing.JTree.expandPath(JTree.java:2171)
    [java] at javax.swing.JTree.expandRow(JTree.java:2186)
    [java] at net.java.sip.communicator.impl.gui.main.contactlist.TreeContactList.expandAllRows(TreeContactList.java:1101)
    [java] at net.java.sip.communicator.impl.gui.main.contactlist.TreeContactList.access$800(TreeContactList.java:31)
    [java] at net.java.sip.communicator.impl.gui.main.contactlist.TreeContactList$12.run(TreeContactList.java:958)
    [java] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
    [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:602)
    [java] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
    [java] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
    [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
    [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net