Skip to content

Integrate class proxy generation in AOT processing #28954

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

Closed
snicoll opened this issue Aug 12, 2022 · 2 comments
Closed

Integrate class proxy generation in AOT processing #28954

snicoll opened this issue Aug 12, 2022 · 2 comments
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Aug 12, 2022

Now that class proxies can be generated at build-time and reused consistently (see #28115), we need to integrate that in our AOT processing. As part of this, the proper hint should be inferred so that the class can be discovered at runtime.

@snicoll snicoll added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Aug 12, 2022
@snicoll snicoll added this to the 6.0.0-M6 milestone Aug 12, 2022
@snicoll snicoll self-assigned this Aug 12, 2022
snicoll added a commit that referenced this issue Aug 12, 2022
This commit expands GeneratedClassHandler to allow invocation of
declared fields and methods. Generated proxies have a number of
internal fields and methods that are invoked via reflection.

See gh-28954
@snicoll
Copy link
Member Author

snicoll commented Aug 15, 2022

This isn't complete without method invocation hints on the target class, as stated by @jhoeller:

I'm afraid that's the case since all the interceptor callbacks behind the proxy are Method-based, just like behind a JDK proxy. The naming arrangement is stable and in our control, so taking everything before the first $$ (for a class name to provide reflection for) should be a reliable way to handle it.

@snicoll snicoll reopened this Aug 15, 2022
snicoll added a commit that referenced this issue Aug 16, 2022
This commit updates the hints of a Cglib proxy's target type so that
methods can be invoked and constructors can be introspected. The former
is needed as a cglib proxy invokes the target type via reflection. As
for that latter, this is required at least by
Enhancer#filterConstructors.

See gh-28954
@snicoll
Copy link
Member Author

snicoll commented Aug 18, 2022

Fixed by 9a1b7c5

@snicoll snicoll closed this as completed Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant