[ 
https://issues.apache.org/jira/browse/GROOVY-8018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15733212#comment-15733212
 ] 

dariusan commented on GROOVY-8018:
----------------------------------

I see, the returned value or default in the map could be a closure. Ok then 
this is not a bug. 

> map with default value creates entry on MissingMethodException
> --------------------------------------------------------------
>
>                 Key: GROOVY-8018
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8018
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.5
>            Reporter: dariusan
>
> Calling an inexisting method on a map with default values leads to an 
> Exception and alters the content that map:
> {code}
> def map=[:].withDefault{[]}
> try{
>   map.inExistingMethod()  
> }catch(e){
>   println e
> } finally {
>   println map
> }
> {code}
> outputs the following:
> {code}
> groovy.lang.MissingMethodException: No signature of method: 
> groovy.lang.MapWithDefault.inExistingMethod() is applicable for argument 
> types: () values: []
> [inExistingMethod:[]]
> {code}
> where throwing an Exception is ok but not altering the content of the map



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

Reply via email to