Please add a bug.

On 6/29/05, Phil Zoio <[EMAIL PROTECTED]> wrote:
> 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:      [EMAIL PROTECTED]
> 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()
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to