I've a strange issue with the PropertyUtils.getProperty(bean, fieldName)
method, where I got a java.lang.NoShuchMethodException
.
Suppose we have a simple java class called pojo:
public class Pojo {
public java.util.Date aDate;
public java.util.Date theDate;
public Pojo(){}
}
and a caller class like
public class TestPojo{
public static void main(String[] args){
Pojo p = new Pojo();
p.setADate(new Date());
p.setTheDate(new Date());
PropertyUtils.getProperty(p, "theDate");
PropertyUtils.getProperty(p, "aDate");
}
}
The first PropertyUtils.getProperty
call works fine, and the second one will throw
the NoSuchMethodExeption
.
I would like to know if I'm missing something stupid or it's really a bug :)