[ https://issues.apache.org/jira/browse/FREEMARKER-87?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16331706#comment-16331706 ]
Yanming Zhou edited comment on FREEMARKER-87 at 1/19/18 4:09 AM: ----------------------------------------------------------------- There is another problem, I try to make workaround, {code:java} <#list map as key,value><#if ['size','values','keySet']?seq_contains(key)><#assign value=map.get(key)/></#if>${value}</#list> {code} Variable value cannot be reassigned, is it a bug or designed feature? was (Author: quaff): There is another problem, I try to make workaround, {code:java} <#list map as key,value><#assign value=map.get(key)/>${value}</#list> {code} Variable value cannot be reassigned, is it a bug or designed feature? > <#list map as key,value> should always iterating on map entries > --------------------------------------------------------------- > > Key: FREEMARKER-87 > URL: https://issues.apache.org/jira/browse/FREEMARKER-87 > Project: Apache Freemarker > Issue Type: Bug > Components: engine > Affects Versions: 2.3.27-incubating > Reporter: Yanming Zhou > Priority: Major > Attachments: MapIteratingTest.java > > > I'm using struts2, use FriendlyMapModel instead of default MapModel, It works > fine except map have key such as "size", the value will be unexpected > SimpleMethodModel, I think freemarker should always use entry value for > directive <#list map as key,value>, not matter how MapModel works, MapModel > should only affect map.size and map.get('size'). > I attached a test case. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)