freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject incubator-freemarker git commit: Removed some @Deprecated members/classes. Some notes:
Date Mon, 20 Feb 2017 17:55:53 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 6f5aabd64 -> 7deda0105


Removed some @Deprecated members/classes. Some notes:

- strict_bean_models configuration setting was removed, as it should be set on the BeansWrapper itself
- .template_name now means the same as .current_template_name (it doesn't emulate 2.3 glitches anymore)


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/7deda010
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/7deda010
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/7deda010

Branch: refs/heads/3
Commit: 7deda010545821f09a6d38086bd85d9f3f84b068
Parents: 6f5aabd
Author: ddekany <ddekany@apache.org>
Authored: Mon Feb 20 13:58:38 2017 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Mon Feb 20 18:55:42 2017 +0100

----------------------------------------------------------------------
 .../freemarker/core/ast/BuiltinVariable.java    |  10 +-
 .../org/apache/freemarker/core/ast/Comment.java |   8 +-
 .../freemarker/core/ast/Configurable.java       |  38 ------
 .../apache/freemarker/core/ast/DebugBreak.java  |  94 --------------
 .../apache/freemarker/core/ast/Environment.java |  51 ++------
 .../apache/freemarker/core/ast/Expression.java  |   6 +-
 .../freemarker/core/ast/FreeMarkerTree.java     | 126 -------------------
 .../freemarker/core/ast/MixedContent.java       |  16 ---
 .../freemarker/core/ast/ParseException.java     |  31 +----
 .../core/ast/TemplateConfiguration.java         |   6 -
 .../freemarker/core/ast/TemplateElement.java    |  34 -----
 .../freemarker/core/ast/TemplateObject.java     |   5 -
 .../freemarker/core/ast/TokenMgrError.java      |  12 --
 .../apache/freemarker/core/ast/_DebugBreak.java |  91 ++++++++++++++
 .../debug/impl/RmiDebuggedEnvironmentImpl.java  |  11 +-
 .../core/debug/impl/RmiDebuggerService.java     |  12 +-
 .../core/model/impl/beans/BeansWrapper.java     |  19 ---
 .../core/model/impl/dom/JaxenXPathSupport.java  |   5 +-
 src/main/javacc/FTL.jj                          |   2 +-
 src/manual/en_US/FM3-CHANGE-LOG.txt             |   3 +
 .../freemarker/core/ast/CamelCaseTest.java      |  12 +-
 .../ast/EnvironmentGetTemplateVariantsTest.java |  62 ++++-----
 .../ast/TemplateNameSpecialVariablesTest.java   |  48 +++----
 .../AbstractParallelIntrospectionTest.java      |   4 +-
 .../impl/beans/BeansWrapperCachesTest.java      |  10 +-
 .../model/impl/beans/BeansWrapperMiscTest.java  |  10 +-
 .../impl/beans/BeansWrapperReadOnlyTest.java    |   7 +-
 .../impl/beans/BeansWrapperSingletonsTest.java  |   1 -
 .../beans/BeansWrapperWithShortedMethods.java   |   3 +-
 .../org/apache/freemarker/test/TreeView.java    |  70 -----------
 30 files changed, 200 insertions(+), 607 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java b/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java
index dc29e7d..8cd22e5 100644
--- a/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java
+++ b/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java
@@ -200,16 +200,12 @@ final class BuiltinVariable extends Expression {
         if (name == CURRENT_NODE || name == NODE || name == CURRENT_NODE_CC) {
             return env.getCurrentVisitorNode();
         }
-        if (name == TEMPLATE_NAME || name == TEMPLATE_NAME_CC) {
-            // The behavior of env.getTemplate() was changed with IcI 2.3.22, but there was an unintended side effect
-            // of changing the behavior of .template_name, which was oms with IcI 2.3.23. IcI 2.3.22 deliberately
-            // remains broken.
-            return (new SimpleScalar(env.getTemplate230().getName()));
-        }
         if (name == MAIN_TEMPLATE_NAME || name == MAIN_TEMPLATE_NAME_CC) {
             return SimpleScalar.newInstanceOrNull(env.getMainTemplate().getName());
         }
-        if (name == CURRENT_TEMPLATE_NAME || name == CURRENT_TEMPLATE_NAME_CC) {
+        // [FM3] Some of these two should be removed.
+        if (name == CURRENT_TEMPLATE_NAME || name == CURRENT_TEMPLATE_NAME_CC
+                || name == TEMPLATE_NAME || name == TEMPLATE_NAME_CC) {
             return SimpleScalar.newInstanceOrNull(env.getCurrentTemplate().getName());
         }
         if (name == PASS) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/Comment.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Comment.java b/src/main/java/org/apache/freemarker/core/ast/Comment.java
index 95d56d4..fc13f54 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Comment.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Comment.java
@@ -22,13 +22,9 @@ package org.apache.freemarker.core.ast;
 import org.apache.freemarker.core.util._StringUtil;
 
 /**
- * <b>Internal API - subject to change:</b> A template element where the content is ignored, a Comment.
- * 
- * @deprecated This is an internal FreeMarker API with no backward compatibility guarantees, so you shouldn't depend on
- *             it.
+ * A template element where the content is ignored, a Comment.
  */
-@Deprecated
-public final class Comment extends TemplateElement {
+final class Comment extends TemplateElement {
 
     private final String text;
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/Configurable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Configurable.java b/src/main/java/org/apache/freemarker/core/ast/Configurable.java
index 374feb3..9975612 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Configurable.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Configurable.java
@@ -195,13 +195,6 @@ public class Configurable {
     public static final String URL_ESCAPING_CHARSET_KEY = URL_ESCAPING_CHARSET_KEY_SNAKE_CASE;
     
     /** Legacy, snake case ({@code like_this}) variation of the setting name. @since 2.3.23 */
-    public static final String STRICT_BEAN_MODELS_KEY_SNAKE_CASE = "strict_bean_models";
-    /** Modern, camel case ({@code likeThis}) variation of the setting name. @since 2.3.23 */
-    public static final String STRICT_BEAN_MODELS_KEY_CAMEL_CASE = "strictBeanModels";
-    /** Alias to the {@code ..._SNAKE_CASE} variation due to backward compatibility constraints. @since 2.3.22 */
-    public static final String STRICT_BEAN_MODELS_KEY = STRICT_BEAN_MODELS_KEY_SNAKE_CASE;
-    
-    /** Legacy, snake case ({@code like_this}) variation of the setting name. @since 2.3.23 */
     public static final String AUTO_FLUSH_KEY_SNAKE_CASE = "auto_flush";
     /** Modern, camel case ({@code likeThis}) variation of the setting name. @since 2.3.23 */
     public static final String AUTO_FLUSH_KEY_CAMEL_CASE = "autoFlush";
@@ -264,10 +257,6 @@ public class Configurable {
     /** Alias to the {@code ..._SNAKE_CASE} variation due to backward compatibility constraints. */
     public static final String AUTO_INCLUDE_KEY = AUTO_INCLUDE_KEY_SNAKE_CASE;
     
-    /** @deprecated Use {@link #STRICT_BEAN_MODELS_KEY} instead. */
-    @Deprecated
-    public static final String STRICT_BEAN_MODELS = STRICT_BEAN_MODELS_KEY;
-    
     private static final String[] SETTING_NAMES_SNAKE_CASE = new String[] {
         // Must be sorted alphabetically!
         API_BUILTIN_ENABLED_KEY_SNAKE_CASE,
@@ -290,7 +279,6 @@ public class Configurable {
         OUTPUT_ENCODING_KEY_SNAKE_CASE,
         SHOW_ERROR_TIPS_KEY_SNAKE_CASE,
         SQL_DATE_AND_TIME_TIME_ZONE_KEY_SNAKE_CASE,
-        STRICT_BEAN_MODELS_KEY,
         TEMPLATE_EXCEPTION_HANDLER_KEY_SNAKE_CASE,
         TIME_FORMAT_KEY_SNAKE_CASE,
         TIME_ZONE_KEY_SNAKE_CASE,
@@ -319,7 +307,6 @@ public class Configurable {
         OUTPUT_ENCODING_KEY_CAMEL_CASE,
         SHOW_ERROR_TIPS_KEY_CAMEL_CASE,
         SQL_DATE_AND_TIME_TIME_ZONE_KEY_CAMEL_CASE,
-        STRICT_BEAN_MODELS_KEY_CAMEL_CASE,
         TEMPLATE_EXCEPTION_HANDLER_KEY_CAMEL_CASE,
         TIME_FORMAT_KEY_CAMEL_CASE,
         TIME_ZONE_KEY_CAMEL_CASE,
@@ -361,16 +348,6 @@ public class Configurable {
     private boolean lazyAutoImportsSet;
     
     /**
-     * Creates a top-level configurable, one that doesn't inherit from a parent, and thus stores the default values.
-     * 
-     * @deprecated This shouldn't even be public; don't use it.
-     */
-    @Deprecated
-    public Configurable() {
-        this(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
-    }
-
-    /**
      * Intended to be called from inside FreeMarker only.
      * Creates a top-level configurable, one that doesn't inherit from a parent, and thus stores the default values.
      * Called by the {@link Configuration} constructor.
@@ -2249,9 +2226,6 @@ public class Configurable {
             } else if (URL_ESCAPING_CHARSET_KEY_SNAKE_CASE.equals(name)
                     || URL_ESCAPING_CHARSET_KEY_CAMEL_CASE.equals(name)) {
                 setURLEscapingCharset(value);
-            } else if (STRICT_BEAN_MODELS_KEY_SNAKE_CASE.equals(name)
-                    || STRICT_BEAN_MODELS_KEY_CAMEL_CASE.equals(name)) {
-                setStrictBeanModels(_StringUtil.getYesNo(value));
             } else if (AUTO_FLUSH_KEY_SNAKE_CASE.equals(name) || AUTO_FLUSH_KEY_CAMEL_CASE.equals(name)) {
                 setAutoFlush(_StringUtil.getYesNo(value));
             } else if (SHOW_ERROR_TIPS_KEY_SNAKE_CASE.equals(name) || SHOW_ERROR_TIPS_KEY_CAMEL_CASE.equals(name)) {
@@ -2339,18 +2313,6 @@ public class Configurable {
         }
         return tz;
     }
-
-    /**
-     * @deprecated Set this on the {@link ObjectWrapper} itself. 
-     */
-    @Deprecated
-    public void setStrictBeanModels(boolean strict) {
-	if (!(objectWrapper instanceof BeansWrapper)) {
-	    throw new IllegalStateException("The value of the " + OBJECT_WRAPPER_KEY +
-	            " setting isn't a " + BeansWrapper.class.getName() + ".");
-	}
-	((BeansWrapper) objectWrapper).setStrict(strict);
-    }
     
     protected Environment getEnvironment() {
         return this instanceof Environment

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/DebugBreak.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/DebugBreak.java b/src/main/java/org/apache/freemarker/core/ast/DebugBreak.java
deleted file mode 100644
index 6db9f09..0000000
--- a/src/main/java/org/apache/freemarker/core/ast/DebugBreak.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.core.ast;
-
-import java.io.IOException;
-
-import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.debug.impl.DebuggerService;
-
-/**
- * <b>Internal API - subject to change: A debug breakpoint inserted into the template</b> 
- * 
- * @deprecated This is an internal FreeMarker API with no backward compatibility guarantees, so you shouldn't depend on
- *             it.
- */
-@Deprecated
-public class DebugBreak extends TemplateElement {
-    public DebugBreak(TemplateElement nestedBlock) {
-        addChild(nestedBlock);
-        copyLocationFrom(nestedBlock);
-    }
-    
-    @Override
-    protected TemplateElement[] accept(Environment env) throws TemplateException, IOException {
-        if (!DebuggerService.suspendEnvironment(
-                env, getTemplate().getSourceName(), getChild(0).getBeginLine())) {
-            return getChild(0).accept(env);
-        } else {
-            throw new StopException(env, "Stopped by debugger");
-        }
-    }
-
-    @Override
-    protected String dump(boolean canonical) {
-        if (canonical) {
-            StringBuilder sb = new StringBuilder();
-            sb.append("<#-- ");
-            sb.append("debug break");
-            if (getChildCount() == 0) {
-                sb.append(" /-->");
-            } else {
-                sb.append(" -->");
-                sb.append(getChild(0).getCanonicalForm());                
-                sb.append("<#--/ debug break -->");
-            }
-            return sb.toString();
-        } else {
-            return "debug break";
-        }
-    }
-    
-    @Override
-    String getNodeTypeSymbol() {
-        return "#debug_break";
-    }
-
-    @Override
-    int getParameterCount() {
-        return 0;
-    }
-
-    @Override
-    Object getParameterValue(int idx) {
-        throw new IndexOutOfBoundsException();
-    }
-
-    @Override
-    ParameterRole getParameterRole(int idx) {
-        throw new IndexOutOfBoundsException();
-    }
-
-    @Override
-    boolean isNestedBlockRepeater() {
-        return false;
-    }
-        
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/Environment.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Environment.java b/src/main/java/org/apache/freemarker/core/ast/Environment.java
index 277a7a5..c0de302 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Environment.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Environment.java
@@ -165,7 +165,6 @@ public final class Environment extends Configurable {
     private final Namespace mainNamespace;
     private Namespace currentNamespace, globalNamespace;
     private HashMap<String, Namespace> loadedLibs;
-    private Configurable legacyParent; // [FM3] Get rid of this
 
     private boolean inAttemptBlock;
     private Throwable lastThrowable;
@@ -209,27 +208,6 @@ public final class Environment extends Configurable {
     }
 
     /**
-     * Despite its name it just returns {@link #getParent()}. If {@link Configuration#getIncompatibleImprovements()} is
-     * at least 2.3.22, then that will be the same as {@link #getMainTemplate()}. Otherwise the returned value follows
-     * the {@link Environment} parent switchings that occur at {@code #include}/{@code #import} and {@code #nested}
-     * directive calls, that is, it's not very meaningful outside FreeMarker internals.
-     * 
-     * @deprecated Use {@link #getMainTemplate()} instead (or {@link #getCurrentNamespace()} and then
-     *             {@link Namespace#getTemplate()}); the value returned by this method is often not what you expect when
-     *             it comes to macro/function invocations.
-     */
-    @Deprecated
-    public Template getTemplate() {
-        return (Template) getParent();
-    }
-
-    /** Returns the same value as pre-IcI 2.3.22 getTemplate() did. */
-    Template getTemplate230() {
-        Template legacyParent = (Template) this.legacyParent;
-        return legacyParent != null ? legacyParent : getTemplate();
-    }
-
-    /**
      * Returns the topmost {@link Template}, with other words, the one for which this {@link Environment} was created.
      * That template will never change, like {@code #include} or macro calls don't change it.
      * 
@@ -304,7 +282,7 @@ public final class Environment extends Configurable {
             clearCachedValues();
             try {
                 doAutoImportsAndIncludes(this);
-                visit(getTemplate().getRootTreeNode());
+                visit(getMainTemplate().getRootTreeNode());
                 // It's here as we must not flush if there was an exception.
                 if (getAutoFlush()) {
                     out.flush();
@@ -386,11 +364,7 @@ public final class Environment extends Configurable {
 
     private static final TemplateModel[] NO_OUT_ARGS = new TemplateModel[0];
 
-    /**
-     * @deprecated Should be internal API
-     */
-    @Deprecated
-    public void visit(final TemplateElement element,
+    void visit(final TemplateElement element,
             TemplateDirectiveModel directiveModel, Map args,
             final List bodyParameterNames) throws TemplateException, IOException {
         visit(new TemplateElement[] { element }, directiveModel, args, bodyParameterNames);
@@ -558,10 +532,6 @@ public final class Environment extends Configurable {
             currentMacroContext = invokingMacroContext.prevMacroContext;
             currentNamespace = invokingMacroContext.nestedContentNamespace;
 
-            final Configurable prevParent;
-            prevParent = getParent();
-            legacyParent = currentNamespace.getTemplate();
-
             localContextStack = invokingMacroContext.prevLocalContextStack;
             if (invokingMacroContext.nestedContentParameterNames != null) {
                 pushLocalContext(bodyCtx);
@@ -574,7 +544,6 @@ public final class Environment extends Configurable {
                 }
                 currentMacroContext = invokingMacroContext;
                 currentNamespace = getMacroNamespace(invokingMacroContext.getMacro());
-                legacyParent = prevParent;
                 localContextStack = prevLocalContextStack;
             }
         }
@@ -2472,13 +2441,13 @@ public final class Environment extends Configurable {
     }
 
     private Object getIncludedTemplateCustomLookupCondition() {
-        return getTemplate().getCustomLookupCondition();
+        return getCurrentTemplate().getCustomLookupCondition();
     }
 
     private String getIncludedTemplateEncoding() {
         String encoding;
         // [FM3] This branch shouldn't exist, as it doesn't make much sense to inherit encoding. But we have to keep BC.
-        encoding = getTemplate().getEncoding();
+        encoding = getCurrentTemplate().getEncoding();
         if (encoding == null) {
             encoding = configuration.getEncoding(getLocale());
         }
@@ -2496,15 +2465,9 @@ public final class Environment extends Configurable {
     public void include(Template includedTemplate)
             throws TemplateException, IOException {
         final Template prevTemplate;
-        prevTemplate = getTemplate();
-        legacyParent = includedTemplate;
 
         importMacros(includedTemplate);
-        try {
-            visit(includedTemplate.getRootTreeNode());
-        } finally {
-            legacyParent = prevTemplate;
-        }
+        visit(includedTemplate.getRootTreeNode());
     }
 
     /**
@@ -2792,7 +2755,7 @@ public final class Environment extends Configurable {
         private Template template;
 
         Namespace() {
-            template = Environment.this.getTemplate();
+            template = Environment.this.getMainTemplate();
         }
 
         Namespace(Template template) {
@@ -2803,7 +2766,7 @@ public final class Environment extends Configurable {
          * @return the Template object with which this Namespace is associated.
          */
         public Template getTemplate() {
-            return template == null ? Environment.this.getTemplate() : template;
+            return template == null ? Environment.this.getMainTemplate() : template;
         }
         
         void setTemplate(Template template) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/Expression.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Expression.java b/src/main/java/org/apache/freemarker/core/ast/Expression.java
index 0e28800..7f3c9bb 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Expression.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Expression.java
@@ -69,11 +69,7 @@ abstract public class Expression extends TemplateObject {
         }
     }
 
-    /**
-     * @deprecated At the moment FreeMarker has no API for this with backward-compatibility promises.
-     */
-    @Deprecated
-    public final TemplateModel getAsTemplateModel(Environment env) throws TemplateException {
+    final TemplateModel getAsTemplateModel(Environment env) throws TemplateException {
         return eval(env);
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/FreeMarkerTree.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/FreeMarkerTree.java b/src/main/java/org/apache/freemarker/core/ast/FreeMarkerTree.java
deleted file mode 100644
index 3710c44..0000000
--- a/src/main/java/org/apache/freemarker/core/ast/FreeMarkerTree.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.core.ast;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.swing.JTree;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreeNode;
-
-import org.apache.freemarker.core.Template;
-
-/**
- * Allows exposure of a FreeMarker template's AST as a Swing tree.
- * 
- * @deprecated Will be removed, as Swing classes aren't accessible on Google App Engine.
- */
-@Deprecated
-public class FreeMarkerTree extends JTree {
-    private static final long serialVersionUID = 1L;
-
-    private final Map nodeMap = new HashMap();
-    
-    public FreeMarkerTree(Template template) {
-        setTemplate(template);
-    }
-
-    private TreeNode getNode(TemplateElement element) {
-        TreeNode n = (TreeNode) nodeMap.get(element);
-        if (n != null) {
-            return n;
-        }
-        n = new TemplateElementTreeNode(element);
-        nodeMap.put(element, n);
-        return n;
-    }
-
-    public void setTemplate(Template template) {
-        setModel(new DefaultTreeModel(getNode(template.getRootTreeNode())));
-        invalidate();
-    }
-
-    @Override
-    public String convertValueToText(Object value, boolean selected,
-                                     boolean expanded, boolean leaf, int row,
-                                     boolean hasFocus) {
-        if (value instanceof TemplateElementTreeNode) {
-            return ((TemplateElementTreeNode) value).element.getDescription();
-        }
-        return value.toString();
-    }
-    
-    private class TemplateElementTreeNode implements TreeNode {
-        private final TemplateElement element;
-        
-        TemplateElementTreeNode(TemplateElement element) {
-            this.element = element;
-        }
-
-        @Override
-        public Enumeration children() {
-            final Enumeration e = element.children();
-            return new Enumeration() {
-                @Override
-                public boolean hasMoreElements() {
-                    return e.hasMoreElements();
-                }
-                @Override
-                public Object nextElement() {
-                    return getNode((TemplateElement) e.nextElement());
-                }
-            };
-        }
-
-        @Override
-        public boolean getAllowsChildren() {
-            return element.getAllowsChildren();
-        }
-
-        @Override
-        public TreeNode getChildAt(int childIndex) {
-            return getNode(element.getChildAt(childIndex));
-        }
-
-        @Override
-        public int getChildCount() {
-            return element.getChildCount();
-        }
-
-        @Override
-        public int getIndex(TreeNode node) {
-            return element.getIndex(((TemplateElementTreeNode) node).element);
-        }
-
-        @Override
-        public TreeNode getParent() {
-            return getNode(element.getParentElement());
-        }
-
-        @Override
-        public boolean isLeaf() {
-            return element.isLeaf();
-        }
-        
-        
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/MixedContent.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/MixedContent.java b/src/main/java/org/apache/freemarker/core/ast/MixedContent.java
index 5ab7416..cee20f4 100644
--- a/src/main/java/org/apache/freemarker/core/ast/MixedContent.java
+++ b/src/main/java/org/apache/freemarker/core/ast/MixedContent.java
@@ -30,22 +30,6 @@ final class MixedContent extends TemplateElement {
 
     MixedContent() { }
     
-    /**
-     * @deprecated Use {@link #addChild(TemplateElement)} instead.
-     */
-    @Deprecated
-    void addElement(TemplateElement element) {
-        addChild(element);
-    }
-
-    /**
-     * @deprecated Use {@link #addChild(int, TemplateElement)} instead.
-     */
-    @Deprecated
-    void addElement(int index, TemplateElement element) {
-        addChild(index, element);
-    }
-    
     @Override
     TemplateElement postParseCleanup(boolean stripWhitespace)
         throws ParseException {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/ParseException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/ParseException.java b/src/main/java/org/apache/freemarker/core/ast/ParseException.java
index d82a2b7..3f13654 100644
--- a/src/main/java/org/apache/freemarker/core/ast/ParseException.java
+++ b/src/main/java/org/apache/freemarker/core/ast/ParseException.java
@@ -79,10 +79,6 @@ public class ParseException extends IOException implements FMParserConstants {
      */
     protected String eol = _SecurityUtil.getSystemProperty("line.separator", "\n");
 
-    /** @deprecated Will be remove without replacement in 2.4. */
-    @Deprecated
-    protected boolean specialConstructor;  
-
     private String templateName;
 
     /**
@@ -101,7 +97,6 @@ public class ParseException extends IOException implements FMParserConstants {
             ) {
         super("");
         currentToken = currentTokenVal;
-        specialConstructor = true;
         expectedTokenSequences = expectedTokenSequencesVal;
         tokenImage = tokenImageVal;
         lineNumber = currentToken.next.beginLine;
@@ -131,7 +126,7 @@ public class ParseException extends IOException implements FMParserConstants {
      */
     @Deprecated
     public ParseException(String description, int lineNumber, int columnNumber) {
-        this(description, null, lineNumber, columnNumber, null);
+        this(description, (Template) null, lineNumber, columnNumber, 0, 0, null);
     }
 
     /**
@@ -156,30 +151,6 @@ public class ParseException extends IOException implements FMParserConstants {
     }
     
     /**
-     * @deprecated Use {@link #ParseException(String, Template, int, int, int, int)} instead, as IDE-s need the end
-     * position of the error too.
-     * @since 2.3.20
-     */
-    @Deprecated
-    public ParseException(String description, Template template, int lineNumber, int columnNumber) {
-        this(description, template, lineNumber, columnNumber, null);      
-    }
-
-    /**
-     * @deprecated Use {@link #ParseException(String, Template, int, int, int, int, Throwable)} instead, as IDE-s need
-     * the end position of the error too.
-     * @since 2.3.20
-     */
-    @Deprecated
-    public ParseException(String description, Template template, int lineNumber, int columnNumber, Throwable cause) {
-        this(description,
-                template == null ? null : template.getSourceName(),
-                        lineNumber, columnNumber,
-                        0, 0,
-                        cause);      
-    }
-
-    /**
      * @since 2.3.20
      */
     public ParseException(String description, Template template, Token tk) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java b/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
index 4e6b886..c106859 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
@@ -500,12 +500,6 @@ public final class TemplateConfiguration extends Configurable implements ParserC
     public boolean isRecognizeStandardFileExtensionsSet() {
         return recognizeStandardFileExtensions != null;
     }
-    
-    @Override
-    public void setStrictBeanModels(boolean strict) {
-        throw new UnsupportedOperationException(
-                "Setting strictBeanModels on " + TemplateConfiguration.class.getSimpleName() + " level isn't supported.");
-    }
 
     public String getEncoding() {
         return encoding != null ? encoding : getNonNullParentConfiguration().getDefaultEncoding();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java b/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java
index 3a69e9e..6778fc9 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java
@@ -184,14 +184,6 @@ abstract public class TemplateElement extends TemplateObject {
         return childCount == 0;
     }
 
-    /**
-     * @deprecated Meaningless; simply returns if the node currently has any child nodes.
-     */
-    @Deprecated
-    public boolean getAllowsChildren() {
-        return !isLeaf();
-    }
-
     public int getIndex(TemplateElement node) {
         for (int i = 0; i < childCount; i++) {
             if (childBuffer[i].equals(node)) {
@@ -215,22 +207,6 @@ abstract public class TemplateElement extends TemplateObject {
                 : Collections.enumeration(Collections.EMPTY_LIST);
     }
 
-    /**
-     * @deprecated Internal API - even internally, use {@link #getChild(int)} instead.
-     */
-    @Deprecated
-    public TemplateElement getChildAt(int index) {
-        if (childCount == 0) {
-            throw new IndexOutOfBoundsException("Template element has no children");
-        }
-        try {
-            return childBuffer[index];
-        } catch (ArrayIndexOutOfBoundsException e) {
-            // nestedElements was a List earlier, so we emulate the same kind of exception
-            throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + childCount);
-        }
-    }
-
     public void setChildAt(int index, TemplateElement element) {
         if (index < childCount && index >= 0) {
             childBuffer[index] = element;
@@ -240,16 +216,6 @@ abstract public class TemplateElement extends TemplateObject {
             throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + childCount);
         }
     }
-
-    /**
-     * The element whose child this element is, or {@code null} if this is the root node.
-     * 
-     * @deprecated Don't use in internal code either; use {@link #getParentElement()} there.
-     */
-    @Deprecated
-    public TemplateElement getParent() {
-        return parent;
-    }
     
     /**
      * The element whose child this element is, or {@code null} if this is the root node.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/TemplateObject.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TemplateObject.java b/src/main/java/org/apache/freemarker/core/ast/TemplateObject.java
index 6ad38cc..bd89f4b 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TemplateObject.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TemplateObject.java
@@ -20,7 +20,6 @@
 package org.apache.freemarker.core.ast;
 
 import org.apache.freemarker.core.Template;
-import org.apache.freemarker.core.ast.Token;
 
 /**
  * <b>Internal API - subject to change:</b> Represent a node in the parsed template (either a {@link Expression} or a
@@ -166,10 +165,6 @@ public abstract class TemplateObject {
         return true;
     }
 
-    /**
-     * @deprecated This method will be removed in FreeMarker 2.4 because of architectural changes!
-     */
-    @Deprecated
     public Template getTemplate() {
         return template;
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/TokenMgrError.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TokenMgrError.java b/src/main/java/org/apache/freemarker/core/ast/TokenMgrError.java
index 0759641..cdd1395 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TokenMgrError.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TokenMgrError.java
@@ -159,18 +159,6 @@ public String getMessage() {
       this.detail = detail;
       errorCode = reason;
    }
-
-   /**
-    * @since 2.3.20
-    * 
-    * @deprecated If you know the end position, use {@link #TokenMgrError(String, int, int, int, int, int)} instead.
-    */
-   @Deprecated
-public TokenMgrError(String detail, int reason, int errorLine, int errorColumn) {
-       this(detail, reason, errorLine, errorColumn, 0, 0);
-      endLineNumber = null;
-      endColumnNumber = null;
-    }
    
    /**
     * @since 2.3.21

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/ast/_DebugBreak.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/_DebugBreak.java b/src/main/java/org/apache/freemarker/core/ast/_DebugBreak.java
new file mode 100644
index 0000000..bb1feb6
--- /dev/null
+++ b/src/main/java/org/apache/freemarker/core/ast/_DebugBreak.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.freemarker.core.ast;
+
+import java.io.IOException;
+
+import org.apache.freemarker.core.TemplateException;
+import org.apache.freemarker.core.debug.impl.DebuggerService;
+
+/**
+ * Don't use this; used internally by FreeMarker, might changes without notice.
+ * A debug breakpoint inserted into the template 
+ */
+public class _DebugBreak extends TemplateElement {
+    public _DebugBreak(TemplateElement nestedBlock) {
+        addChild(nestedBlock);
+        copyLocationFrom(nestedBlock);
+    }
+    
+    @Override
+    protected TemplateElement[] accept(Environment env) throws TemplateException, IOException {
+        if (!DebuggerService.suspendEnvironment(
+                env, getTemplate().getSourceName(), getChild(0).getBeginLine())) {
+            return getChild(0).accept(env);
+        } else {
+            throw new StopException(env, "Stopped by debugger");
+        }
+    }
+
+    @Override
+    protected String dump(boolean canonical) {
+        if (canonical) {
+            StringBuilder sb = new StringBuilder();
+            sb.append("<#-- ");
+            sb.append("debug break");
+            if (getChildCount() == 0) {
+                sb.append(" /-->");
+            } else {
+                sb.append(" -->");
+                sb.append(getChild(0).getCanonicalForm());                
+                sb.append("<#--/ debug break -->");
+            }
+            return sb.toString();
+        } else {
+            return "debug break";
+        }
+    }
+    
+    @Override
+    String getNodeTypeSymbol() {
+        return "#debug_break";
+    }
+
+    @Override
+    int getParameterCount() {
+        return 0;
+    }
+
+    @Override
+    Object getParameterValue(int idx) {
+        throw new IndexOutOfBoundsException();
+    }
+
+    @Override
+    ParameterRole getParameterRole(int idx) {
+        throw new IndexOutOfBoundsException();
+    }
+
+    @Override
+    boolean isNestedBlockRepeater() {
+        return false;
+    }
+        
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java b/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java
index 267e224..370ee6f 100644
--- a/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java
+++ b/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java
@@ -313,9 +313,16 @@ class RmiDebuggedEnvironmentImpl extends RmiDebugModelImpl implements DebuggedEn
             if ("mainNamespace".equals(key)) {
                 return ((Environment) configurable).getMainNamespace();
             }
-            if ("template".equals(key)) {
+            if ("mainTemplate".equals(key)) {
                 try {
-                    return (TemplateModel) getCachedWrapperFor(((Environment) configurable).getTemplate());
+                    return (TemplateModel) getCachedWrapperFor(((Environment) configurable).getMainTemplate());
+                } catch (RemoteException e) {
+                    throw new TemplateModelException(e);
+                }
+            }
+            if ("currentTemplate".equals(key)) {
+                try {
+                    return (TemplateModel) getCachedWrapperFor(((Environment) configurable).getCurrentTemplate());
                 } catch (RemoteException e) {
                     throw new TemplateModelException(e);
                 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java b/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java
index 741b407..cc2f55b 100644
--- a/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java
+++ b/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java
@@ -36,7 +36,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.freemarker.core.Template;
-import org.apache.freemarker.core.ast.DebugBreak;
+import org.apache.freemarker.core.ast._DebugBreak;
 import org.apache.freemarker.core.ast.Environment;
 import org.apache.freemarker.core.ast.TemplateElement;
 import org.apache.freemarker.core.ast._CoreAPI;
@@ -191,7 +191,7 @@ extends
             return;
         }
         TemplateElement parent = _CoreAPI.getParentElement(te);
-        DebugBreak db = new DebugBreak(te);
+        _DebugBreak db = new _DebugBreak(te);
         // TODO: Ensure there always is a parent by making sure
         // that the root element in the template is always a MixedContent
         // Also make sure it doesn't conflict with anyone's code.
@@ -281,10 +281,10 @@ extends
         if (te == null) {
             return;
         }
-        DebugBreak db = null;
+        _DebugBreak db = null;
         while (te != null) {
-            if (te instanceof DebugBreak) {
-                db = (DebugBreak) te;
+            if (te instanceof _DebugBreak) {
+                db = (_DebugBreak) te;
                 break;
             }
             te = _CoreAPI.getParentElement(te);
@@ -337,7 +337,7 @@ extends
         int count = te.getChildCount();
         for (int i = 0; i < count; ++i) {
             TemplateElement child = _CoreAPI.getChildElement(te, i);
-            while (child instanceof DebugBreak) {
+            while (child instanceof _DebugBreak) {
                 TemplateElement dbchild = _CoreAPI.getChildElement(child, 0); 
                 te.setChildAt(i, dbchild);
                 child = dbchild;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java
index 3d1f841..25f80f3 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java
@@ -86,13 +86,6 @@ import org.slf4j.Logger;
 public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
     
     private static final Logger LOG = _CoreLogs.BEANS_WRAPPER;
-
-    /**
-     * @deprecated Use {@link ObjectWrapperAndUnwrapper#CANT_UNWRAP_TO_TARGET_CLASS} instead. It's not a public field
-     *             anyway.
-     */
-    @Deprecated
-    static final Object CAN_NOT_UNWRAP = ObjectWrapperAndUnwrapper.CANT_UNWRAP_TO_TARGET_CLASS;
     
     private static final Constructor<?> ENUMS_MODEL_CTOR = enumsModelCtor();
     
@@ -190,18 +183,6 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
     private final Version incompatibleImprovements;
     
     /**
-     * Creates a new instance with the incompatible-improvements-version specified in
-     * {@link Configuration#DEFAULT_INCOMPATIBLE_IMPROVEMENTS}.
-     * 
-     * @deprecated Use {@link BeansWrapperBuilder} or, in rare cases, {@link #BeansWrapper(Version)} instead.
-     */
-    @Deprecated
-    public BeansWrapper() {
-        this(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
-        // Attention! Don't change fields here, as the instance is possibly already visible to other threads.  
-    }
-    
-    /**
      * Use {@link BeansWrapperBuilder} instead of the public constructors if possible.
      * The main disadvantage of using the public constructors is that the instances won't share caches. So unless having
      * a private cache is your goal, don't use them. See 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java b/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java
index 94baa7d..25b6d23 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java
@@ -193,13 +193,14 @@ class JaxenXPathSupport implements XPathSupport {
         }
     };
 
+    // [FM3] Look into this "hidden" feature
     static Template getTemplate(String systemId) throws IOException {
         Environment env = Environment.getCurrentEnvironment();
-        String encoding = env.getTemplate().getEncoding();
+        String encoding = env.getCurrentTemplate().getEncoding(); // [FM3] Encoding shouldn't be inherited anymore
         if (encoding == null) {
             encoding = env.getConfiguration().getEncoding(env.getLocale());
         }
-        String templatePath = env.getTemplate().getName();
+        String templatePath = env.getCurrentTemplate().getName();
         int lastSlash = templatePath.lastIndexOf('/');
         templatePath = lastSlash == -1 ? "" : templatePath.substring(0, lastSlash + 1);
         systemId = env.toFullTemplateName(templatePath, systemId);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/main/javacc/FTL.jj
----------------------------------------------------------------------
diff --git a/src/main/javacc/FTL.jj b/src/main/javacc/FTL.jj
index 5679fbc..46f98a1 100644
--- a/src/main/javacc/FTL.jj
+++ b/src/main/javacc/FTL.jj
@@ -3938,7 +3938,7 @@ MixedContent MixedContent() :
             if (begin == null) {
                 begin = elem;
             }
-            mixedContent.addElement(elem);
+            mixedContent.addChild(elem);
         }
     )+
     {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/manual/en_US/FM3-CHANGE-LOG.txt
----------------------------------------------------------------------
diff --git a/src/manual/en_US/FM3-CHANGE-LOG.txt b/src/manual/en_US/FM3-CHANGE-LOG.txt
index a198052..742b80c 100644
--- a/src/manual/en_US/FM3-CHANGE-LOG.txt
+++ b/src/manual/en_US/FM3-CHANGE-LOG.txt
@@ -95,3 +95,6 @@ the FreeMarer 3 changelog here:
 - Even for setting values that are class names without following `()` or other argument list, the INSTANCE field and
   the builder class will be searched now, and used instead of the constructor of the class. Earlier they weren't for
   backward compatibility.
+- Removed several deprecated methods and constants. Some notes:
+  - strict_bean_models configuration setting was removed, as it should be set on the BeansWrapper itself
+  - .template_name now means the same as .current_template_name (it doesn't emulate 2.3 glitches anymore)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/core/ast/CamelCaseTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/CamelCaseTest.java b/src/test/java/org/apache/freemarker/core/ast/CamelCaseTest.java
index 6c82622..05db421 100644
--- a/src/test/java/org/apache/freemarker/core/ast/CamelCaseTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/CamelCaseTest.java
@@ -29,10 +29,6 @@ import java.util.Set;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.ast.BuiltIn;
-import org.apache.freemarker.core.ast.BuiltinVariable;
-import org.apache.freemarker.core.ast.HTMLOutputFormat;
-import org.apache.freemarker.core.ast.UndefinedOutputFormat;
 import org.apache.freemarker.core.util._StringUtil;
 import org.apache.freemarker.test.TemplateTest;
 import org.junit.Test;
@@ -48,8 +44,12 @@ public class CamelCaseTest extends TemplateTest {
         assertOutput("${.data_model?is_hash?c}", "true");
         assertOutput("${.localeObject.toString()}", "de_DE");
         assertOutput("${.locale_object.toString()}", "de_DE");
-        assertOutput("${.templateName?length}", "0");
-        assertOutput("${.template_name?length}", "0");
+        assertOutput("${.templateName!'null'}", "null");
+        assertOutput("${.template_name!'null'}", "null");
+        assertOutput("${.currentTemplateName!'null'}", "null");
+        assertOutput("${.current_template_name!'null'}", "null");
+        assertOutput("${.mainTemplateName!'null'}", "null");
+        assertOutput("${.main_template_name!'null'}", "null");
         assertOutput("${.outputEncoding}", "utf-8");
         assertOutput("${.output_encoding}", "utf-8");
         assertOutput("${.outputFormat}", UndefinedOutputFormat.INSTANCE.getName());

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java b/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java
index 1359f18..c390e6e 100644
--- a/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java
@@ -129,56 +129,56 @@ public class EnvironmentGetTemplateVariantsTest extends TemplateTest {
         setConfiguration(createConfiguration(Configuration.VERSION_3_0_0));
         assertOutputForNamed(
                 "main",
-                "<t=main ct=main mt=main>\n"
+                "<ct=main mt=main>\n"
                 + "---1---\n"
-                + "[imp: <t=main ct=imp mt=main>]\n"
+                + "[imp: <ct=imp mt=main>]\n"
                 + "---2---\n"
-                + "[impM: <t=main ct=imp mt=main>\n"
-                    + "{<t=main ct=main mt=main>}\n"
-                    + "[inc: <t=main ct=inc mt=main>\n"
-                        + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
-                        + "[incInc: <t=main ct=inc mt=main>\n"
-                            + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
+                + "[impM: <ct=imp mt=main>\n"
+                    + "{<ct=main mt=main>}\n"
+                    + "[inc: <ct=inc mt=main>\n"
+                        + "[incM: <ct=inc mt=main> {<ct=inc mt=main>}]\n"
+                        + "[incInc: <ct=inc mt=main>\n"
+                            + "[incM: <ct=inc mt=main> {<ct=inc mt=main>}]\n"
                         + "]\n"
                     + "]\n"
-                    + "[incM: <t=main ct=inc mt=main> {<t=main ct=imp mt=main>}]\n"
+                    + "[incM: <ct=inc mt=main> {<ct=imp mt=main>}]\n"
                 + "]\n"
                 + "---3---\n"
-                + "[inc: <t=main ct=inc mt=main>\n"
-                    + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
-                    + "[incInc: <t=main ct=inc mt=main>\n"
-                        + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
+                + "[inc: <ct=inc mt=main>\n"
+                    + "[incM: <ct=inc mt=main> {<ct=inc mt=main>}]\n"
+                    + "[incInc: <ct=inc mt=main>\n"
+                        + "[incM: <ct=inc mt=main> {<ct=inc mt=main>}]\n"
                     + "]\n"
                 + "]\n"
                 + "---4---\n"
-                + "[incM: <t=main ct=inc mt=main> {<t=main ct=main mt=main>}]\n"
+                + "[incM: <ct=inc mt=main> {<ct=main mt=main>}]\n"
                 + "---5---\n"
-                + "[inc2: <t=main ct=inc2 mt=main>\n"
-                    + "[impM: <t=main ct=imp mt=main>\n"
-                        + "{<t=main ct=inc2 mt=main>}\n"
-                        + "[inc: <t=main ct=inc mt=main>\n"
-                            + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
+                + "[inc2: <ct=inc2 mt=main>\n"
+                    + "[impM: <ct=imp mt=main>\n"
+                        + "{<ct=inc2 mt=main>}\n"
+                        + "[inc: <ct=inc mt=main>\n"
+                            + "[incM: <ct=inc mt=main> {<ct=inc mt=main>}]\n"
                         + "]\n"
-                        + "[incM: <t=main ct=inc mt=main> {<t=main ct=imp mt=main>}]\n"
+                        + "[incM: <ct=inc mt=main> {<ct=imp mt=main>}]\n"
                     + "]\n"
                 + "]\n"
                 + "---6---\n"
-                + "[impM2: <t=main ct=imp mt=main>\n"
-                    + "{<t=main ct=main mt=main>}\n"
-                    + "[imp2M: <t=main ct=imp2 mt=main> {<t=main ct=imp mt=main>}]\n"
+                + "[impM2: <ct=imp mt=main>\n"
+                    + "{<ct=main mt=main>}\n"
+                    + "[imp2M: <ct=imp2 mt=main> {<ct=imp mt=main>}]\n"
                 + "]\n"
                 + "---7---\n"
-                + "[inc3: <t=main ct=inc3 mt=main>\n"
-                    + "[mainM: <t=main ct=main mt=main> {<t=main ct=inc3 mt=main>} <t=main ct=main mt=main>]\n"
+                + "[inc3: <ct=inc3 mt=main>\n"
+                    + "[mainM: <ct=main mt=main> {<ct=inc3 mt=main>} <ct=main mt=main>]\n"
                 + "]\n"
                 + "[mainM: "
-                    + "<t=main ct=main mt=main> "
-                    + "{<t=main ct=main mt=main> <t=main ct=inc4 mt=main> <t=main ct=main mt=main>} "
-                    + "<t=main ct=main mt=main>"
+                    + "<ct=main mt=main> "
+                    + "{<ct=main mt=main> <ct=inc4 mt=main> <ct=main mt=main>} "
+                    + "<ct=main mt=main>"
                 + "]\n"
-                + "<t=main ct=main mt=main>\n"
+                + "<ct=main mt=main>\n"
                 + "---8---\n"
-                + "mainF: <t=main ct=main mt=main>, impF: <t=main ct=imp mt=main>, incF: <t=main ct=inc mt=main>\n"
+                + "mainF: <ct=main mt=main>, impF: <ct=imp mt=main>, incF: <ct=inc mt=main>\n"
                 .replaceAll("<t=\\w+", "<t=main"));
     }
 
@@ -205,7 +205,7 @@ public class EnvironmentGetTemplateVariantsTest extends TemplateTest {
             public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body)
                     throws TemplateException, IOException {
                 Writer out = env.getOut();
-                final String r = "<t=" + env.getTemplate().getName() + " ct=" + env.getCurrentTemplate().getName() + " mt="
+                final String r = "<ct=" + env.getCurrentTemplate().getName() + " mt="
                         + env.getMainTemplate().getName() + ">";
                 out.write(r);
                 env.setGlobalVariable("lastTNamesResult", new SimpleScalar(r));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java b/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java
index d5575aa..db06cf3 100644
--- a/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java
@@ -25,7 +25,6 @@ import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.templateresolver.TemplateLoader;
 import org.apache.freemarker.core.templateresolver.impl.StringTemplateLoader;
-import org.apache.freemarker.core.util._StringUtil;
 import org.apache.freemarker.test.TemplateTest;
 import org.junit.Before;
 import org.junit.Test;
@@ -77,35 +76,25 @@ public class TemplateNameSpecialVariablesTest extends TemplateTest {
     }
 
     private static final String PRINT_ALL_FTL
-            = "t=${.templateName}, ct=${.currentTemplateName!'-'}, mt=${.mainTemplateName!'-'}";
+            = "ct=${.currentTemplateName!'-'}, mt=${.mainTemplateName!'-'}";
     
     @Test
-    public void testTemplateName() throws IOException, TemplateException {
-        getConfiguration().setTemplateLoader(createTemplateLoader(".templateName"));
-        assertMainFtlOutput(false);
-    }
-
-    @Test
     public void testMainTemplateName() throws IOException, TemplateException {
         getConfiguration().setTemplateLoader(createTemplateLoader(".mainTemplateName"));
-        assertMainFtlOutput(true);
-    }
-
-    private void assertMainFtlOutput(boolean allMain) throws IOException, TemplateException {
-        String expected
-                = "In main: main.ftl\n"
-                + "In imp: imp.ftl\n"
+        assertOutputForNamed("main.ftl",
+                "In main: main.ftl\n"
+                + "In imp: main.ftl\n"
                 + "In main: main.ftl\n"
                 + "main.ftl\n"
                 + "{main.ftl}\n"
                 + "In imp call imp:\n"
                 + "main.ftl\n"
-                + "{imp.ftl}\n"
+                + "{main.ftl}\n"
                 + "After: main.ftl\n"
                 + "In main: main.ftl\n"
-                + "In inc: inc.ftl\n"
+                + "In inc: main.ftl\n"
                 + "In inc call imp:\n"
-                + "inc.ftl\n"
+                + "main.ftl\n"
                 + "{main.ftl}\n"
                 + "In main: main.ftl\n"
                 + "main.ftl\n"
@@ -113,12 +102,7 @@ public class TemplateNameSpecialVariablesTest extends TemplateTest {
                 + "In inc call imp:\n"
                 + "main.ftl\n"
                 + "{main.ftl}\n"
-                + "In main: main.ftl\n";
-        if (allMain) {
-            expected = _StringUtil.replace(expected, "imp.ftl", "main.ftl");
-            expected = _StringUtil.replace(expected, "inc.ftl", "main.ftl");
-        }
-        assertOutputForNamed("main.ftl", expected);
+                + "In main: main.ftl\n");
     }
 
     @Test
@@ -162,24 +146,24 @@ public class TemplateNameSpecialVariablesTest extends TemplateTest {
         
         // In nameless templates, the deprecated .templateName is "", but the new variables are missing values. 
         assertOutput(new Template(null, PRINT_ALL_FTL + "; <#include 'inc.ftl'>", getConfiguration()),
-                "t=, ct=-, mt=-; Inc: t=inc.ftl, ct=inc.ftl, mt=-");
+                "ct=-, mt=-; Inc: ct=inc.ftl, mt=-");
         
         assertOutput(new Template("foo.ftl", PRINT_ALL_FTL + "; <#include 'inc.ftl'>", getConfiguration()),
-                "t=foo.ftl, ct=foo.ftl, mt=foo.ftl; Inc: t=inc.ftl, ct=inc.ftl, mt=foo.ftl");
+                "ct=foo.ftl, mt=foo.ftl; Inc: ct=inc.ftl, mt=foo.ftl");
     }
 
     @Test
     public void testInInterpretTemplate() throws TemplateException, IOException {
         getConfiguration().setSharedVariable("t", PRINT_ALL_FTL);
         assertOutput(new Template("foo.ftl", PRINT_ALL_FTL + "; <@t?interpret />", getConfiguration()),
-                "t=foo.ftl, ct=foo.ftl, mt=foo.ftl; "
-                + "t=foo.ftl->anonymous_interpreted, ct=foo.ftl->anonymous_interpreted, mt=foo.ftl");
+                "ct=foo.ftl, mt=foo.ftl; "
+                + "ct=foo.ftl->anonymous_interpreted, mt=foo.ftl");
         assertOutput(new Template(null, PRINT_ALL_FTL + "; <@t?interpret />", getConfiguration()),
-                "t=, ct=-, mt=-; "
-                + "t=nameless_template->anonymous_interpreted, ct=nameless_template->anonymous_interpreted, mt=-");
+                "ct=-, mt=-; "
+                + "ct=nameless_template->anonymous_interpreted, mt=-");
         assertOutput(new Template("foo.ftl", PRINT_ALL_FTL + "; <@[t,'bar']?interpret />", getConfiguration()),
-                "t=foo.ftl, ct=foo.ftl, mt=foo.ftl; "
-                + "t=foo.ftl->bar, ct=foo.ftl->bar, mt=foo.ftl");
+                "ct=foo.ftl, mt=foo.ftl; "
+                + "ct=foo.ftl->bar, mt=foo.ftl");
     }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/core/model/impl/beans/AbstractParallelIntrospectionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/AbstractParallelIntrospectionTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/AbstractParallelIntrospectionTest.java
index 845bcc0..62c4251 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/AbstractParallelIntrospectionTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/AbstractParallelIntrospectionTest.java
@@ -19,11 +19,11 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
+import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateMethodModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 
 import junit.framework.TestCase;
 
@@ -35,7 +35,7 @@ public abstract class AbstractParallelIntrospectionTest extends TestCase {
     private static final int ITERATIONS = 20000;
     private static final double CACHE_CLEARING_CHANCE = 0.01;
     
-    private BeansWrapper beansWrapper = new BeansWrapper();
+    private BeansWrapper beansWrapper = new BeansWrapper(Configuration.VERSION_3_0_0);
     
     public AbstractParallelIntrospectionTest(String name) {
         super(name);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperCachesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperCachesTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperCachesTest.java
index dc8ae43..f0f3f21 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperCachesTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperCachesTest.java
@@ -19,13 +19,13 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.fail;
 
 import java.lang.ref.Reference;
 
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.ClassIntrospector;
-import org.apache.freemarker.core.model.impl.beans.MethodAppearanceFineTuner;
+import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapper.MethodAppearanceDecision;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapper.MethodAppearanceDecisionInput;
 import org.junit.Test;
@@ -37,7 +37,7 @@ public class BeansWrapperCachesTest {
 
     @Test
     public void introspectionSettingChanges() {
-        BeansWrapper bw = new BeansWrapper();
+        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0);
         ClassIntrospector ci1 = bw.getClassIntrospector();
         checkRegisteredModelFactories(ci1, bw.getStaticModels(), bw.getEnumModels(), bw.getModelCache());
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperMiscTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperMiscTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperMiscTest.java
index 095004b..0e2df93 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperMiscTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperMiscTest.java
@@ -19,11 +19,15 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
+import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateHashModel;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
@@ -33,7 +37,7 @@ public class BeansWrapperMiscTest {
 
     @Test
     public void booleans() throws Exception {
-        final BeansWrapper bw = new BeansWrapper();
+        final BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0);
 
         assertTrue(((TemplateBooleanModel) bw.wrap(Boolean.TRUE)).getAsBoolean());
         assertFalse(((TemplateBooleanModel) bw.wrap(Boolean.FALSE)).getAsBoolean());

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperReadOnlyTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperReadOnlyTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperReadOnlyTest.java
index 483ef66..2ab748f 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperReadOnlyTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperReadOnlyTest.java
@@ -25,10 +25,11 @@ import java.beans.PropertyDescriptor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
+import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
-import org.apache.freemarker.core.util._ClassUtil;
 import org.apache.freemarker.core.util.WriteProtectable;
+import org.apache.freemarker.core.util._ClassUtil;
 
 import junit.framework.TestCase;
 
@@ -45,13 +46,13 @@ public class BeansWrapperReadOnlyTest extends TestCase {
     }
     
     public void testBeansWrapper() throws Exception {
-        BeansWrapper bw = new BeansWrapper();
+        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0);
         bw.writeProtect();
         checkAllPropertiesReadOnly(bw);
     }
 
     public void testDefaultObjectWrapper() throws Exception {
-        BeansWrapper bw = new DefaultObjectWrapper();
+        BeansWrapper bw = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
         bw.writeProtect();
         checkAllPropertiesReadOnly(bw);        
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
index 4baf16a..20abf41 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
@@ -339,7 +339,6 @@ public class BeansWrapperSingletonsTest extends TestCase {
     }
     
     public void testClassInrospectorCache() throws TemplateModelException {
-        assertFalse(new BeansWrapper().isClassIntrospectionCacheRestricted());
         assertFalse(new BeansWrapper(Configuration.VERSION_3_0_0).isClassIntrospectionCacheRestricted());
         assertTrue(new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build().isClassIntrospectionCacheRestricted());
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java
index 6b5be38..1a4ea27 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java
@@ -20,8 +20,8 @@
 package org.apache.freemarker.core.model.impl.beans;
 
 
+import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 
 /**
  * Used so that the order in which the methods are added to the introspection cache is deterministic. 
@@ -29,6 +29,7 @@ import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 public abstract class BeansWrapperWithShortedMethods extends BeansWrapper {
     
     public BeansWrapperWithShortedMethods(boolean desc) {
+        super(Configuration.VERSION_3_0_0);
         setMethodSorter(new AlphabeticalMethodSorter(desc));
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7deda010/src/test/java/org/apache/freemarker/test/TreeView.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/TreeView.java b/src/test/java/org/apache/freemarker/test/TreeView.java
deleted file mode 100644
index 5aa8874..0000000
--- a/src/test/java/org/apache/freemarker/test/TreeView.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.test;
-
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.io.FileReader;
-
-import javax.swing.JFrame;
-import javax.swing.JScrollPane;
-import javax.swing.JTree;
-
-import org.apache.freemarker.core.Template;
-import org.apache.freemarker.core.ast.FreeMarkerTree;
-
-public class TreeView {
-
-    static public void main(String[] args) {
-        if (args.length == 0) {
-            usage();
-            return;
-        }
-        String filename = args[0];
-        Template t = null;
-        try {
-            t = new Template(filename, new FileReader(filename));
-        } catch (Exception e) {
-            e.printStackTrace();
-            return;
-        }
-        showTree(t);
-    }
-
-    static void showTree(Template t) {
-        JTree tree = new FreeMarkerTree(t);
-        JFrame jf = new JFrame(t.getName());
-        jf.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowClosing(WindowEvent e) {
-                System.exit(0);
-            }
-        });
-        JScrollPane scrollPane = new JScrollPane(tree);
-        jf.getContentPane().add(scrollPane);
-        jf.pack();
-        jf.show();
-    }
-
-    static void usage() {
-        System.err.println("little toy program to display a compiled template as a tree.");
-        System.err.println("Usage: java org.apache.freemarker.test.TreeView <templatefile>");
-    }
-}


Mime
View raw message