You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "DANIEL BRASIL (Created) (JIRA)" <ji...@apache.org> on 2012/01/26 21:13:40 UTC

[jira] [Created] (BEANUTILS-410) No bean defined exception with mapped properties

No bean defined exception with mapped properties
------------------------------------------------

                 Key: BEANUTILS-410
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-410
             Project: Commons BeanUtils
          Issue Type: Bug
          Components: Bean / Property Utils
    Affects Versions: 1.8.3
         Environment: All Operating Systems
            Reporter: DANIEL BRASIL
            Priority: Blocker


The following code throws an exception. The same code does not throw exception at 1.7.0 version. 

The code tries to set property "_new_value" on bean "teste(abc)". It's not the correct behavior since the property accessor notation is ".".

{Code}

import java.util.HashMap;
import java.util.Map;

public class MappedBean {

	public Map<String, String> teste = new HashMap<String, String>();

	public String getTeste(String key) {
		return this.teste.get(key);
	}

	public void setTeste(String key, String value) {
		this.teste.put(key, value);
	}

}
{Code}

{Code}
		MappedBean testeBean = new MappedBean();
		Map<String, String> properties = new HashMap<String, String>();
		properties.put("teste(abc)_new_value", "1234");
		BeanUtils.populate(testeBean, properties);

{Code}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira