Bug - Fixed Exception when calling maximizer() from ASH

xKiv

Active member
Code:
Unexpected error, debug log printed.
class java.lang.ArrayIndexOutOfBoundsException: 16
java.lang.ArrayIndexOutOfBoundsException: 16
        at net.sourceforge.kolmafia.maximizer.Maximizer.emitSlot(Maximizer.java:786)
        at net.sourceforge.kolmafia.maximizer.Maximizer.maximize(Maximizer.java:191)
        at net.sourceforge.kolmafia.maximizer.Maximizer.maximize(Maximizer.java:108)
        at net.sourceforge.kolmafia.textui.RuntimeLibrary.maximize(RuntimeLibrary.java:4824)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:106)
        at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:154)
        at net.sourceforge.kolmafia.textui.parsetree.ForEachLoop.execute(ForEachLoop.java:100)
        at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:465)
        at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:152)
        at net.sourceforge.kolmafia.textui.Interpreter.executeScope(Interpreter.java:375)
        at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:299)
        at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:292)
        at net.sourceforge.kolmafia.textui.command.CallScriptCommand.call(CallScriptCommand.java:251)
        at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:605)
        at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:548)
        at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:449)
        at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:317)
        at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:190)
        at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:164)

Maximizer.maximize is iterating until ALL_SLOTS (20), but EquipmentRequest.slotNames only goes to 16 names (index 15).
 

slyz

Developer
I fixed that in r12827.

I probably barged in the middle of the implementation of the Folder Holder, so things might change.
 
Top