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

Paul King edited comment on GROOVY-8065 at 1/26/17 1:50 PM:
------------------------------------------------------------

Link possible cause - the idea was to make normal map semantics for put come 
into play when an attempt is made to "set" a read-only property for a map - the 
priority for the normal semantics path should have been lower than when a 
custom set method is encountered. I am just testing a fix the re-adjusts the 
priority.


was (Author: paulk):
Link possible cause

> Map created as org.springframework.http.HttpHeaders is empty in 2.4.8, works 
> fine in 2.4.7
> ------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-8065
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8065
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.8
>         Environment: Java 1.8.0_102
> OS X 10.10.5
>            Reporter: Andy Wilkinson
>
> There appears to be a regression in Groovy 2.4.8 that causes it to silently 
> create an empty map when it's asked to create it as an instance of Spring 
> Framework's {{HttpHeaders}}.
> Here's a minimal reproduction:
> {noformat}
> @Grab("org.springframework:spring-web:4.3.5.RELEASE")
> import org.springframework.http.HttpHeaders
> def headers = ['Content-Type'       : 'application.json',
>                'Content-Disposition': 'test.zip'] as HttpHeaders
> println headers
> {noformat}
> It works as expected with 2.4.7:
> {noformat}
> $ sdk use groovy 2.4.7 && groovy asHttpHeaders.groovy
> Using groovy version 2.4.7 in this shell.
> [Content-Type:[application.json], Content-Disposition:[test.zip]]
> {noformat}
> With 2.4.8 the map is empty:
> {noformat}
> $ sdk use groovy 2.4.8 && groovy asHttpHeaders.groovy
> Using groovy version 2.4.8 in this shell.
> [:]
> {noformat}



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

Reply via email to