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

java.lang.IncompatibleClassChangeError when MoreThanOneElementException is thrown #20

Closed
dnahodil opened this issue Jul 27, 2015 · 2 comments

Comments

@dnahodil
Copy link
Owner

Steps to reproduce
Call only() on a list with more than one element. e.g.:

[1, 2].only()

What should happen
A MoreThenOneElementException is thrown.

What does happen
The following error is thrown:

java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.RuntimeException do not match. Expected -1 but got 5
    at com.dnahodil.groovy.extensions.MoreThanOneElementException.<init>(MoreThanOneElementException.groovy:6)
    at com.dnahodil.groovy.extensions.ListExtensions.only(ListExtensions.groovy:13)
@dnahodil
Copy link
Owner Author

Looks like this is only a problem on some versions of Java.

Ref: http://blog.proxerd.pl/article/how-to-fix-incompatibleclasschangeerror-for-your-groovy-projects-running-on-jdk7

@dnahodil
Copy link
Owner Author

On second look it seems to work fine on Groovy 2.2.1 but is broken on 2.0.5.

dnahodil added a commit that referenced this issue Jul 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant