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

Cryptic java.lang.IndexOutOfBoundsException if coverage tool is enabled #264

printingin3d opened this issue Mar 1, 2016 · 0 comments


Copy link

@printingin3d printingin3d commented Mar 1, 2016

Please provide the following information:

  • Version of JMockit that was used:
    1.21 and 1.22
  • Description of the problem or enhancement request:
    Checkout the code from the following place: and run mvn clean install

The result some cryptic exception during the test run, originated in the Area2d class:

java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.rangeCheck(
at java.util.ArrayList.get(
at eu.printingin3d.javascad.models2d.Area2d.getIteratorCrossing(
at eu.printingin3d.javascad.models2d.Area2d.union(

The funfact is: I got the same error if the lineSegmentSeries method returns with a Vector, instead of ArrayList. More than that - as it can be seen in the commented out lines - I rewrote that enhanced for loop to a classic for loop, and then the above exception has been thrown in the very first line after the for loop. Even if it is just a System.out.println("hello").

If I comment the coverage tool out in the pom.xml the problem doesn't occur.

I haven't spend any time to try to minimize the code site which produces the error - I'll try later, but I wanted to open an issue. Maybe it will be familiar to someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

No branches or pull requests

2 participants