openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harald Wellmann <hwellmann...@gmail.com>
Subject Re: Producer method default name
Date Mon, 12 Nov 2012 11:27:20 GMT
I'm slightly confused...

See CDI Spec 1.0, section 3.3.8:

"The default name for a producer method is the method name, unless the
method follows the JavaBeans property getter naming convention, in
which case the default name is the JavaBeans property name."

In my case, the producer method is called "foo()", which is not a
getter, so the bean name should be "foo". (And this is what I get with
Weld.) What is the default name generated by OWB in this case?

Best regards,
Harald

2012/11/12 John D. Ament <john.d.ament@gmail.com>:
> That is expected behavior.  @Named uses javabean naming conventions to pick
> the default name.
>
> On Nov 12, 2012 5:05 AM, "Harald Wellmann" <hwellmann.de@gmail.com> wrote:
>>
>> I have a producer method
>>
>> @Produces @Named
>> public String foo() { ... }
>>
>> and a matching injection point
>>
>> @Inject @Named("foo")
>> private String foo;
>>
>> in some other bean.
>>
>> With OWB 1.1.6, injection fails, unless @Named("foo") is explicitly
>> added to the producer method. Is this a known issue?
>>
>> Best regards,
>> Harald

Mime
View raw message