Skip to content

Generate matching inner class for inner class configuration #29213

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 Sep 28, 2022 · 1 comment
Closed

Generate matching inner class for inner class configuration #29213

snicoll opened this issue Sep 28, 2022 · 1 comment
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 28, 2022

While this is a general problem, it feels like it is mostly specific to the code that handles configuration classes. When creating bean definitions for an inner class, the generator currently creates a top level class where the $ separator is replaced by a _. Using inner classes is quite popular so fixing this would reduce the number of generated classes and make the generated code more consistent.

@snicoll snicoll added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Sep 28, 2022
@snicoll snicoll added this to the 6.0.0-RC1 milestone Sep 28, 2022
@snicoll snicoll self-assigned this Sep 28, 2022
@snicoll
Copy link
Member Author

snicoll commented Sep 28, 2022

I went down the route of trying to make that transparent by patching GeneratedClasses. It turns out it brings a number of problem:

  1. The code that get an inner class is not responsible of creating the hierarchy, if necessary. This makes it hard to figure out what the type customization of the enclosing class should be
  2. Dealing with unique class name is a bit fuzzy as it's unclear if the uniqueness should apply to the enclosing class, or the inner class within the same enclosing class

Implementing this specifically for bean methods generation solves both problems.

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