Skip to content
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

Support cglib generated classes with TestCompiler #29141

Closed
snicoll opened this issue Sep 13, 2022 · 0 comments
Closed

Support cglib generated classes with TestCompiler #29141

snicoll opened this issue Sep 13, 2022 · 0 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 Sep 13, 2022

To be able to test the behavior of Cglib proxies, we need to customize the classpath for both the compilation and the loading of classes in DynamicClassLoader.

The use case is as follows: AOT is processing candidates, which generates a cglib proxy in target/some-location. The class is available and then referenced in AOT-generated code.

Currently the compilation is failing as the class in target/some-location cannot be resolved. Once we fix that, we need to be able to load it in DynamicClassLoader.

@snicoll snicoll added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Sep 13, 2022
@snicoll snicoll added this to the 6.0.x milestone Sep 13, 2022
@sbrannen sbrannen changed the title Add support for additional classpath locations on TestCompiler Add support for additional classpath locations in TestCompiler Sep 13, 2022
snicoll added a commit to snicoll/spring-framework that referenced this issue Sep 14, 2022
@snicoll snicoll self-assigned this Sep 15, 2022
@snicoll snicoll modified the milestones: 6.0.x, 6.0.0-RC1 Sep 15, 2022
@philwebb philwebb changed the title Add support for additional classpath locations in TestCompiler Add support for additional dynamically generated classes in TestCompiler Sep 20, 2022
@philwebb philwebb changed the title Add support for additional dynamically generated classes in TestCompiler Support cglib generated classes with TestCompiler Sep 20, 2022
philwebb added a commit that referenced this issue Sep 20, 2022
Update `TestCompiler` so that it can now load cglib generated classes.
This commit adds support to `DynamicJavaFileManager` so that it can
reference generated classes and adds a new lookup function to
`CompileWithTargetClassAccessClassLoader` to that it can load the
bytecode of generated classes directly.

See gh-29141

Co-authored-by: Phillip Webb <[email protected]>
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