-
-
Notifications
You must be signed in to change notification settings - Fork 925
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_field causes NPE when using derived class of a java object #4165
Comments
Looks like this could happen if the class is not reifiable; reifyWithAncestors will not set a reified class, and the later getReifiedClass will just return null. So the logic is not robust in the presence of unreifiable classes (bug 1) and for whatever reason this simple class is showing up as unreifiable (bug 2). |
Ok, I missed a detail in your example: you're extending a concrete Java class. become_java! and concrete extension have never been wired up together, so I'm not at all surprised that this failed. A Ruby subclass of a concrete Java class is already basically a become_java! class, so perhaps the right approach would be for us to make concrete subclassing aware of @kares What do you think? @byteit101 I will at least add an more appropriate error to become_java! for non-reifiable cases. |
Environment
Test Case
I would expect this to succeed, as it does if you swap the parent with a ruby class
Unexpected Error
The text was updated successfully, but these errors were encountered: