Bug - Fixed Debug log on outfit change

Bale

Minion
New error in r14883! I click on a custom outfit from the drop-down in my Gear Changer (Equipment) pane and I get "Unexpected error, debug log printed."

Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         KoLmafia v16.4 r14883, Windows XP, Java 1.7.0_55
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread of KoL's
 Gameplay-Discussion forum. If you would like the KoLmafia dev team
 to look at it, please write a bug report at kolmafia.us. Include
 specific information about what you were doing when you made this
 and include this log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Wed Oct 15 23:51:52 EDT 2014
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
	at net.sourceforge.kolmafia.request.EquipmentRequest.<init>(EquipmentRequest.java:306)
	at net.sourceforge.kolmafia.swingui.GearChangeFrame$OutfitComboBox$ChangeOutfitListener.execute(GearChangeFrame.java:836)
	at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
	at net.sourceforge.kolmafia.RequestThread$SequencedRunnable.run(RequestThread.java:419)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

I'm switching to outfit aaa which consists of this:
  • Hairpiece On Fire
  • Thor's Pliers
  • pool skimmer
  • surgical apron
  • thunder down underwear
  • ghost of a necklace
  • Hand in Glove
  • astral mask

My current gear is exactly the same, except that the accessories are in different slots. (acc1 and acc3 are swapped.) Sometimes I choose my default outfit just to ensure that I am actually wearing it.
 

Bale

Minion
Two more details from additional testing:
  1. If my accessories are in the slots matching my outfit definition, I still get the debug log.
  2. If even 1 item is changed when I swap outfits, I do not get a debug log.


The problem seems to be that mafia does not like when outfit swapping fails to change equipment. This regression should really get fixed before we roll out the new point release so I hope it isn't tricky.
 

Veracity

Developer
Staff member
Your debug log shows nothing like "mafia does not like when outfit swapping fails to change equipment". It seems to be having a problem with the SpeciaiOutfit being null; debug log is simply trying to get the outfit id. It has not knowledg (or care) of what the outfit actually contains at that point.

I was able to get this debug log once, but never again.

Puzzling.
 

Veracity

Developer
Staff member
Yeah.

I can't reproduce this.

When did you create outfit "aaa"? How? Gear Changer? CLI command? This session, or a previous session?

Looking at the debug log, it appears that the model for the dropdown has a null in it. Looking at the code, I can't see how that could happen - and I am not able to make it happen at will.

I need a sequence of steps that will reliably reproduce the bug.

Thanks.
 

Bale

Minion
I tried this repetitively. I got a debug log whenever I was wearing the equipment in the outfit (in any order), but did not get a debug log when I equipped something else or equipped an outfit first.

I can repeat this even now by simply equipping any custom outfit twice.

Huh. I just noticed it also gives the same debug log when I equip a non-custom outfit twice (Like Frat Warrior Fatigues.)

Is there anything I can do to help debug this?
 

Veracity

Developer
Staff member
For some reason, when you select an outfit in the Gear Changer, the selectedItem might be "null". We used to check if it was null or not a SpecialOutfit. When I refactored recently, I removed the "not a SpecialOutfit" check, since the generics were ensuring that the list had nothing but SpecialOutfits.

For some reason, I also removed the null check.

I don't understand why that is necessary, but it is.

Revision 14884.
 
Top