Re: [patch] Fix boolean support for "y", as used by torque

Daniel Rall <[email protected]> 25 Aug 2003 08:47:06 -0700
Newsgroups gmane.comp.db.village.devel
Message-ID <[email protected]>
Scott Eade <[email protected]> writes:

> The patch below provides for "y" as a true value - this is the
> value used by torque.
> 
> I have tested this locally using the torque runtime tests - I
> wrote a new test case to highlight this problem.
> 
> Cheers,
> 
> Scott
> 
> -- 
> Scott Eade
> Backstage Technologies Pty. Ltd.
> http://www.backstagetech.com.au
> 
> 
> Index: Value.java
> ===================================================================
> RCS file: /home/cvspublic/village/com/workingdogs/village/Value.java,v
> retrieving revision 1.19
> diff -u -r1.19 Value.java
> --- Value.java    25 Jun 2003 15:28:05 -0000    1.19
> +++ Value.java    25 Aug 2003 06:16:01 -0000
> @@ -1203,13 +1203,14 @@
>      }
>        /**
> 
> -     * @return true if (true || t | yes | 1)
> +     * @return true if (true | t | yes | y | 1)
>       */
>      private boolean isTrue(String value)
>      {
>          return (value.equalsIgnoreCase ("true") ||
>                  value.equalsIgnoreCase ("t") ||
>                  value.equalsIgnoreCase ("yes") ||
> +                value.equalsIgnoreCase ("y") ||
>                  value.equals ("1"));
>      }
>  }

Reviewed, +1 on this patch.  Handling this at the Village layer makes
more sense than having to deal with it at the application layer.
-- 

Daniel Rall