[ 
https://issues.apache.org/jira/browse/BEANUTILS-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marco Benuzzi updated BEANUTILS-388:
------------------------------------

    Description: 
Stub generated from wsdl by wsimport (ant task com.sun.tools.ws.ant.WsImport) 
have some properties defined with Boolean class and getter method is...() 
instead of get...().
Using WrapDynaBean to inspect classes which contain those Boolean give 
NoSuchMethodException.
Below a test code which show the problem with property "c"

In my opinion this code should work.

{noformat}
public class Custom {
        
        public static class Test {
                private Integer a;
                private Boolean b;
                private Boolean c;
                public Integer getA() {
                        return a;
                }
                public void setA(Integer a) {
                        this.a = a;
                }
                public Boolean getB() {
                        return b;
                }
                public void setB(Boolean b) {
                        this.b = b;
                }
                public Boolean isC() {
                        return c;
                }
                public void setC(Boolean c) {
                        this.c = c;
                }
                
        }
        
        public static void main(String[] args) {
                try {
                        Test object = new Test();
                        object.setA(100);
                        object.setB(true);
                        DynaBean dynaBean = new WrapDynaBean(object);
                        for (DynaProperty propDesc : 
dynaBean.getDynaClass().getDynaProperties()) {
                            System.out.println("name = " + propDesc.getName());
                            System.out.println("class = " + 
propDesc.getType().getName());
                            System.out.println("value = " + 
dynaBean.get(propDesc.getName()));
                        }
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }
}
{noformat}

  was:
Stub generated from wsdl by wsimport (ant task com.sun.tools.ws.ant.WsImport) 
have some properties defined with Boolean class and getter method is...() 
instead of get...().
Using WrapDynaBean to inspect classes which contain those Boolean give 
NoSuchMethodException.
Below a test code which show the problem with property "c"

In my opinion this code should work.

public class Custom {
        
        public static class Test {
                private Integer a;
                private Boolean b;
                private Boolean c;
                public Integer getA() {
                        return a;
                }
                public void setA(Integer a) {
                        this.a = a;
                }
                public Boolean getB() {
                        return b;
                }
                public void setB(Boolean b) {
                        this.b = b;
                }
                public Boolean isC() {
                        return c;
                }
                public void setC(Boolean c) {
                        this.c = c;
                }
                
        }
        
        public static void main(String[] args) {
                try {
                        Test object = new Test();
                        object.setA(100);
                        object.setB(true);
                        DynaBean dynaBean = new WrapDynaBean(object);
                        for (DynaProperty propDesc : 
dynaBean.getDynaClass().getDynaProperties()) {
                            System.out.println("name = " + propDesc.getName());
                            System.out.println("class = " + 
propDesc.getType().getName());
                            System.out.println("value = " + 
dynaBean.get(propDesc.getName()));
                        }
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }
}


> WrapDynaBean should handle Boolean property with is...() getter
> ---------------------------------------------------------------
>
>                 Key: BEANUTILS-388
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-388
>             Project: Commons BeanUtils
>          Issue Type: Bug
>    Affects Versions: 1.8.3
>         Environment: Linux 2.6.35.11-83.fc14.i686.PAE
>            Reporter: Marco Benuzzi
>
> Stub generated from wsdl by wsimport (ant task com.sun.tools.ws.ant.WsImport) 
> have some properties defined with Boolean class and getter method is...() 
> instead of get...().
> Using WrapDynaBean to inspect classes which contain those Boolean give 
> NoSuchMethodException.
> Below a test code which show the problem with property "c"
> In my opinion this code should work.
> {noformat}
> public class Custom {
>       
>       public static class Test {
>               private Integer a;
>               private Boolean b;
>               private Boolean c;
>               public Integer getA() {
>                       return a;
>               }
>               public void setA(Integer a) {
>                       this.a = a;
>               }
>               public Boolean getB() {
>                       return b;
>               }
>               public void setB(Boolean b) {
>                       this.b = b;
>               }
>               public Boolean isC() {
>                       return c;
>               }
>               public void setC(Boolean c) {
>                       this.c = c;
>               }
>               
>       }
>       
>       public static void main(String[] args) {
>               try {
>                       Test object = new Test();
>                       object.setA(100);
>                       object.setB(true);
>                       DynaBean dynaBean = new WrapDynaBean(object);
>                       for (DynaProperty propDesc : 
> dynaBean.getDynaClass().getDynaProperties()) {
>                           System.out.println("name = " + propDesc.getName());
>                           System.out.println("class = " + 
> propDesc.getType().getName());
>                           System.out.println("value = " + 
> dynaBean.get(propDesc.getName()));
>                       }
>               } catch (Exception e) {
>                       e.printStackTrace();
>               }
>       }
> }
> {noformat}

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to