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

Closed
printingin3d opened this Issue Mar 1, 2016 · 0 comments

Comments

2 participants
@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: https://github.com/printingin3d/javascad 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(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at eu.printingin3d.javascad.models2d.Area2d.getIteratorCrossing(Area2d.java:163)
at eu.printingin3d.javascad.models2d.Area2d.union(Area2d.java:251)

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