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 94A1F200BC0 for ; Tue, 1 Nov 2016 03:41:30 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 93149160B06; Tue, 1 Nov 2016 02:41:30 +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 DA55D160B05 for ; Tue, 1 Nov 2016 03:41:29 +0100 (CET) Received: (qmail 39649 invoked by uid 500); 1 Nov 2016 02:41:29 -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 39640 invoked by uid 99); 1 Nov 2016 02:41:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2016 02:41:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 52754C0075 for ; Tue, 1 Nov 2016 02:41:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -7.018 X-Spam-Level: X-Spam-Status: No, score=-7.018 tagged_above=-999 required=6.31 tests=[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, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id pmY7_OAmnFY7 for ; Tue, 1 Nov 2016 02:41:26 +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 5F6235FAC5 for ; Tue, 1 Nov 2016 02:41:25 +0000 (UTC) Received: (qmail 95340 invoked by uid 99); 1 Nov 2016 02:21:00 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2016 02:21:00 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0C2362C2A68 for ; Tue, 1 Nov 2016 02:21:00 +0000 (UTC) Date: Tue, 1 Nov 2016 02:21:00 +0000 (UTC) From: "zhouyanming (JIRA)" To: notifications@freemarker.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FREEMARKER-24) Support of default methods in object model MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 01 Nov 2016 02:41:30 -0000 [ https://issues.apache.org/jira/browse/FREEMARKER-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15624086#comment-15624086 ] zhouyanming commented on FREEMARKER-24: --------------------------------------- [~ddekany] Can you make a workaround ASAP? > Support of default methods in object model > ------------------------------------------ > > Key: FREEMARKER-24 > URL: https://issues.apache.org/jira/browse/FREEMARKER-24 > Project: Apache Freemarker > Issue Type: Improvement > Components: engine > Affects Versions: 2.3.24-incubating > Reporter: Emmanuel Keller > Priority: Minor > > The default object method model currently does not support default methods: > https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html > Here is the current error: > {noformat} > FTL stack trace ("~" means nesting-related): > - Failed at: #if task.switchable [in template "...../home.ftl" at line 43, column 25] > ---- > at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131) > at freemarker.core.UnexpectedTypeException.newDesciptionBuilder(UnexpectedTypeException.java:77) > at freemarker.core.UnexpectedTypeException.(UnexpectedTypeException.java:40) > at freemarker.core.NonBooleanException.(NonBooleanException.java:44) > at freemarker.core.Expression.modelToBoolean(Expression.java:142) > at freemarker.core.Expression.evalToBoolean(Expression.java:125) > at freemarker.core.Expression.evalToBoolean(Expression.java:110) > at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:46) > at freemarker.core.Environment.visit(Environment.java:324) > at freemarker.core.MixedContent.accept(MixedContent.java:54) > at freemarker.core.Environment.visitByHiddingParent(Environment.java:345) > at freemarker.core.IteratorBlock$IterationContext.executeNestedBlockInner(IteratorBlock.java:240) > at freemarker.core.IteratorBlock$IterationContext.executeNestedBlock(IteratorBlock.java:220) > at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:194) > at freemarker.core.Environment.visitIteratorBlock(Environment.java:572) > at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:78) > at freemarker.core.IteratorBlock.accept(IteratorBlock.java:64) > at freemarker.core.Environment.visit(Environment.java:324) > at freemarker.core.MixedContent.accept(MixedContent.java:54) > at freemarker.core.Environment.visit(Environment.java:324) > at freemarker.core.Environment.process(Environment.java:302) > at freemarker.template.Template.process(Template.java:325) > at com.qwazr.tools.FreeMarkerTool.template(FreeMarkerTool.java:86) > at com.qwazr.tools.FreeMarkerTool.template(FreeMarkerTool.java:101) > {noformat} > To reproduce this. > 1. Use an interface > {code:java} > public interface UpdatableTask extends Runnable { > default boolean isSwitchable() { > return false; > } > } > {code} > 2. Use an object that implements this interface with the following template: > {code} > <#if task.switchable> > ... > > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)