You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by "Achim Hügen (JIRA)" <hi...@jakarta.apache.org> on 2005/08/10 21:36:11 UTC

[jira] Resolved: (HIVEMIND-138) Annotation initializer should trim() property names

     [ http://issues.apache.org/jira/browse/HIVEMIND-138?page=all ]
     
Achim Hügen resolved HIVEMIND-138:
----------------------------------

    Fix Version: 1.1
     Resolution: Fixed

> Annotation initializer should trim() property names
> ---------------------------------------------------
>
>          Key: HIVEMIND-138
>          URL: http://issues.apache.org/jira/browse/HIVEMIND-138
>      Project: HiveMind
>         Type: Bug
>  Environment: Hivemind 1.1 beta 1
>     Reporter: Phil Zoio
>      Fix For: 1.1

>
> I've been trying out the new annotations, and ran into a problem
> I set up an annotation for a NumberValidator bean:
>    @Bean(value = NumberValidator.class, initializer = "required=true, valueType=Float")
>    public abstract IValidator getAmountValidator();
> and couldn't work out why it would not recognise a property type - here's the exception
> component:     org.apache.tapestry.valid.NumberValidator@a849b0
> Stack Trace:
>    * org.apache.hivemind.util.ClassAdaptor.getPropertyAdaptor(ClassAdaptor.java:136)
>    * org.apache.hivemind.util.ClassAdaptor.smartWrite(ClassAdaptor.java:74)
>    * org.apache.hivemind.util.ClassAdaptor.configurePropertyFromToken(ClassAdaptor.java:221)
>    * org.apache.hivemind.util.ClassAdaptor.configureProperties(ClassAdaptor.java:195)
>    * org.apache.hivemind.util.PropertyUtils.configureProperties(PropertyUtils.java:89)
>    * org.apache.tapestry.bean.LightweightBeanInitializer.setBeanProperty(LightweightBeanInitializer.java:45)
> Turns out that the problem lies in
>    private void configurePropertyFromToken(Object target, String token)
>    {
>        int equalsx = token.indexOf('=');
>        if (equalsx > 0)
>        {
>            String propertyName = token.substring(0, equalsx);
>            String value = token.substring(equalsx + 1);
>            smartWrite(target, propertyName, value);
>            return;
>        }
>     etc...
>     }
> which does not trim the space before valueType. The result is that it doesn't find the property name " valueType".
> You won't get this problem if you trimmed() propertyName before calling smartWrite() 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org