-
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
Revisit AOT constructor and factory method resolution #27920
Comments
FTR we have a very hackish/temporary version in the meantime in |
On a related note, after #28414, the |
Juergen and I brainstormed about this one today and we're thinking about an API that would provide a richer model to account, namely, for generic constructor argument values. Given a
Based on this model we could generate code so that a A further refinement is the case where all the arguments are known upfront, avoiding the use of There is such an example of such a generic argument in #29087. |
Regarding 2. I should add some sort of SPI for this would be very much welcome as this could be reused transparently for |
I'm narrowing the scope of this ticket for our immediate purposes in 6.0, namely merging AOT constructor and factory method resolution into Follow-up work might happen before GA still or afterwards in the 6.0.x line, ideally without affecting applications or the rest of the portfolio. |
@jhoeller I didn't see a follow-up issue for the argument resolution that is quite important for XML-based scenarios. I've created another issue. |
HI, do you have a link to the follow up issue, please so I can follow it? With the latest snapshots I still see the issue as I raised under #29052 when trying to compile as native. |
Alright. Please create a separate issue and share a small sample we can use to reproduce. |
We currently resolve the constructor or factory method to use to instantiate a bean using the package private
ConstructorResolver
class. When processing aBeanFactory
at build-time, we need to retain that information (without instantiating the bean) so that we lower reflection and processing at runtime.Right now,
ConstructorResolver
:Constructor
to use.Rather than returning
BeanWrapper
we could return an object that provides the metadata that we need and wrap the instantiation call for the regular runtime behavior. However, the difference between constructor and factory method is annoying as I'd rather have a consistent API for both.It is also unknown how we'd store the resolved arguments or if we'd need to.
The text was updated successfully, but these errors were encountered: