rohithvegesna opened a new issue, #16347:
URL: https://github.com/apache/dubbo/issues/16347

   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Dubbo Version
   
   `3.3` branch (current HEAD, `3.3.7-SNAPSHOT`). Introduced in #14924.
   
   ### Steps to reproduce this issue
   
   `StringUtils.toBoolean("off")` returns `Boolean.TRUE`.
   
   The method's Javadoc states it supports `'on'/'off'` as a boolean pair, and 
every other
   falsy token is parsed correctly. Only `"off"` is wrong:
   
   ```
   on=true   off=true(!)   yes=true   no=false   true=true   false=false   
1=true   0=false
   ```
   
   ### What you expected to happen
   
   `StringUtils.toBoolean("off")` should return `Boolean.FALSE` (the antonym of 
`"on"`).
   
   ### Root cause
   
   In `StringUtils.toBoolean` the `case 3` branch returns `Boolean.TRUE` for 
`"off"`, copy-pasted
   from the adjacent `"yes"` branch.
   
   ### Impact
   
   `toBoolean` backs Triple REST argument binding (`GeneralTypeConverter`) and 
REST/OpenAPI config
   parsing (`ConfigFactory`, `Helper`), so a value of `"off"` is interpreted as 
`true` in those paths.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to