The support for callable references in BeanRegistrarDsl which has been introduced in #34922 adds around 150 additional classes to the spring-beans JAR which grows from 904 KB to 1.1 MB! That's could be due to the combination of inlining, crossinlining, parameters with default values and reified generics. In any case, the cost of this syntactic sugar is too high, especially given the fact it adds to the previously known limitation that you need to introduces variants for each number of parameters supported.

As a consequence and given the fact that the alternative syntax is reasonably good, I will revert the related commit before the GA (sorry @wakingrufus) and adapt the documentation introduced in #35549 accordingly.

Comment From: sdeleuze

With this change, the spring-beans JAR goes from 1.1 MB to 904 KB, and from 166 to 15 generated classes for BeanRegistrarDsl.

Comment From: wakingrufus

I think this is reasonable. the important thing is being able to declare the routes function with parameters. Honestly, passing the reference alone was probably not ideal, as in the real world, you might need to pass a bean name, or use beanProvider() etc, making this particular sugar less and less useful

Comment From: sdeleuze

Also related classes are open, so libraries or application can potentially add such customization outside of Spring via extension functions.