Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-410

No bean defined exception with mapped properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Invalid
    • 1.8.3
    • 1.9.5
    • Bean / Property Utils
    • All Operating Systems

    Description

      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 ".".

      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);
      	}
      
      }
      
      		MappedBean testeBean = new MappedBean();
      		Map<String, String> properties = new HashMap<String, String>();
      		properties.put("teste(abc)_new_value", "1234");
      		BeanUtils.populate(testeBean, properties);
      
      

      Attachments

        1. BEANUTILS-410-TestCase.patch
          2 kB
          Benedikt Ritter

        Activity

          People

            britter Benedikt Ritter
            danielmelobrasil DANIEL BRASIL
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: