You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Tim Ellison <t....@gmail.com> on 2007/09/28 17:09:40 UTC

[classlib][beans] Functional regression (was: Re: [jira] Created: (HARMONY-4861) [classlib][beans] PropertyDescriptor.getReadMethod() violates spec)

Andrey has submitted a fix for this functional test suite regression,
and the fix looks good to me.  Would somebody else check it and support
fixing it in M3?

Thanks,
Tim

Andrey Pavlenko (JIRA) wrote:
> [classlib][beans] PropertyDescriptor.getReadMethod() violates spec
> ------------------------------------------------------------------
> 
>                  Key: HARMONY-4861
>                  URL: https://issues.apache.org/jira/browse/HARMONY-4861
>              Project: Harmony
>           Issue Type: Bug
>           Components: Classlib
>             Reporter: Andrey Pavlenko
> 
> 
> According to JavaBeans API specification v1.01 §8.3.2 introspector should use "is" methods for reading boolean properties prior to "get".
> The following test demonstrates the issue:
> 
> import java.beans.IntrospectionException;
> import java.beans.Introspector;
> import java.beans.PropertyDescriptor;
> 
> public class Test {
> 
> 	public static class TestBean {
> 		boolean prop1;
> 
> 		public boolean isProp1() {
> 			return prop1;
> 		}
> 
> 		public boolean getProp1() {
> 			return prop1;
> 		}
> 	}
> 
> 	public static void main(String[] args) throws IntrospectionException {
> 		PropertyDescriptor[] propertyDescriptors = Introspector.getBeanInfo(
> 				TestBean.class).getPropertyDescriptors();
> 
> 		for (PropertyDescriptor d : propertyDescriptors) {
> 			if (d.getName().equals("prop1")
> 					&& (!d.getReadMethod().getName().equals("isProp1"))) {
> 				System.err.println("FAILED");
> 				return;
> 			}
> 		}
> 
> 		System.err.println("PASSED");
> 	}
> }
> 
> 

Re: [classlib][beans] Functional regression

Posted by Alexei Zakharov <al...@gmail.com>.
Applied!
Alexei

2007/9/28, Tim Ellison <t....@gmail.com>:
> Alexei Zakharov wrote:
> > As I've already responded in other thread IMO the fix is Ok and I'm +1
> > for  committing it.
>
> +1  go for it!
>
> Tim
>
> > Thanks,
> > Alexei
> >
> > 2007/9/28, Tim Ellison <t....@gmail.com>:
> >> Andrey has submitted a fix for this functional test suite regression,
> >> and the fix looks good to me.  Would somebody else check it and support
> >> fixing it in M3?
> >>
> >> Thanks,
> >> Tim
> >>
> >> Andrey Pavlenko (JIRA) wrote:
> >>> [classlib][beans] PropertyDescriptor.getReadMethod() violates spec
> >>> ------------------------------------------------------------------
> >>>
> >>>                  Key: HARMONY-4861
> >>>                  URL: https://issues.apache.org/jira/browse/HARMONY-4861
> >>>              Project: Harmony
> >>>           Issue Type: Bug
> >>>           Components: Classlib
> >>>             Reporter: Andrey Pavlenko
> >>>
> >>>
> >>> According to JavaBeans API specification v1.01 §8.3.2 introspector should use "is" methods for reading boolean properties prior to "get".
> >>> The following test demonstrates the issue:
> >>>
> >>> import java.beans.IntrospectionException;
> >>> import java.beans.Introspector;
> >>> import java.beans.PropertyDescriptor;
> >>>
> >>> public class Test {
> >>>
> >>>       public static class TestBean {
> >>>               boolean prop1;
> >>>
> >>>               public boolean isProp1() {
> >>>                       return prop1;
> >>>               }
> >>>
> >>>               public boolean getProp1() {
> >>>                       return prop1;
> >>>               }
> >>>       }
> >>>
> >>>       public static void main(String[] args) throws IntrospectionException {
> >>>               PropertyDescriptor[] propertyDescriptors = Introspector.getBeanInfo(
> >>>                               TestBean.class).getPropertyDescriptors();
> >>>
> >>>               for (PropertyDescriptor d : propertyDescriptors) {
> >>>                       if (d.getName().equals("prop1")
> >>>                                       && (!d.getReadMethod().getName().equals("isProp1"))) {
> >>>                               System.err.println("FAILED");
> >>>                               return;
> >>>                       }
> >>>               }
> >>>
> >>>               System.err.println("PASSED");
> >>>       }
> >>> }

