[ http://jira.xwiki.org/jira/browse/XWIKI-361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ricardo RodrÃguez updated XWIKI-361: ------------------------------------ Attachment: groovy-all-1.5.1.jar Embeddable Groovy .jar 1.5.1. A new 1.5.2 is due in a few days. I will test it and keep this issue posted. > The ".each()" instruction doesn't work > -------------------------------------- > > Key: XWIKI-361 > URL: http://jira.xwiki.org/jira/browse/XWIKI-361 > Project: XWiki Platform > Issue Type: Bug > Components: Scripting - Groovy > Affects Versions: 0.9.1252 > Reporter: Philippe Kernevez > Fix For: Future > > Attachments: groovy-all-1.5.1.jar > > > This script doesn't print anything in XWiki and work perfect in groovy > {noformat} > import java.util.Date > class Measure{ > def Measure(Date pDate, int pPercent) { > mDate = pDate > mPercent = pPercent > } > Date mDate > int mPercent > } > myMeasures = [] > myMeasures << new Measure(new Date(106, 10, 9), 23) > myMeasures << new Measure(new Date(106, 10, 13), 23) > myMeasures << new Measure(new Date(106, 10, 15), 23) > myMeasures = myMeasures.sort{a,b -> a.mDate <=> b.mDate} > myMeasures.each{laVar -> println ""+laVar.mDate+"|"+laVar.mPercent} > {noformat} > The "for( x in myMeasures)" syntaxe works for a workaround. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.xwiki.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira _______________________________________________ notifications mailing list notifications@xwiki.org http://lists.xwiki.org/mailman/listinfo/notifications