Skip to content

Hypixel API Returns Integer on GuildReply for guild.guildExpByGameType, causing NumberFormatException #570

@DersWasTaken

Description

@DersWasTaken

Hello! I recently was working on a JDA Discord Bot which accesses the api, when I came across an error.

Exception in thread "DefaultDispatcher-worker-2" java.lang.IllegalStateException: java.util.concurrent.ExecutionException: com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 2687175922 at line 1 column 31206 path $.guild.guildExpByGameType.

This seemingly happens because in GuildReply the guildExpByGameType is a <GameType, Integer> map, but in certain instances, for example "The Dawns Awakening" guild, the actual number is larger than Integer.MAX.

This can easily be fixed by changing it from a Int to a Double/Long.

It is currently late at night for me, so I cannot make a PR, but if one is not made by tomorrow I will do so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions