Debug logs and hunting down issues.

So, I have a few debug logs. They come from account running very big scripts. I'd like to fix them, but the errors appear at random, and I have no idea how to force them to show up.
Code:
Unexpected error, debug log printed.
class java.lang.IndexOutOfBoundsException: Index: 5, Size: 3
java.lang.IndexOutOfBoundsException: Index: 5, Size: 3
	at java.util.ArrayList.rangeCheck(Unknown Source)
	at java.util.ArrayList.remove(Unknown Source)
	at net.sourceforge.kolmafia.textui.parsetree.ForEachLoop.executeSlice(ForEachLoop.java:201)
...
I'm guessing it'll be in a foreach, but... I have no idea what would cause an Unexpected Error and not just... a regular ol' expected error. And what mafia functions point to ArrayList.remove?
Also, this one:
Code:
Unexpected error, debug log printed.
class java.lang.ClassCastException: net.sourceforge.kolmafia.textui.parsetree.Value cannot be cast to net.sourceforge.kolmafia.textui.parsetree.CompositeValue
java.lang.ClassCastException: net.sourceforge.kolmafia.textui.parsetree.Value cannot be cast to net.sourceforge.kolmafia.textui.parsetree.CompositeValue
	at net.sourceforge.kolmafia.textui.parsetree.CompositeReference.getSlice(CompositeReference.java:112)
	at net.sourceforge.kolmafia.textui.parsetree.CompositeReference.setValue(CompositeReference.java:211)
	at net.sourceforge.kolmafia.textui.parsetree.Assignment.execute(Assignment.java:121)
...
I don't even know what that error means.

So, yeah, any help with deciphering this so I'd at least know what to look for would be awesome. Thank you.
 
Okay, so I found the ASH errors to go with these, but they don't make ANY SENSE at all.
The index error is the middle line here:
Code:
 boolean acceptall=true;
 matcher appcheck=create_matcher("y <b>(\\d+)</b> p", visit_url("clan_office.php"));	
 if((appcheck.find())&&(acceptall)){
Can't help but notice a distinct lack of anything array-like. The error isn't even on the find() statement... it's in the creation itself. So... confused.

And the typecast issue is this pretty line here:
Code:
 doubleRun[cmd]=!doubleRun[cmd];
 if(doubleRun[cmd])return;
 switch(cmd){
doubleRun is of type boolean[string] and cmd is string.
The assignment works just fine... but it crashes when with a weird error on the if statement!?
Any ideas what's going on under the hood?
 
Top