Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CDE09200BE0 for ; Sat, 3 Dec 2016 00:31:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CBA2F160B27; Fri, 2 Dec 2016 23:31:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1ECC9160B24 for ; Sat, 3 Dec 2016 00:31:05 +0100 (CET) Received: (qmail 25034 invoked by uid 500); 2 Dec 2016 23:31:05 -0000 Mailing-List: contact notifications-help@freemarker.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.incubator.apache.org Delivered-To: mailing list notifications@freemarker.incubator.apache.org Received: (qmail 25021 invoked by uid 99); 2 Dec 2016 23:31:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2016 23:31:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id BE41BC002D for ; Fri, 2 Dec 2016 23:31:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id QwoPFLmdlJsV for ; Fri, 2 Dec 2016 23:31:01 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 1FE695FBEE for ; Fri, 2 Dec 2016 23:30:59 +0000 (UTC) Received: (qmail 23364 invoked by uid 99); 2 Dec 2016 23:30:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2016 23:30:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 91BC42C1F56 for ; Fri, 2 Dec 2016 23:30:58 +0000 (UTC) Date: Fri, 2 Dec 2016 23:30:58 +0000 (UTC) From: "David Greene (JIRA)" To: notifications@freemarker.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FREEMARKER-42) ?first sequence operator does not work for SortedSets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 02 Dec 2016 23:31:07 -0000 [ https://issues.apache.org/jira/browse/FREEMARKER-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15716854#comment-15716854 ] David Greene commented on FREEMARKER-42: ---------------------------------------- That makes sense. I figured it was something along those lines and the fix might be something like sequence.iterator().next() regardless of underlying type. I would suspect that it would be just fine (and expected) that a HashSet would have an unpredictable order instead of throwing an exception. > ?first sequence operator does not work for SortedSets > ----------------------------------------------------- > > Key: FREEMARKER-42 > URL: https://issues.apache.org/jira/browse/FREEMARKER-42 > Project: Apache Freemarker > Issue Type: Bug > Affects Versions: 2.3.23 > Environment: JBoss, Linux, JDK8 > Reporter: David Greene > Priority: Minor > > ?first should work for SortedSets given that there's an actual .first() method on the object. > Offending line of code: > {code} > "><@s.text name=key /> > {code} > Working alternative: > {code} > "><@s.text name=key /> > {code} > Stacktrace: > {code} > 10:45:00,549 ERROR [freemarker.runtime] (http-0.0.0.0:8443-1) Error executing FreeMarker template: freemarker.template.TemplateModelException: Underlying collection is not a list, it's java.util.TreeSet > ---- > FTL stack trace ("~" means nesting-related): > - Failed at: @s.url action="index" report=(reports... [in template "mx/widgets/modules/reports/menu/headeradminnavmenu.ftl" at line 12, column 18] > - Reached through: @mx inc="menu/headeradminnavmenu" [in template "mx/macros/widgets.ftl" in macro "moduleHeaderWide" at line 667, column 13] > - Reached through: @_widgets.moduleHeaderWide module="re... [in template "mx/widgets/modules/reports/header.ftl" at line 1, column 1] > - Reached through: @mx inc="header" [in template "mx/decorators/default.ftl" at line 14, column 9] > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)