From notifications-return-5778-archive-asf-public=cust-asf.ponee.io@freemarker.apache.org Tue Oct 30 13:43:03 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3422D180652 for ; Tue, 30 Oct 2018 13:43:03 +0100 (CET) Received: (qmail 34115 invoked by uid 500); 30 Oct 2018 12:43:02 -0000 Mailing-List: contact notifications-help@freemarker.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.apache.org Delivered-To: mailing list notifications@freemarker.apache.org Received: (qmail 34106 invoked by uid 99); 30 Oct 2018 12:43:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2018 12:43:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E2AE61A3A43 for ; Tue, 30 Oct 2018 12:43:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Ft3O96OB1CkU for ; Tue, 30 Oct 2018 12:43:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id B8BDF5F1D3 for ; Tue, 30 Oct 2018 12:43:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 486A1E00E0 for ; Tue, 30 Oct 2018 12:43:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0A20B27762 for ; Tue, 30 Oct 2018 12:43:00 +0000 (UTC) Date: Tue, 30 Oct 2018 12:43:00 +0000 (UTC) From: "Amar Gurung (JIRA)" To: notifications@freemarker.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (FREEMARKER-106) Unable to parse variable containing special char ${# with freemarker.template.Template.process(object,writer) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FREEMARKER-106?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] Amar Gurung updated FREEMARKER-106: ----------------------------------- Description:=20 Unable to parse variable containing $\{# e.g=C2=A0${#marker_files[@]} or=C2= =A0$\{#array[@]} Sample snippet: ----------------------------- Configuration cfg =3D new Configuration(Configuration.VERSION_2_3_28); cfg.setLogTemplateExceptions(false); cfg.setClassForTemplateLoading(FtlExpressionEvaluator.class, "templates"); cfg.setDefaultEncoding("UTF-8"); cfg.setLocale(Locale.US); cfg.setTemplateExceptionHandler(TemplateExceptionHandler.IGNORE_HANDLER); cfg.setNumberFormat("0.######"); Template t =3D new Template("freeMarkerTemplate", new StringReader(line), c= fg); =C2=A0 Error stack: freemarker.core.ParseException: Syntax error in template "freeMarkerTemplat= e" in line 1, column 13: Lexical error: encountered "m" (109), after "#". at freemarker.core.TokenMgrError.toParseException(TokenMgrError.java:260) at freemarker.template.Template.(Template.java:269) at freemarker.template.Template.(Template.java:203) at freemarker.template.Template.(Template.java:182) at freemarker.template.Template.(Template.java:125) =C2=A0 was: Unable to parse variable containing ${# e.g=C2=A0${#marker_files[@]} or=C2= =A0${#array[@]} Sample snippet: ----------------------------- Configuration cfg =3D new Configuration(Configuration.VERSION_2_3_28); cfg.setLogTemplateExceptions(false); cfg.setClassForTemplateLoading(FtlExpressionEvaluator.class, "templates"); cfg.setDefaultEncoding("UTF-8"); cfg.setLocale(Locale.US); cfg.setTemplateExceptionHandler(TemplateExceptionHandler.IGNORE_HANDLER); cfg.setNumberFormat("0.######"); Template t =3D new Template("freeMarkerTemplate", new StringReader(line), c= fg); =C2=A0 > Unable to parse variable containing special char ${# with freemarker.temp= late.Template.process(object,writer) > -------------------------------------------------------------------------= ------------------------------------ > > Key: FREEMARKER-106 > URL: https://issues.apache.org/jira/browse/FREEMARKER-106 > Project: Apache Freemarker > Issue Type: Bug > Components: engine > Affects Versions: 2.3.23 > Reporter: Amar Gurung > Priority: Major > > Unable to parse variable containing $\{# e.g=C2=A0${#marker_files[@]} or= =C2=A0$\{#array[@]} > Sample snippet: > ----------------------------- > Configuration cfg =3D new Configuration(Configuration.VERSION_2_3_28); > cfg.setLogTemplateExceptions(false); > cfg.setClassForTemplateLoading(FtlExpressionEvaluator.class, "templates"= ); > cfg.setDefaultEncoding("UTF-8"); > cfg.setLocale(Locale.US); > cfg.setTemplateExceptionHandler(TemplateExceptionHandler.IGNORE_HANDLER)= ; > cfg.setNumberFormat("0.######"); > Template t =3D new Template("freeMarkerTemplate", new StringReader(line),= cfg); > =C2=A0 > Error stack: > freemarker.core.ParseException: Syntax error in template "freeMarkerTempl= ate" in line 1, column 13: > Lexical error: encountered "m" (109), after "#". > at freemarker.core.TokenMgrError.toParseException(TokenMgrError.java:260= ) > at freemarker.template.Template.(Template.java:269) > at freemarker.template.Template.(Template.java:203) > at freemarker.template.Template.(Template.java:182) > at freemarker.template.Template.(Template.java:125) > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)