DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28813>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28813

Can't use . (dot) in mapped properties for setProperty or getPropertyDescriptor





------- Additional Comments From [EMAIL PROTECTED]  2004-05-10 14:37 -------
Forgot to include test case. in PropertyUtilsTestCase:

    /**
     * Test setting mapped values with periods in the key.
     */
    public void testSetMappedPeriods() throws Exception
    {
        // String value
        PropertyUtils.setNestedProperty(bean,"mappedProperty(key.with.a.dot)",
"Special Value");
        assertEquals("Can retrieve directly",
                     "Special Value",
                     bean.getMappedProperty("key.with.a.dot"));

        // Object value
        PropertyUtils.setNestedProperty(bean,"mappedObjects(nested.property)",
new TestBean());
        assertNotNull("Can retrieve directly",
                      bean.getMappedObjects("nested.property"));
    }

    public void testGetPropertyTypeMappedPeriods() throws NoSuchMethodException,
IllegalAccessException, InvocationTargetException
    {
        PropertyUtils.setNestedProperty(bean,"mappedObjects(nested.property)",
new TestBean());
       
assertEquals(String.class,PropertyUtils.getPropertyType(bean,"mappedObjects(nested.property).stringProperty"));
    }

produces:


java.lang.IllegalArgumentException: Invalid mapped property 'mappedProperty(key'
        at
org.apache.commons.beanutils.PropertyUtils.getMappedProperty(PropertyUtils.java:564)
        at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1651)
        at
org.apache.commons.beanutils.PropertyUtilsTestCase.testSetMappedPeriods(PropertyUtilsTestCase.java:1118)

java.lang.IllegalArgumentException: Invalid mapped property 'mappedObjects(nested'
        at
org.apache.commons.beanutils.PropertyUtils.getMappedProperty(PropertyUtils.java:564)
        at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1651)
        at
org.apache.commons.beanutils.PropertyUtilsTestCase.testGetPropertyTypeMappedPeriods(PropertyUtilsTestCase.java:1131)

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

Reply via email to