You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2008/11/06 21:40:48 UTC

[jira] Updated: (LANG-458) Refactor Validate.java to eliminate code redundancy

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

Henri Yandell updated LANG-458:
-------------------------------

    Fix Version/s: 3.0
          Summary: Refactor Validate.java to eliminate code redundancy  (was: Add methods to return boolean from Validate.java instead of throwing IllegalArgumentException)

Renaming issue to match patches

> Refactor Validate.java to eliminate code redundancy
> ---------------------------------------------------
>
>                 Key: LANG-458
>                 URL: https://issues.apache.org/jira/browse/LANG-458
>             Project: Commons Lang
>          Issue Type: Improvement
>         Environment: software
>            Reporter: Viraj Turakhia
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: vaidate_diff.txt, validate_test_diff.txt
>
>
> I am using Validate.java since long and find it difficult to use when I just want to validate collections or string.
> With current interface, I go like this:
> while(cnt < list.size()) {
>     List list1 = list.get(cnt);
>     try {
>         Validate.notEmpty(list1);
>     } catch(IllegalArgumentException e) {
>         continue;
>     }
> }
> much better approach is:
> while(cnt < list.size()) {
>     List list1 = list.get(cnt);
>     try {
>     if(! Validate.notEmpty(list1)) {
>         continue;
>     }
> }
> If you all agree with this change, I am willing to submit a patch for this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.