IndexOutOfBoundsException when switching tabs

Description

It seems to be a refresh/cache problem.

Produce bug:
Create any document with subtabs. In this example I use sales order:

Create new sales order
Create new sales order line.
Create new sales order again.
Move to new sales order.
Move to tab for sales order line (below exception occurs):

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at org.compiere.model.GridTable.getDataAtRow(GridTable.java:1031)
at org.compiere.model.GridTable.getDataAtRow(GridTable.java:1026)
at org.compiere.model.GridTable.getPO(GridTable.java:3725)
at org.compiere.model.GridTab.updateDataStatusEventProperties(GridTab.java:2359)
at org.compiere.model.GridTab.fireDataStatusChanged(GridTab.java:2338)
at org.compiere.model.GridTab.dataStatusChanged(GridTab.java:2316)
at org.compiere.model.GridTable.fireDataStatusChanged(GridTable.java:3200)
at org.compiere.model.GridTable.fireDataStatusIEvent(GridTable.java:3228)
at org.compiere.model.GridTable.dataRequery(GridTable.java:2891)
at org.compiere.model.GridTab.query(GridTab.java:746)
at org.compiere.grid.GridController.query(GridController.java:711)
at org.compiere.apps.APanel.stateChanged(APanel.java:1472)
at javax.swing.JTabbedPane.fireStateChanged(Unknown Source)
at javax.swing.JTabbedPane$ModelListener.stateChanged(Unknown Source)
at javax.swing.DefaultSingleSelectionModel.fireStateChanged(Unknown Source)
at javax.swing.DefaultSingleSelectionModel.setSelectedIndex(Unknown Source)
at javax.swing.JTabbedPane.setSelectedIndexImpl(Unknown Source)
at javax.swing.JTabbedPane.setSelectedIndex(Unknown Source)
at org.compiere.grid.VTabbedPane.setSelectedIndex(VTabbedPane.java:314)
at javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Environment

Windows, Swing, lastest tip as of 2012-juli-07

Activity

Show:
Heng Sin Low
July 9, 2012, 4:21 PM

reproduceable on zk web client too.

Heng Sin Low
July 9, 2012, 4:41 PM

Assignee

Heng Sin Low

Reporter

Daniel Tamm

Labels

Tested By

None

Time tracking

1h

Components

Fix versions

Affects versions

Priority

Major
Configure