You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Maoxiang Qian (JIRA)" <ji...@apache.org> on 2016/03/15 16:25:33 UTC
[jira] [Created] (GROOVY-7790) Put the value in get method with
default value
Maoxiang Qian created GROOVY-7790:
-------------------------------------
Summary: Put the value in get method with default value
Key: GROOVY-7790
URL: https://issues.apache.org/jira/browse/GROOVY-7790
Project: Groovy
Issue Type: Bug
Components: groovy-runtime
Reporter: Maoxiang Qian
I'm not sure whether it was designed, but it seems to be weird.
groovy> imap=['a':1, 'b':2]
groovy> if(imap.get('c',null)==null){
groovy> }
groovy> imap.each{k, v ->
groovy> println "${k}:${v}"
groovy> }
a:1
b:2
c:null
Result: [a:1, b:2, c:null]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)