-
Notifications
You must be signed in to change notification settings - Fork 75
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
ClassCastException verifying a kotlin data class (annotation containing int array). #227
Comments
Here are some more specific steps to reproduce the issue (sorry no sample github repo at this time, but it's only 2 classes and a couple of commands).
data class InputClass(@JvmField val name: String)
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
public class TestEqualsVerifier {
public static void main(String[] args) {
EqualsVerifier.forClass(InputClass.class).withRedefinedSuperclass().suppress(Warning.NONFINAL_FIELDS).verify();
}
}
Expected behavior: no output
|
Hi Carmen, Thanks for the elaborate bug report! It was very helpful to find the cause quickly. |
Hahah cool, I'll check it out as soon as it's ready. |
Haha 😄 |
…n containing int array)
What steps will reproduce the problem?
verify()
on a kotlin data class.What is the code that triggers this problem?
The code is a generated java file from a kotlin file. I don't have an example app yet, and this is a closed-source app. But I'll provide some snippets for now, and try to find time to create a standalone example to illustrate the problem.
The kotlin file is a data class:
The generated java file (produced by gradle) starts out like this:
The test code is this:
What error message or stack trace does EqualsVerifier give?
What did you expect?
No
ClassCastException
Which version of EqualsVerifier are you using?
3.1 and 3.1.1 have this problem.
3.0.3 doesn't appear to have the problem.
Please provide any additional information below.
The equalsverifier lib crashes here:
Stacktrace:
My understanding is that the annotation in the generated java file has an array of
int
, which can't be cast to anObject[]
.The text was updated successfully, but these errors were encountered: