commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (Updated) (JIRA)" <>
Subject [jira] [Updated] (SANDBOX-363) Check if value is of the correct type in Argument.argument( Class<T> type, V value )
Date Sat, 21 Jan 2012 16:13:40 GMT


Benedikt Ritter updated SANDBOX-363:

    Attachment: SANDBOX-363.txt

I have implemented a patch for this issue, but it breaks an existing unit test in CunstructorTestCase.
For some reason
argument(Boolean.class, Boolean.TRUE);
works just fine, while
argument(Boolean.TYPE, Boolean.TRUE);
will give us a IllegalArgumentException. Please have a look at the type checking I implemented
in Argument.

I also added some java doc to Argument and added some parameter validation to Argument.getParametersTypes().
For this, I added checkNoneIsNull(T[] referneces,...) to Assertions. It basically calls checkNotNull
on every reference in the given array.

At last but not least I extended the jUnit Test for Argument and started to implement a test
for Assertion (note that validation of correct errorMsg and errorArgs processing is missing

I know, this is a lot for one tiny patch, but I had a good run ;-)
> Check if value is of the correct type in Argument.argument( Class<T> type, V value
> ------------------------------------------------------------------------------------
>                 Key: SANDBOX-363
>                 URL:
>             Project: Commons Sandbox
>          Issue Type: Improvement
>          Components: BeanUtils2
>    Affects Versions: Nightly Builds
>            Reporter: Benedikt Ritter
>            Priority: Minor
>         Attachments: SANDBOX-363.txt
> Although the compiler should check that value is always of the correct type, a programmatic
check should back this up.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message