Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
1.8.3
-
None
-
at least Java 1.6.0_33 on ubuntu
Description
Here is My testClass:
PropertyUtilsSetValueUTest.java
import org.apache.commons.beanutils.PropertyUtils; import org.junit.Test; public class PropertyUtilsSetValueUTest { @Test public void testSetProperty() throws Exception { final MyEntity entity = new MyEntity(); // fist set value manual final OtherEntity otherEntity = new OtherEntity(); entity.setOtherEntity(otherEntity); // second set value with PropertyUtils PropertyUtils.setProperty(entity, "otherEntity", otherEntity); // => java.lang.NoSuchMethodException: Property 'otherEntity' has no setter method in class '... MyEntity' } public static class MyEntity implements MyEntityInterface { private OtherEntity otherEntity; @Override public OtherEntity getOtherEntity() { return this.otherEntity; } public void setOtherEntity(final OtherEntity otherEntity) { this.otherEntity = otherEntity; } } public static class OtherEntity implements OtherEntityInterface { } public static interface MyEntityInterface { OtherEntityInterface getOtherEntity(); } public static interface OtherEntityInterface { } }