Bug 458002 - [CDI 1.1] SmoothiePluginStrategy has a bean name conflict
Summary: [CDI 1.1] SmoothiePluginStrategy has a bean name conflict
Status: NEW
Alias: None
Product: Hudson
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Winston Prakash CLA
QA Contact: Geoff Waymark CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-20 20:22 EST by Kaz Nishimura CLA
Modified: 2015-03-17 22:38 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaz Nishimura CLA 2015-01-20 20:22:19 EST
Class org.hudsonci.inject.internal.plugin.SmoothiePluginStrategy is annotated with @Named("default") and its constructor takes pamaeter ExtensionLocator extensionLocator also annotated with the same name.  This causes bean name conflicts in CDI.  Please consider rename either one.

Weld reported: WELD-001414: Bean name is ambiguous. Name default resolves to beans: [Producer Method [ExtensionLocator] with qualifiers [@Default @Named @Any] declared as [[BackedAnnotatedMethod] @Produces @Named private org.hudsonci.inject.internal.InjectionHelper.getDefaultExtensionLocator()], Managed Bean [class org.hudsonci.inject.internal.plugin.SmoothiePluginStrategy] with qualifiers [@Default @Named @Any]]. Please see server.log for more details.]]
Comment 1 Kaz Nishimura CLA 2015-01-20 20:26:48 EST
Also note that because SmoothiePluginStrategy is annotated with @Singleton and its constructor with @Inject, it is discovered as a bean in the default 'annotated' bean discovery mode of CDI 1.1.