[cdi-dev] [JBoss JIRA] (CDI-525) Default names should maybe follow the inferring rules from the JavaBean spec

Emily Jiang emijiang6 at googlemail.com
Wed May 6 17:27:02 EDT 2015


Agreed! I think Weld should be changed to comply with what CDI Spec says.

On Tue, May 5, 2015 at 12:30 PM, Martin Kouba (JIRA) <issues at jboss.org>
wrote:

>
>     [
> https://issues.jboss.org/browse/CDI-525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13065411#comment-13065411
> ]
>
> Martin Kouba commented on CDI-525:
> ----------------------------------
>
> It seems that OWB follows the current spec wording - see also
> [WebBeansUtil.getManagedBeanDefaultName()|
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.openwebbeans/openwebbeans-impl/1.2.7/org/apache/webbeans/util/WebBeansUtil.java#WebBeansUtil.getManagedBeanDefaultName%28java.lang.String%29].
> Given that the change would be backwards incompatible and not all
> implementations behave in the same way I'm not so sure it's a good idea
> anymore.
>
> > Default names should maybe follow the inferring rules from the JavaBean
> spec
> >
> ----------------------------------------------------------------------------
> >
> >                 Key: CDI-525
> >                 URL: https://issues.jboss.org/browse/CDI-525
> >             Project: CDI Specification Issues
> >          Issue Type: Clarification
> >    Affects Versions: 1.2.Final
> >            Reporter: Martin Kouba
> >
> > *3.1.5. Default bean name for a managed bean*:
> > {quote}
> > The default name for a managed bean is the unqualified class name of the
> bean class, after converting the first character to lower case.
> > {quote}
> > As a result, the default name for a bean class {{URLMatcher}} should be
> {{uRLMatcher}}. On the other hand the JavaBean spec is using different
> rules when inferring property names, *8.8 Capitalization of inferred names*:
> > {quote}
> > However to support the occasional use of all upper-case names, we check
> if the first two characters of the name are both upper case and if so leave
> it alone.
> > {quote}
> > I.e. the property name for getter {{getURLMatcher()}} woud be
> {{URLMatcher}}.
> > Note that there is no TCK test for this and so implementations may
> differ (issue is already filed: CDITCK-473). Weld is using
> {{java.beans.Introspector.decapitalize()}} and so it follows the JavaBean
> spec even now. I'm not sure about OpenWebBeans.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.15#6346)
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
>



-- 
Thanks
Emily
=================
Emily Jiang
ejiang at apache.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150506/674a73bf/attachment.html 


More information about the cdi-dev mailing list