#609 ArrayIndexOutOfBunds for instance initalizers

release_1.0
closed
nobody
Gui (6)
7
2013-10-28
2010-05-21
Matthias Becker
No

Version 5.1
We are using JMock for our test cases and let checkstyle also run over them.
This construct:
private void expectSetMode(final Mode returnMode, final boolean ret) {

    final Expectations expectations = new Expectations() {
        {
            switch(returnMode) {
            case A:
                oneOf(service).activateA();
                break;
            case B:
                oneOf(service).activateB();
                break;
            case C:
                oneOf(service).activateC();
                break;
            case D:
                oneOf(service).activateD();
                break;
            default:
            }
            will(returnValue(Boolean.valueOf(ret)));
        }
    };
    mockery.checking(expectations);
}

does produce the ArrayIndexOutOfBounds with Integer.MAX_VALUE

Discussion

  • This "Error" is rather annoying!

     
  • Roman Ivanov
    Roman Ivanov
    2013-10-28

    can you please come up with more simple code test case ?
    I failed to make it compilable to reproduce.

    Please do not forget to attach your checkstyle configuration

    If still a problem please go to https://github.com/checkstyle/checkstyle/issues with details.

     
  • Roman Ivanov
    Roman Ivanov
    2013-10-28

    • status: open --> closed
    • Group: --> release_1.0