-
Notifications
You must be signed in to change notification settings - Fork 1k
fix graal native image #15306
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
base: main
Are you sure you want to change the base?
fix graal native image #15306
Conversation
| private static MethodHandle findGetHeadersMethod(MethodType methodType) { | ||
| try { | ||
| return MethodHandles.lookup().findVirtual(HttpHeaders.class, "getOrDefault", methodType); | ||
| return MethodHandles.lookup().findVirtual(HttpHeaders.class, "get", methodType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be interesting to know why getOrDefault failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I don't have an answer
| // up to spring web 7.0 | ||
| methodHandle = | ||
| findGetHeadersMethod(MethodType.methodType(Object.class, Object.class, Object.class)); | ||
| methodHandle = findGetHeadersMethod(MethodType.methodType(List.class, Object.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Object.class, Object.class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I created #15311 that uses a slightly different approach just to test out whether it would work. Noticed that for webflux instrumentation the header getter logic is duplicated for client and server instrumentation, fixed that too. The approach taken in this PR is fine too and I might even prefer it. Though first all tests would need to pass. |
great - I'm also trying to fix this PR so that we can choose.
|
We broke native image and didn't realize it because