You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Simone Tripodi (JIRA)" <ji...@apache.org> on 2012/06/08 17:46:25 UTC

[jira] [Resolved] (SANDBOX-397) [BeanUtils2] Replace NullPointerExceptions been thrown in DefaultBeanAccessor with NoSuchMethodEceptions

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

Simone Tripodi resolved SANDBOX-397.
------------------------------------

    Resolution: Fixed

The idea was generally *good* - the {{Properties}} class helped to maintain code simple and straightforward - what I did to improve the proposed patch:

 * fixed s/Descirptor/Descriptor typos ;)

 * s/Properties/DefaultBeanProperties

 * dropped useless {{else}} branches;

 * introduced a static method to check not null methods (DRY principle);

 * extracted an interface from {{DefaultBeanProperties}}, {{BeanProperties}};

 * moved the {{of(Class)}} method from {{Properties}} to {{ClassAccessor}}

 * moved {{is(Readable|Writable)}} from {{BeanAccessor}} to {{BeanProperties}} it is more canonical (and removed useless {{else}} branches here too)

 * adapted {{is(Readable|Writable)TestCase}} and {{VoidMethodsTestCase}}

please have a look at r1348122 to see how APIs look now.

I am not totally satisfied about methods such as {{get(Indexed)(Read|Write)PropertyDescriptor()}}, I think I'll replace them in order to return directly the Reader/Writer methods.

nice job, and thanks for contributing!
-Simo
                
> [BeanUtils2] Replace NullPointerExceptions been thrown in DefaultBeanAccessor with NoSuchMethodEceptions
> --------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-397
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-397
>             Project: Commons Sandbox
>          Issue Type: Task
>          Components: BeanUtils2
>    Affects Versions: Nightly Builds
>            Reporter: Benedikt Ritter
>            Assignee: Simone Tripodi
>         Attachments: SANDBOX-397.txt, SANDBOX-397_SRP.txt, SANDBOX-397_SRPv2.txt
>
>
> At the moment, methods in {{DefaultBeanAccessor}} throw a {{NullPointerException}}, if no {{PropertyDescriptor}} for a given property name can be retrieved. As discussed on the ML (see http://markmail.org/thread/zlehclmybp5xgn5n) this behavior should be changed to throwing {{NoSuchMethodException}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira