commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Natalie...@toyota.ca
Subject [BeanUtils] Got NullPointerException when get/set in index property of a BasicDynaBean
Date Thu, 13 Mar 2003 18:19:29 GMT
Hi all, I got a NullPointerException when executing dynaBean.set.

        final BasicDynaClass dynaClass = new BasicDynaClass(
            "myDynaClass", BasicDynaBean.class, new DynaProperty[] {
                new DynaProperty( "strArrayProp", String[].class ),
                new DynaProperty( "intArrayProp", Integer[].class )
            } );
        final BasicDynaBean dynaBean = (BasicDynaBean)
dynaClass.newInstance();
        dynaBean.set( "strArrayProp", 0, "Hello 0" );
        getLog().trace( "after second set: strArrayProp[0]=" +dynaBean.get
( "strArrayProp", 0 ) );

Did I use DynaBean wrong?
When I look at the BasicDynaBean implementation, looks like only the set
method for non-indexed property will check the DynaClass property
definition. I must be missing something.

Thanks.



Mime
View raw message