Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfBoundsException with no stacktrace with setter with no params #19

Open
PlanetTeamSpeakk opened this issue Apr 29, 2021 · 0 comments

Comments

@PlanetTeamSpeakk
Copy link

I made a mixin with a couple getters and two setters, but I forgot to add parameters to those setters which caused an IndexOutOfBoundsException with no stacktrace to be thrown whenever I tried to build, launch, etc.
This was a huge pain as finding the cause of an error with no stacktrace is no easy task.
The message of the exception was Index: 0, Size: 0 so I can only assume that Mercury assumes that setters always have a parameter and doesn't actually check for it first.

The mixin that caused this error was

@Mixin(Entity.class)
public interface MixinEntityAccessor {
    @Accessor("entityId")
    int getEntityId_();

    @Accessor("yaw")
    float getYaw_();

    @Accessor("pitch")
    float getPitch_();

    @Accessor("yaw")
    void setYaw_();

    @Accessor("pitch")
    void setPitch_();
}

As you can see, the last two methods, which are setters, don't have a parameter even though they obviously should.
A more detailed error message, especially one stating where this mistake was made, would be highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant