Bug - Fixed Unexpected error, debug log printed - r12886

CLI contents:
Code:
Installing default certificate validation...
Validating login server (www.kingdomofloathing.com)...
Skipping stale data override: data/mallprices.txt
677 players online.
Sending login request...
Initializing session for wrldwzrd89...
Refreshing session data...
Synchronizing moon data...
Loading character status...
Retrieving character data...
Updating inventory...
Examining Meat in closet...
Updating closet...
Retrieving quest data...
Retrieving familiar data...
Familiar data retrieved.
Retrieving campground data...
Visiting Hot Dog Stand in clan VIP lounge
You are currently a member of Lost Generation
Session data refreshed.
Labór Day tomorrow, Mysticism bonus today (not tomorrow).
4832 prices updated from http://kolmafia.us/scripts/updateprices.php?action=getmap
Unexpected error, debug log printed.
Unexpected error, debug log printed.
Unexpected error, debug log printed.
Elayle (#2383225), the Level 27 Sauceror
This player is currently online in channel games and listening to clan, dread, newbie, radio, trade and valhalla.

Unexpected error, debug log printed.
Putting on outfit: Rollover F=disembodied hand
Putting Surt the Silly the Stocking Mimic back into terrarium...
Taking Black Belt the Disembodied Hand out of terrarium...
Equipment changed.

Debug log attached.
 

Veracity

Developer
Staff member
Try revision 12887

I do not understand why this:

Code:
		ArrayList<AdventureResult> items = new ArrayList<AdventureResult>();
...
 		return (AdventureResult[])items.toArray();
fails, but

Code:
		AdventureResult[] result = new AdventureResult[ items.size() ];
		items.toArray( result );
		return result;
works. "items" is explicitly defined to contain nothing but AdventureResults, so, why doesn't toArray(items) return something which is an array of AdventureResults rather than an array of Objects?

Whatever. That's Java.

Yes, Bale. This is exactly the kind of thing I was seeing myself in code that I was able to test. You-all get to test more code for me. ;)
 

Theraze

Active member
> acquire 5 jaba pepper

Verifying ingredients for jabañero pepper (5)...
Unexpected error, debug log printed.
The average amount of meat spent on components (429,496,736) for one jabañero pepper exceeds autoBuyPriceLimit (10,000)
You need 5 more jabañero pepper to continue.
Appears that it happens when you try to get a worthless item as well.
 

Attachments

  • DEBUG_20131015.txt
    2.8 KB · Views: 42

xKiv

Active member
why doesn't toArray(items) return something which is an array of AdventureResults rather than an array of Objects?

1) it must work with arrays of any objects and is not generic -> its return type must be Object[] and therefore it can't instantiate array of anything that isn't Object
2) backwards compatibility with non-generic java versions prevent change of toArray() to generic version (can't have Object[] and T[] methods with the same arguments)
3) and you can't instantiate T[] anyway, you need an instance of T, T.class, T[] or T[].class first, then you can use reflection (actually, my version of java seems to use a native method in the background)
 
Top