commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harald Brabenetz (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEANUTILS-443) PropertyUtils.setProperty(...) cannot find the Setter method if returnValue doesn't exact match the interface return value.
Date Wed, 17 Jul 2013 16:26:49 GMT

    [ https://issues.apache.org/jira/browse/BEANUTILS-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13711236#comment-13711236
] 

Harald Brabenetz commented on BEANUTILS-443:
--------------------------------------------

I made additional Tests:
It works with OpenJDK-1.6 and SunJDK 1.7.0_05
But it doesn't work with SunJDK 1.6.0_33

Can BeanUtils implement a workaround for this JDK 6 Bug?
The Documentation says it should support JDK 1.3+
"BeanUtils 1.8.x releases are binary compatible with version 1.7.0 and require a minimum of
JDK 1.3."
                
> PropertyUtils.setProperty(...) cannot find the Setter method if returnValue doesn't exact
match the interface return value.
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-443
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-443
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.3
>         Environment: at least Java 1.6.0_33 on ubuntu
>            Reporter: Harald Brabenetz
>            Priority: Critical
>
> Here is My testClass:
> {code:title=PropertyUtilsSetValueUTest.java|borderStyle=solid}
> 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 {
>     }
> }
> {code} 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message