[ 
https://issues.apache.org/jira/browse/GROOVY-7790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jochen Theodorou updated GROOVY-7790:
-------------------------------------
    Description: 
I'm not sure whether it was designed, but it seems to be weird.
{code:Java}
groovy> imap=['a':1, 'b':2] 
groovy> if(imap.get('c',null)==null){ } 
groovy> imap.each{k, v -> println "${k}:${v}" } 

a:1
b:2
c:null
Result: [a:1, b:2, c:null]{code}

  was:
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> imap.each{k, v -> println "${k}:${v}" } 

a:1
b:2
c:null
Result: [a:1, b:2, c:null]


> 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.
> {code:Java}
> groovy> imap=['a':1, 'b':2] 
> groovy> if(imap.get('c',null)==null){ } 
> groovy> imap.each{k, v -> println "${k}:${v}" } 
> a:1
> b:2
> c:null
> Result: [a:1, b:2, c:null]{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to