cdrchops / gbui

Automatically exported from code.google.com/p/gbui
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Set selection on BList will throw an index out of bounds exception on the first time being set. #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. programatically, add items into the list
2. select any item in the lest using BList.setSelection(value)

What is the expected output? What do you see instead?
[SUCCESS] Should set the selection
[FAILURE] Throws an exception

Please use labels and text to provide additional information.

SEVERE: Exception
java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.get(Unknown Source)
    at com.jmex.bui.BList.setSelectedValue(BList.java:121)
    at 
com.aether.gbui.operators.BListOperator.select(BListOperator.java:22)
    at com.aether.present.JournalPage$2.call(JournalPage.java:44)
    at com.jme.util.GameTask.invoke(GameTask.java:140)
    at com.jme.util.GameTaskQueue.execute(GameTaskQueue.java:111)
    at com.jmex.game.StandardGame.update(StandardGame.java:378)
    at com.jmex.game.StandardGame.run(StandardGame.java:250)
    at java.lang.Thread.run(Unknown Source)

Original issue reported on code.google.com by Captain....@gmail.com on 2 Dec 2009 at 10:44

GoogleCodeExporter commented 9 years ago
this problem has been resolved.  Checks first if a selection had already been 
made, 
then changes the value.

Original comment by Captain....@gmail.com on 5 Dec 2009 at 8:32