We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The issue is with @Factory @Bean methods. These can return anonymous classes or real classes and we can get subtle behaviour here.
@Factory
@Bean
This change removes the use of bean.getClass() when registering and changes to explicit types.
bean.getClass()
@Bean @Named("BuildDesi1") DesEngi buildEngi() { methods += "|buildEngi1"; return new DesEngi(){ @Override public String ignite() { return "buildEngi1"; } }; } @Bean @Named("BuildDesi2") DesEngi buildEngi2() { methods += "|buildEngi2"; return new MyEngi(); }
With current generated code explicitly registering both DesEngi.class, Engi.class types.
DesEngi.class, Engi.class
/** * Create and register DesEngi via factory bean method MyFactory#buildEngi(). */ public static void build_buildEngi(Builder builder) { if (builder.isAddBeanFor("BuildDesi1", DesEngi.class, Engi.class)) { MyFactory factory = builder.get(MyFactory.class); DesEngi bean = factory.buildEngi(); builder.register(bean, "BuildDesi1", DesEngi.class, Engi.class); } } /** * Create and register DesEngi via factory bean method MyFactory#buildEngi2(). */ public static void build_buildEngi2(Builder builder) { if (builder.isAddBeanFor("BuildDesi2", DesEngi.class, Engi.class)) { MyFactory factory = builder.get(MyFactory.class); DesEngi bean = factory.buildEngi2(); builder.register(bean, "BuildDesi2", DesEngi.class, Engi.class); } }
The text was updated successfully, but these errors were encountered:
#97 - Refactor to register using explicit types rather than bean.getC…
12e9928
…lass() canonical name Plus - #96 Case insensitive qualifier names - #98 Support @singleton that extends another concrete @singleton
#97 - Followup Refactor simplifying register methods
30f5615
This means we only declare the qualifier and types once in generated code which makes more sense
#97 - Followup tidy remove unused code
d2c8907
rbygrave
No branches or pull requests
The issue is with
@Factory
@Bean
methods. These can return anonymous classes or real classes and we can get subtle behaviour here.This change removes the use of
bean.getClass()
when registering and changes to explicit types.With current generated code explicitly registering both
DesEngi.class, Engi.class
types.The text was updated successfully, but these errors were encountered: