Exception when deleting a module object - Bug:1866161

I’ve seen this one a few times; Happens when deleting objects (Pieces or Panels etc.) in a module opened for editing.

-- OS Windows Vista -- Java version 1.6.0_03 -- VASSAL version 3.0.15 -- Talavera & Vimeiro version 0.5 java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.Vector.elementAt(Unknown Source) at javax.swing.JTabbedPane.getTitleAt(Unknown Source) at javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.componentAdded(Unknown Source) at java.awt.Container.processContainerEvent(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.Container.addImpl(Unknown Source) at javax.swing.JTabbedPane.setComponentAt(Unknown Source) at VASSAL.build.widget.TabWidget.stateChanged(TabWidget.java:53) at javax.swing.JTabbedPane.fireStateChanged(Unknown Source) at javax.swing.JTabbedPane.removeTabAt(Unknown Source) at javax.swing.JTabbedPane.remove(Unknown Source) at java.awt.Container.addImpl(Unknown Source) at javax.swing.JTabbedPane.setComponentAt(Unknown Source) at VASSAL.build.widget.TabWidget.stateChanged(TabWidget.java:53) at javax.swing.JTabbedPane.fireStateChanged(Unknown Source) at javax.swing.JTabbedPane.removeTabAt(Unknown Source) at VASSAL.build.widget.TabWidget.remove(TabWidget.java:80) at VASSAL.configure.ConfigureTree.remove(ConfigureTree.java:562) at VASSAL.configure.ConfigureTree$8.actionPerformed(ConfigureTree.java:513) at VASSAL.configure.ConfigureTree.doKeyAction(ConfigureTree.java:857) at VASSAL.configure.ConfigureTree$KeyAction.actionPerformed(ConfigureTree.java:175) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Actions.actionPerformed(Unknown Source) at javax.swing.SwingUtilities.notifyAction(Unknown Source) at javax.swing.JComponent.processKeyBinding(Unknown Source) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source) at javax.swing.JMenuBar.processKeyBinding(Unknown Source) at javax.swing.KeyboardManager.fireBinding(Unknown Source) at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source) at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source) at javax.swing.JComponent.processKeyBindings(Unknown Source) at javax.swing.JComponent.processKeyEvent(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.KeyboardFocusManager.redispatchEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(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.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) java.lang.IndexOutOfBoundsException: Index: 0, Tab count: 0 at javax.swing.JTabbedPane.checkIndex(Unknown Source) at javax.swing.JTabbedPane.removeTabAt(Unknown Source) at VASSAL.build.widget.TabWidget.remove(TabWidget.java:80) at VASSAL.configure.ConfigureTree.remove(ConfigureTree.java:562) at VASSAL.configure.ConfigureTree$8.actionPerformed(ConfigureTree.java:513) at VASSAL.configure.ConfigureTree.doKeyAction(ConfigureTree.java:857) at VASSAL.configure.ConfigureTree$KeyAction.actionPerformed(ConfigureTree.java:175) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Actions.actionPerformed(Unknown Source) at javax.swing.SwingUtilities.notifyAction(Unknown Source) at javax.swing.JComponent.processKeyBinding(Unknown Source) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source) at javax.swing.JMenuBar.processKeyBinding(Unknown Source) at javax.swing.KeyboardManager.fireBinding(Unknown Source) at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source) at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source) at javax.swing.JComponent.processKeyBindings(Unknown Source) at javax.swing.JComponent.processKeyEvent(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.KeyboardFocusManager.redispatchEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(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.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)

Encountered this, too. Deleting the entries in the build file helped, but always error messages when deleting in the editor.

To re-produce, open this module for editing.

Then Delete ->[Game Piece Palette]->Pieces->Talavera[Panel]

I’ve noticed this when deleting the only(or final ) file in a menu. I usually get around it by adding my new topic in the menu, moving it to 1st position and then deleting. If that isn’t applicable, sometimes I just delete the whole menu and re-enter the menu.

I think I’ve fixed this bug in 2860:

nomic.net/~uckelman/tmp/vass … vn2860.zip

We weren’t removing the change listener from the JTabbedPane before
removing the tab, so the change listener was called by removeTabAt()
and received a bogus index.

BTW, I’ve noticed another odd behavior here, namely that if you
create a panel as a tab and type in the name, it picks up the first
one or two letters in the actual tab title, but then no more. Odd.

Joel you may want to check with Brent, I think he has also resolved this. In the merge thread he said:

"Hi Joel, Rodney,

Have also killed the Deleting Basic Piece bug in swampwallaby-merge@2856

Regards,
Brent."

No, these are two different issues.

Brent.