freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Keller (JIRA)" <>
Subject [jira] [Created] (FREEMARKER-24) Support of default methods in objet model
Date Tue, 17 May 2016 10:12:12 GMT
Emmanuel Keller created FREEMARKER-24:

             Summary: Support of default methods in objet model
                 Key: FREEMARKER-24
             Project: Apache Freemarker
          Issue Type: Improvement
          Components: engine
    Affects Versions: 2.3.24
            Reporter: Emmanuel Keller
            Priority: Minor
             Fix For: 2.3.25

The default object method model currently does not support default methods:

Here is the current error:

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(
	at freemarker.core.UnexpectedTypeException.newDesciptionBuilder(
	at freemarker.core.UnexpectedTypeException.<init>(
	at freemarker.core.NonBooleanException.<init>(
	at freemarker.core.Expression.modelToBoolean(
	at freemarker.core.Expression.evalToBoolean(
	at freemarker.core.Expression.evalToBoolean(
	at freemarker.core.ConditionalBlock.accept(
	at freemarker.core.Environment.visit(
	at freemarker.core.MixedContent.accept(
	at freemarker.core.Environment.visitByHiddingParent(
	at freemarker.core.IteratorBlock$IterationContext.executeNestedBlockInner(
	at freemarker.core.IteratorBlock$IterationContext.executeNestedBlock(
	at freemarker.core.IteratorBlock$IterationContext.accept(
	at freemarker.core.Environment.visitIteratorBlock(
	at freemarker.core.IteratorBlock.acceptWithResult(
	at freemarker.core.IteratorBlock.accept(
	at freemarker.core.Environment.visit(
	at freemarker.core.MixedContent.accept(
	at freemarker.core.Environment.visit(
	at freemarker.core.Environment.process(
	at freemarker.template.Template.process(

To reproduce this.

1. Use an interface

public interface UpdatableTask extends Runnable {

    default boolean isSwitchable() {
        return false;

2. Use an object that implements this interface with the following template:

<#if task.switchable>

This message was sent by Atlassian JIRA

View raw message