[ 
https://issues.apache.org/jira/browse/SHINDIG-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12663170#action_12663170
 ] 

Henning Schmiedehausen commented on SHINDIG-836:
------------------------------------------------

I assume this is also a case of "be liberal of what you accept, be strict of 
what you send out".

In the Stax parser proposal I actually used BooleanUtils.toBoolean(String) 
(http://commons.apache.org/lang/api-release/org/apache/commons/lang/BooleanUtils.html#toBoolean(java.lang.String)),
 which allows for

BooleanUtils.toBoolean(null)    = false
   BooleanUtils.toBoolean("true")  = true
   BooleanUtils.toBoolean("TRUE")  = true
   BooleanUtils.toBoolean("tRUe")  = true
   BooleanUtils.toBoolean("on")    = true
   BooleanUtils.toBoolean("yes")   = true
   BooleanUtils.toBoolean("false") = false
   BooleanUtils.toBoolean("x gti") = false
 
Especially without a stable XSD to validate gadgets against, I fully assume to 
see things like 'scrolling="no"' instead of 'scrolling="false"' all the time. 
Silently correcting this might be a good move in the long run. 

> Wrong parsing of boolean values
> -------------------------------
>
>                 Key: SHINDIG-836
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-836
>             Project: Shindig
>          Issue Type: Bug
>          Components: Gadget Rendering Server (Java)
>            Reporter: Vincent Siveton
>             Fix For: trunk, 1.0.x-incubating
>
>         Attachments: SHINDIG-836.patch
>
>
> The code contains wrong boolean parsing, ie
> {noformat}
> "true".equals(XXX)
> {noformat}

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

Reply via email to