-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Runtime Hint for unsafeAllocated
#29561
Comments
The Without knowing about the actual issue, I don't know if the feature is missing something or if Gson needs additional metadata. In both cases, I don't think this is a good reason for adding this API to Thanks! |
Right, makes sene. However unfortunately it's not quite straightforward. The hint is not needed for Gson itself. It's needed for the code using Gson.
Right now, the only solution is to manually write a |
I've seen this message in the past and it is misleading, because in my cases I could get it working without unsafeAllocated. Are you sure that it doesn't work without |
Good point @mhalbritter - libraries can use the unsafe allocation as a fallback mechanism if they don't find a constructor. I've tested your sample with the following change and it works:
Since the adapter itself is not present anywhere in the controller signature we cannot detect it. Looking at GraalVM's GsonFeature, I'm not sure this is supposed to be supported at all. |
(For some reason I cannot reproduce the exact error message I pasted here, it still fails but without the stacktrace.) |
Affects: 6.0.1
Can we have the ability to add
unsafeAllocated
runtime hints inorg.springframework.aot.hint.ReflectionHints
. Example use case, Gson. It usessun.misc.Unsafe
. See also this.I didn't find anything in the documentation regarding this being left out intentionally, so I'm assuming this ticket is a feature request. Thanks.
The text was updated successfully, but these errors were encountered: