Bug - Fixed wrong sanity check in SkillDatabase init, not enough columns for Spray Hot Grease

xKiv

Active member
>> START COPY from another thread:

Java seems to be acting up today, I keep getting "java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.kolmafia.persistence.ConcoctionDatabase at net.sourceforge.kolmafia.session.LoginManager.doLogin(LoginManager.java:94)" even though it's there. Debugging in eclipse, I get as far as " ConcoctionDatabase.usableList.sort();" at the end of ConcoctionDatabase's static block ...

ETA: caused by java.lang.ArrayIndexOutOfBoundsException: 5 .. without any apparent stack ???
...
Oh:
Code:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 5
	at net.sourceforge.kolmafia.persistence.SkillDatabase.<clinit>(SkillDatabase.java:159)

Actually, this looks like a completely different bug (missing tab in classskills.txt). Will post a new one.

>> END COPY

SkillDatabase:149 :
Code:
			if ( data.length < 5 )
			{
				continue;
			}

1) The 5 is too low. A few lines futher there's unconditional access to data[5], which requires length 6.

2) Anything with length between 2 and 5 should probably be reported as suspect. Can we do that?

3) Spray Hot Grease was added with only 5 columns, so that data[5] is an ArrayIndexOutOfBoundsException, which causes java to think that the entire class doesn't exist (because there was exception "in constructor" - this is why there shouldn't be anything nontrivial (=capable of throwing exception sometimes but not always) in a constructor (or a static initialization block).
 
r13501 - login failure, says Requests Complete but never logs in

It worked in r13500. I suspect a formatting error in classskills.txt is to blame - since that file changed between r13500 and r13501.
 
Back
Top