eric-milles opened a new pull request #1686:
URL: https://github.com/apache/groovy/pull/1686


   Wrapping `NamedParam` annotations in a `NamedParams` container is 
straightforward.  For default values, I wanted to use `map.containsKey(name) ? 
map.name : defaultValue` instead of `map.name ? map.name : defaultValue` -- in 
case `null` or `0` or another falsy value is supplied.  This change does not 
give the map a chance to supply a default value, but I thought that was okay in 
order to allow user to supply falsy value explicitly.
   
   @paulk-asert  One case that was hard to understand comes form the `record` 
tests.  The example has `null` passed for an `int` and results in `0` whereas 
this code produces a cast exception.  I wanted to understand if that was 
desired or just a happy accident.
   ```groovy
   assert new ColoredPoint(x: 0, y: null).toString() == 'ColoredPoint[x=0, y=0, 
color=white]'
   ```
   
   https://issues.apache.org/jira/browse/GROOVY-10484
   https://issues.apache.org/jira/browse/GROOVY-10176
   https://issues.apache.org/jira/browse/GROOVY-9158


-- 
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]


Reply via email to