The API of BeanRegistrationCodeFragments is a bit inconsistent at the moment. While everything is related to code generation, getTarget insists on providing a Class whereas all that's needed is a classname. For consistency getTarget should return a ClassName. This would allow something to generate bean registration in a package that does not exist yet.

This is a prerequisite for what we're investigating in https://github.com/spring-projects/spring-framework/issues/29019