-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[GR-45258] MethodHandle on getter returns 0(false) instead of null for Long/Integer/Boolean using native-image #5672
Comments
@fniephaus @loicottet Happy new year :) I just wanted to ask if either one of you had time to check this issue. A short response is sufficient enough. Thx! |
I haven't had a chance to look at it yet. At first glance this looks like an issue in the way our method handle implementation handles boxing of primitive return values rather than #5209 but I will need to look into it further to confirm. |
I am seeing the same issue - would be great to see it fixed 👍 |
Hello all, is there any news on this topic? The PR objectify/objectify#490 by @ygyg70 seems to fix the problem. |
There are some discussions on the PR objectify/objectify#490 |
Describe the issue
Invoking a
MethodHandle
on a method withLong
as return type returns0
instead ofnull
using native-image.This can also be reproduced using
Integer
andBoolean
as return type.Steps to reproduce the issue
I added a reproducer, see https://github.com/dagrammy/graal-native-bug-test
git clone https://github.com/dagrammy/graal-native-bug-test.git
and follow the steps in the readme https://github.com/dagrammy/graal-native-bug-test/blob/main/README.mdDescribe GraalVM and your environment:
More details
Full example can be found here: https://github.com/dagrammy/graal-native-bug-test
This is a simple Pojo bean:
The getter is invoked using a MethodHandle:
Output in JVM:
Output in native-image:
Using
MethodHandles.publicLookup().findVirtual(beanClass, "getValue", MethodType.methodType(Long.class));
instead ofunreflect
also shows this behaviour (s. reproducer).Maybe issue #5209 is related?
The text was updated successfully, but these errors were encountered: