-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[BUG] extensions method with long/double argument causes JNI error when run in Eclipse #3463
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
Milestone
Comments
marc-guenther
pushed a commit
to marc-guenther/lombok-problems
that referenced
this issue
Jul 22, 2023
marc-guenther
pushed a commit
to marc-guenther/lombok-problems
that referenced
this issue
Jul 23, 2023
marc-guenther
pushed a commit
to marc-guenther/lombok-problems
that referenced
this issue
Jul 23, 2023
Thanks for the detailed bug report. IIRC we already have some special handling for casts but it seems to be incomplete or incompatible with recent eclipse versions. |
Rawi01
added a commit
to Rawi01/lombok
that referenced
this issue
Aug 7, 2023
rzwitserloot
added a commit
that referenced
this issue
Sep 17, 2023
I can confirm that this fixes the problem. Thanks a lot! Always nice to fix a bug by removing "magic" from the code :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
An extension method with a
long
ordouble
parameter, which is called with anint
, causes an JNI error during runtime when loading the class.Definition of the extension method with a
long
argument:Calling it with an
int
:This compiles, but when run in Eclipse, produces the JNI error below.
Calling with a
long
instead (eg. changing the1
to a1l
) fixes the problem.To Reproduce
See here for an example project:
The problem can be seen in the JNIProblem.java class.
When launching the class in Eclipse, it will fail like this:
With
javac
/java
it works just fine:Expected behavior
No JNI error :)
Version info:
Workaround
Define both versions of the extension method (
int
andlong)
, and let one call the other.When I tried this, it still wouldn't work. Turns out, Eclipse does not recompile my calling class, when the extension method class changes.
After a Clean Build everything worked fine.
The text was updated successfully, but these errors were encountered: