IndexOutOfBoundsException Increasing beyond allowed Monster HD error

Description

I had a 3 HD Animal Base - Added three NPC Monster Levels - creature only allowed 5 HD total. I can't remove the offending level and seeing this error message in the console.
 
21:00:44.724 SEVERE AWT-EventQueue-1 PCGen_Frame1:2939 Uncaught error - ignoring
java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at pcgen.cdom.facet.LevelInfoFacet.get(LevelInfoFacet.java:66)
at pcgen.core.PlayerCharacter.getLevelInfo(PlayerCharacter.java:4314)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.getLevelInfo(CharacterLevelsFacadeImpl.java:265)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.getSpentSkillPoints(CharacterLevelsFacadeImpl.java:399)
at pcgen.gui2.tabs.SkillInfoTab$LevelSelectionHandler.updateSelectedIndex(SkillInfoTab.java:323)
at pcgen.gui2.tabs.SkillInfoTab$LevelSelectionHandler.elementRemoved(SkillInfoTab.java:349)
at pcgen.core.facade.util.AbstractListFacade.fireElementRemoved(AbstractListFacade.java:139)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.removeElement(CharacterLevelsFacadeImpl.java:131)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.removeLastLevel(CharacterLevelsFacadeImpl.java:738)
at pcgen.gui2.facade.CharacterFacadeImpl.removeCharacterLevels(CharacterFacadeImpl.java:731)
at pcgen.gui2.tabs.summary.ClassLevelTableModel$Editor.actionPerformed(ClassLevelTableModel.java:326)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6288)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at javax.swing.plaf.basic.BasicTableUI$Handler.repostEvent(BasicTableUI.java:918)
at javax.swing.plaf.basic.BasicTableUI$Handler.mouseReleased(BasicTableUI.java:1134)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
at java.awt.Component.processMouseEvent(Component.java:6288)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at pcgen.gui.PCGen_Frame1$WaitCursorEventQueue.dispatchEvent(PCGen_Frame1.java:2934)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Environment

PCGen 5.17.12-Dev Build '16420'

Activity

Show:
Tom Parker
March 18, 2012, 4:22 PM

Looks like PlayerCharacter.incrementClassLevel needs to return true/false for whether it was successful so that the new UI can keep its own level in sync with that success/failure.

James Dempsey
March 18, 2012, 7:12 PM

If the level up fails then the UI no longer tries to add in the new level information.

Fixed

Assignee

James Dempsey

Reporter

Andrew Maitland

Labels

None

Theme

None

Epic/Theme

None

Pending User Input

None

Components

Fix versions

Affects versions

Priority

Minor
Configure