Re: [classlib][beans] Functional regression

Posted by Tim Ellison <t....@gmail.com>.
Alexei Zakharov wrote:
> As I've already responded in other thread IMO the fix is Ok and I'm +1
> for  committing it.

+1  go for it!

Tim

> Thanks,
> Alexei
> 
> 2007/9/28, Tim Ellison <t....@gmail.com>:
>> Andrey has submitted a fix for this functional test suite regression,
>> and the fix looks good to me.  Would somebody else check it and support
>> fixing it in M3?
>>
>> Thanks,
>> Tim
>>
>> Andrey Pavlenko (JIRA) wrote:
>>> [classlib][beans] PropertyDescriptor.getReadMethod() violates spec
>>> ------------------------------------------------------------------
>>>
>>>                  Key: HARMONY-4861
>>>                  URL: https://issues.apache.org/jira/browse/HARMONY-4861
>>>              Project: Harmony
>>>           Issue Type: Bug
>>>           Components: Classlib
>>>             Reporter: Andrey Pavlenko
>>>
>>>
>>> According to JavaBeans API specification v1.01 §8.3.2 introspector should use "is" methods for reading boolean properties prior to "get".
>>> The following test demonstrates the issue:
>>>
>>> import java.beans.IntrospectionException;
>>> import java.beans.Introspector;
>>> import java.beans.PropertyDescriptor;
>>>
>>> public class Test {
>>>
>>>       public static class TestBean {
>>>               boolean prop1;
>>>
>>>               public boolean isProp1() {
>>>                       return prop1;
>>>               }
>>>
>>>               public boolean getProp1() {
>>>                       return prop1;
>>>               }
>>>       }
>>>
>>>       public static void main(String[] args) throws IntrospectionException {
>>>               PropertyDescriptor[] propertyDescriptors = Introspector.getBeanInfo(
>>>                               TestBean.class).getPropertyDescriptors();
>>>
>>>               for (PropertyDescriptor d : propertyDescriptors) {
>>>                       if (d.getName().equals("prop1")
>>>                                       && (!d.getReadMethod().getName().equals("isProp1"))) {
>>>                               System.err.println("FAILED");
>>>                               return;
>>>                       }
>>>               }
>>>
>>>               System.err.println("PASSED");
>>>       }
>>> }
>>>
> 

Re: [classlib][beans] Functional regression (was: Re: [jira] Created: (HARMONY-4861) [classlib][beans] PropertyDescriptor.getReadMethod() violates spec)

Posted by Alexei Zakharov <al...@gmail.com>.
As I've already responded in other thread IMO the fix is Ok and I'm +1
for  committing it.

Thanks,
Alexei

2007/9/28, Tim Ellison <t....@gmail.com>:
> Andrey has submitted a fix for this functional test suite regression,
> and the fix looks good to me.  Would somebody else check it and support
> fixing it in M3?
>
> Thanks,
> Tim
>
> Andrey Pavlenko (JIRA) wrote:
> > [classlib][beans] PropertyDescriptor.getReadMethod() violates spec
> > ------------------------------------------------------------------
> >
> >                  Key: HARMONY-4861
> >                  URL: https://issues.apache.org/jira/browse/HARMONY-4861
> >              Project: Harmony
> >           Issue Type: Bug
> >           Components: Classlib
> >             Reporter: Andrey Pavlenko
> >
> >
> > According to JavaBeans API specification v1.01 §8.3.2 introspector should use "is" methods for reading boolean properties prior to "get".
> > The following test demonstrates the issue:
> >
> > import java.beans.IntrospectionException;
> > import java.beans.Introspector;
> > import java.beans.PropertyDescriptor;
> >
> > public class Test {
> >
> >       public static class TestBean {
> >               boolean prop1;
> >
> >               public boolean isProp1() {
> >                       return prop1;
> >               }
> >
> >               public boolean getProp1() {
> >                       return prop1;
> >               }
> >       }
> >
> >       public static void main(String[] args) throws IntrospectionException {
> >               PropertyDescriptor[] propertyDescriptors = Introspector.getBeanInfo(
> >                               TestBean.class).getPropertyDescriptors();
> >
> >               for (PropertyDescriptor d : propertyDescriptors) {
> >                       if (d.getName().equals("prop1")
> >                                       && (!d.getReadMethod().getName().equals("isProp1"))) {
> >                               System.err.println("FAILED");
> >                               return;
> >                       }
> >               }
> >
> >               System.err.println("PASSED");
> >       }
> > }
> >