commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject [beanutils] Problem with indexed properties
Date Tue, 25 Jan 2005 23:18:32 GMT
Someone on struts-user got tripped up by what I thought was a bean that
didn't conform to the spec, but then I learned that for an indexed property,
you can have four accessors, such as:
    String[] getProp()
    String getProp( int )
    void setProp( String[] )
    void setProp( int, String )

The struts user threads are:

I can reproduce the 'argument type mismatch' error under both Windows and
HP-UX, with JDK 1.4.2 or 1.5.0, with this code:

BeanUtilsBean beanUtilsBean = new BeanUtilsBean(
                                new ConvertUtilsBean(),
                                new PropertyUtilsBean());
IndexedBean bean = new IndexedBean();
String[] newValue = new String[] { "dog", "cat", "bird" };
beanUtilsBean.setProperty(bean, "prop", newValue );

(IndexedBean just has the four methods shown above.)

     [echo] Running BeanUtils tests ...
     [java] [ERROR] PropertyUtils - Method invocation failed.
<java.lang.IllegalArgumentException: argument type
mismatch>java.lang.IllegalArgumentException: argument type mismatch

The additional test and bean are attached to bug 28358.

It was originally reported as a JVM problem, but even if the code would work
under 1.3.1, that isn't going to help those of us who have long since moved
up to 1.4 and 1.5.

Wendy Smoak

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message