Bug - Won't Fix Adding more then int max of an item to your store causes an error

Rinn

Developer
Submitting a request to put long max of an item in your store causes an error because mafia is trying to parse the value as an integer instead of a long. I dunno if anyone is ever going to try to sell more then int max of an item at one time but there you go.

Code:
Unexpected error, debug log printed.
class java.lang.NumberFormatException: For input string: "9223372036854775807"
java.lang.NumberFormatException: For input string: "9223372036854775807"
    at java.lang.NumberFormatException.forInputString(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at net.sourceforge.kolmafia.utilities.StringUtilities.parseIntInternal1(StringUtilities.java:696)
    at net.sourceforge.kolmafia.utilities.StringUtilities.parseInt(StringUtilities.java:666)
    at net.sourceforge.kolmafia.request.TransferItemRequest.getItemList(TransferItemRequest.java:492)
    at net.sourceforge.kolmafia.request.TransferItemRequest.transferItems(TransferItemRequest.java:419)
    at net.sourceforge.kolmafia.request.AutoMallRequest.parseTransfer(AutoMallRequest.java:176)
    at net.sourceforge.kolmafia.StaticEntity.externalUpdate(StaticEntity.java:659)
    at net.sourceforge.kolmafia.request.RelayRequest.processResults(RelayRequest.java:234)
    at net.sourceforge.kolmafia.request.GenericRequest.processResponse(GenericRequest.java:1833)
    at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1751)
    at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1446)
    at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1177)
    at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1068)
    at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:1818)
    at net.sourceforge.kolmafia.LocalRelayAgent.readServerResponse(LocalRelayAgent.java:420)
    at net.sourceforge.kolmafia.LocalRelayAgent.performRelay(LocalRelayAgent.java:132)
    at net.sourceforge.kolmafia.LocalRelayAgent.run(LocalRelayAgent.java:109)
 

Theraze

Active member
This is actually the behaviour anytime an int is expected, and a long is given. The question is, what do we want to do then? Return max int (2,147,483,647 or if you prefer, (2^31)-1) or return the error, so we're aware of it happening?
 

fronobulax

Developer
Staff member
Not gonna fix. Anyone want to trace down where the int/long mismatch occurs and confirm that adjusting it won't break anything else? I'll reconsider and be glad to commit your patch ;-)
 
Top