Bug - Fixed More uncaught exception

Raijinili

Member
> maximize? meat, outfit swashbuckling, -outfit brimstone

Unknown or custom outfit: brimstone
Unexpected error, debug log printed.

After this, Mafia won't leave the "grey state" (in-progress) for the "green state" (everything's OK).

Yes, afterward, I realize that it's not the "brimstone" outfit.
Code:
Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
	at net.sourceforge.kolmafia.swingui.MaximizerFrame.maximize(MaximizerFrame.java:330)
	at net.sourceforge.kolmafia.textui.command.ModifierMaximizeCommand.run(ModifierMaximizeCommand.java:54)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:538)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:412)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:202)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:183)
 

slyz

Developer
I guess you have since changed your command to:
Code:
maximize? meat, outfit swashbuckling, -outfit Blasphemous Bedizenment
 

Theraze

Active member
This sort of error comes up if you enter anything non-proper into the maximize command...
> maximize? bleegh

Unrecognized keyword: bleegh
Unexpected error, debug log printed.
Anything non-proper will cause a debug log. It's just a feature of the way the maximize command runs.

Edit: Maybe a minion could change the title from "More uncaught exception" to "Maximizer causes exception on bad entry" or something similar?
 

Nifft

Member
Until a proper method of getting back from Grey to Green is in place, you can just click any link in your Relay Browser, and the GUI will return to Green and everything unlocks. I get stuck in Gray mode now and then even without hitting a debug situation (unless they're silently happening). Yes, on very new release numbers. Anything in particular I should be avoiding or checking when it happens to provide better feedback to the situation?

thanks,
~ Nifft
 

Theraze

Active member
Hitting escape in the GUI window will usually get you back to working. I've had a few times recently where a normal execution of some command will get stuck, and I needed to unlock the GUI again. Wasn't paying enough attention to what I did to replicate/report in a useful way, so I'm still collecting data before making a bug report there. :) But yeah, escape/abort should unlock the GUI as well.
 

Raijinili

Member
Theraze: How is it a feature? It's the bug I mean to point out in the first place.

An "unexpected error" means, to me, something went wrong that it wasn't prepared to deal with, and this means that the program (or at least the module that got it) is possibly in an invalid state. Once such an error is understood, it's no longer unexpected, and would be "fixed" (i.e. handled) so that the program state is not corrupted.

In this case, it seems that the program recognized the error but let the exception propagate anyway, which is a bug. The Maximizer window doesn't do the part about the unexpected error, by the way.

It's "more uncaught exception" because I posted an earlier bug report about adv doing the same. Though in that case, "adv purple-light" seems to get a second exception instead of the "does not exist in database" error with "adv bleeeeearht".

I'm submitting it as a bug, because that's what looks like to me, rather than asking for a workaround, which I can pretty much figure out myself. The only thing I can't work around is when it starts buffering commands in a way that pressing escape doesn't work, and I can't remember what's causing that.
 
Last edited:

Theraze

Active member
Hmm... I thought I experienced it in the window as well. I know it's always been there in the gCLI command, and that's actually what made me back away from trying to make an ASH command before it was officially added.

Edit: Checking now with 9322 and it returns the same error message from the window, gCLI, and ASH commands. However, none of them will print a debug log for me...
 
Last edited:

Raijinili

Member
I tested it only a few minutes before posting (I open KoLMafia strictly through update.exe, so it's always the latest on open) and it still gave the null pointer exception.

Tried it one more time, and
-outfit brimstone (in maximizer window) ->
Unknown or custom outfit: brimstone

> maximize -outfit brimstone (in gCLI) ->
Unknown or custom outfit: brimstone
Unexpected error, debug log printed.
 

Theraze

Active member
Okay, get this now, using the attached patch:
> ash maximize("sdfbsadlfdasd", true)

Unrecognized keyword: sdfbsadlfdasd
Returned: false

> ash maximize("-outfit brimstone", true)

Unknown or custom outfit: brimstone
Returned: false

> maximize -outfit brimstone

Unknown or custom outfit: brimstone
Unable to meet all requirements via equipment changes.
See the Modifier Maximizer for further suggestions.

> ash maximize("-outfit mining gear", true)

Maximizing...
1456 combinations checked, best score 0.0
Returned: true
No more debug log. Explanation follows:
public static boolean maximize(String maximizerString, etc) launches MaximizerFrame.maximize(equipLevel, etc). Part of what the maximize function does is initialize MaximizerFrame.best, so if this hasn't been done, anything that calls .best will fail, such as line 330, where it calls for Modifiers mods = MaximizerFrame.best.calculate(). Obviously, with no best, you can't calculate it...

What this does is makes it actually initialize the .best value even if it fails initial parsing, but if so, all it does is create the structure and marks it as failed. This means that the ASH function properly returns false if it wasn't able to maximize properly, and the gCLI tells you that your equipment wasn't actually possible... As you can see, it still properly marked a valid outfit as possible. This shouldn't affect anything but improperly worded maximizer requests when permitsContinue is false.
 

Attachments

  • InitializeMaximizerBest.patch
    477 bytes · Views: 27

Theraze

Active member
See, this is why we love Veracity. We come up with one solution to make the error-point not scream, and she just makes it quit when it's supposed to. :) I tried to make that work, but got confused trying to tell it to stop. Awesome. Thanks! :)
 
Top