freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [1/7] incubator-freemarker git commit: `TemplateModelException` was removed, replaced with `TemplateException` on all places, except for `ObjectWrapper.wrap(Object)` and `wrapAsAPI(Object)`, which now throws `ObjectWrappingException` instead (that extend
Date Sat, 19 Aug 2017 23:36:35 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 f231e64fe -> d73da6da8


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java
b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java
index 2fec9cc..1679412 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java
@@ -22,10 +22,10 @@ package org.apache.freemarker.servlet;
 import javax.servlet.GenericServlet;
 import javax.servlet.ServletContext;
 
+import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
 
 /**
  * TemplateHashModel wrapper for a ServletContext attributes.
@@ -43,7 +43,7 @@ public final class ServletContextHashModel implements TemplateHashModel
{
     }
 
     @Override
-    public TemplateModel get(String key) throws TemplateModelException {
+    public TemplateModel get(String key) throws TemplateException {
         return wrapper.wrap(servletctx.getAttribute(key));
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
index 80f3f2b..438a622 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
@@ -46,10 +46,11 @@ import javax.servlet.jsp.PageContext;
 import javax.servlet.jsp.tagext.BodyContent;
 
 import org.apache.freemarker.core.Environment;
+import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.ObjectWrapperAndUnwrapper;
+import org.apache.freemarker.core.model.ObjectWrappingException;
 import org.apache.freemarker.core.model.TemplateHashModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateModelIterator;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.util.UndeclaredThrowableException;
@@ -72,7 +73,7 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
     private final ObjectWrapperAndUnwrapper wrapper;
     private JspWriter jspOut;
     
-    protected FreeMarkerPageContext() throws TemplateModelException {
+    protected FreeMarkerPageContext() throws TemplateException {
         environment = Environment.getCurrentEnvironment();
 
         TemplateModel appModel = environment.getGlobalVariable(
@@ -84,7 +85,7 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
         if (appModel instanceof ServletContextHashModel) {
             servlet = ((ServletContextHashModel) appModel).getServlet();
         } else {
-            throw new  TemplateModelException("Could not find an instance of " + 
+            throw new  TemplateException("Could not find an instance of " +
                     ServletContextHashModel.class.getName() + 
                     " in the data model under either the name " + 
                     FreemarkerServlet.KEY_APPLICATION_PRIVATE + " or " + 
@@ -105,7 +106,7 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
             ObjectWrapperAndUnwrapper ow = reqHash.getObjectWrapper();
             wrapper = (ObjectWrapperAndUnwrapper) ow;
         } else {
-            throw new  TemplateModelException("Could not find an instance of " + 
+            throw new  TemplateException("Could not find an instance of " +
                     HttpRequestHashModel.class.getName() + 
                     " in the data model under either the name " + 
                     FreemarkerServlet.KEY_REQUEST_PRIVATE + " or " + 
@@ -151,7 +152,7 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
                 try {
                     environment.setGlobalVariable(name, wrapper.wrap(value));
                     break;
-                } catch (TemplateModelException e) {
+                } catch (ObjectWrappingException e) {
                     throw new UndeclaredThrowableException(e);
                 }
             }
@@ -184,7 +185,7 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
             case PAGE_SCOPE: {
                 try {
                     return wrapper.unwrap(environment.getGlobalNamespace().get(name));
-                } catch (TemplateModelException e) {
+                } catch (TemplateException e) {
                     throw new UndeclaredThrowableException("Failed to unwrap FTL global variable",
e);
                 }
             }
@@ -270,7 +271,7 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
                 try {
                     return 
                         new TemplateHashModelExEnumeration(environment.getGlobalNamespace());
-                } catch (TemplateModelException e) {
+                } catch (TemplateException e) {
                     throw new UndeclaredThrowableException(e);
                 }
             }
@@ -434,7 +435,7 @@ public JspWriter pushBody(Writer w) {
     private static class TemplateHashModelExEnumeration implements Enumeration {
         private final TemplateModelIterator it;
             
-        private TemplateHashModelExEnumeration(TemplateHashModelEx hashEx) throws TemplateModelException
{
+        private TemplateHashModelExEnumeration(TemplateHashModelEx hashEx) throws TemplateException
{
             it = hashEx.keys().iterator();
         }
         
@@ -442,7 +443,7 @@ public JspWriter pushBody(Writer w) {
         public boolean hasMoreElements() {
             try {
                 return it.hasNext();
-            } catch (TemplateModelException tme) {
+            } catch (TemplateException tme) {
                 throw new UndeclaredThrowableException(tme);
             }
         }
@@ -451,7 +452,7 @@ public JspWriter pushBody(Writer w) {
         public Object nextElement() {
             try {
                 return ((TemplateScalarModel) it.next()).getAsString();
-            } catch (TemplateModelException tme) {
+            } catch (TemplateException tme) {
                 throw new UndeclaredThrowableException(tme);
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java
b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java
index 057dd65..6d66094 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/JspTagModelBase.java
@@ -38,10 +38,8 @@ import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core._DelayedJQuote;
 import org.apache.freemarker.core._DelayedShortClassName;
 import org.apache.freemarker.core._ErrorDescriptionBuilder;
-import org.apache.freemarker.core._TemplateModelException;
 import org.apache.freemarker.core.model.ObjectWrapperAndUnwrapper;
 import org.apache.freemarker.core.model.TemplateHashModelEx2;
-import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateModelWithOriginName;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
@@ -92,7 +90,7 @@ abstract class JspTagModelBase implements TemplateModelWithOriginName {
                                     e);
                         }
                     } else {
-                        throw new TemplateModelException("Unknown property "
+                        throw new TemplateException("Unknown property "
                                 + _StringUtils.jQuote(paramName.toString())
                                 + " on instance of " + tagClass.getName());
                     }
@@ -124,25 +122,25 @@ abstract class JspTagModelBase implements TemplateModelWithOriginName
{
                                     "<@my.box style=\"info\" message=\"Hello ${name}!\"
width=200 />",
                                     ".");
                         }
-                        throw new _TemplateModelException(e, null, desc);
+                        throw new TemplateException(e, null, desc);
                     }
                 }
             }
         }
     }
 
-    protected final TemplateModelException toTemplateModelExceptionOrRethrow(Throwable e)
-            throws TemplateModelException {
+    protected final TemplateException toTemplateExceptionOrRethrow(Throwable e)
+            throws TemplateException {
         if (e instanceof RuntimeException && !isCommonRuntimeException((RuntimeException)
e)) {
             throw (RuntimeException) e;
         }
-        if (e instanceof TemplateModelException) {
-            throw (TemplateModelException) e;
+        if (e instanceof TemplateException) {
+            throw (TemplateException) e;
         }
         if (e instanceof TemplateExceptionWrapperJspException) {
-            return (TemplateModelException) e.getCause();
+            return (TemplateException) e.getCause();
         }
-        return new _TemplateModelException(e,
+        return new TemplateException(e,
                 "Error while invoking the ", new _DelayedJQuote(tagName), " JSP custom tag;
see cause exception");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/PageContextFactory.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/PageContextFactory.java
b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/PageContextFactory.java
index eaf8747..67e867e 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/PageContextFactory.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/PageContextFactory.java
@@ -22,8 +22,8 @@ package org.apache.freemarker.servlet.jsp;
 import javax.servlet.jsp.PageContext;
 
 import org.apache.freemarker.core.Environment;
+import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.util.UndeclaredThrowableException;
 
 /**
@@ -45,7 +45,7 @@ class PageContextFactory {
         }
     }
 
-    static FreeMarkerPageContext getCurrentPageContext() throws TemplateModelException {
+    static FreeMarkerPageContext getCurrentPageContext() throws TemplateException {
         Environment env = Environment.getCurrentEnvironment();
         TemplateModel pageContextModel = env.getGlobalVariable(PageContext.PAGECONTEXT);
         if (pageContextModel instanceof FreeMarkerPageContext) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/SimpleTagDirectiveModel.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/SimpleTagDirectiveModel.java
b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/SimpleTagDirectiveModel.java
index b4f4a15..01bbfa4 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/SimpleTagDirectiveModel.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/SimpleTagDirectiveModel.java
@@ -102,7 +102,7 @@ class SimpleTagDirectiveModel extends JspTagModelBase implements TemplateDirecti
                 pageContext.popWriter();
             }
         } catch (Exception e) {
-            throw toTemplateModelExceptionOrRethrow(e);
+            throw toTemplateExceptionOrRethrow(e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TagDirectiveModel.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TagDirectiveModel.java
b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TagDirectiveModel.java
index 15db96d..d5705c8 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TagDirectiveModel.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TagDirectiveModel.java
@@ -31,14 +31,13 @@ import javax.servlet.jsp.tagext.SimpleTag;
 import javax.servlet.jsp.tagext.Tag;
 import javax.servlet.jsp.tagext.TryCatchFinally;
 
+import org.apache.freemarker.core.CallPlace;
 import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.ArgumentArrayLayout;
-import org.apache.freemarker.core.CallPlace;
 import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateHashModelEx2;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -82,7 +81,7 @@ class TagDirectiveModel extends JspTagModelBase implements TemplateDirectiveMode
                 // This is just a sanity check. If it were JDK 1.4-only,
                 // we'd use an assert.
                 if (out != pageContext.getOut()) {
-                    throw new TemplateModelException(
+                    throw new TemplateException(
                         "out != pageContext.getOut(). Out is " + 
                         out + " pageContext.getOut() is " +
                         pageContext.getOut());
@@ -112,7 +111,7 @@ class TagDirectiveModel extends JspTagModelBase implements TemplateDirectiveMode
                 bodyContent.close(); // Pops `topTag` and `writer`
             }
         } catch (Throwable e) {
-            throw toTemplateModelExceptionOrRethrow(e);
+            throw toTemplateExceptionOrRethrow(e);
         }
     }
 
@@ -159,7 +158,7 @@ class TagDirectiveModel extends JspTagModelBase implements TemplateDirectiveMode
         /**
          * @return Whether to execute the nested content (the body, with JSP terminology)
          */
-        private boolean doStartTag() throws TemplateModelException {
+        private boolean doStartTag() throws TemplateException {
             try {
                 int dst = tag.doStartTag();
                 switch(dst) {
@@ -180,7 +179,9 @@ class TagDirectiveModel extends JspTagModelBase implements TemplateDirectiveMode
                             btag.setBodyContent(this);
                             btag.doInitBody();
                         } else {
-                            throw new TemplateModelException("Can't buffer body since " +
tag.getClass().getName() + " does not implement BodyTag.");
+                            throw new TemplateException(
+                                    "Can't buffer body since " + tag.getClass().getName()
+                                    + " does not implement BodyTag.");
                         }
                         // Intentional fall-through
                     }
@@ -188,18 +189,19 @@ class TagDirectiveModel extends JspTagModelBase implements TemplateDirectiveMode
                         return true;
                     }
                     default: {
-                        throw new RuntimeException("Illegal return value " + dst + " from
" + tag.getClass().getName() + ".doStartTag()");
+                        throw new RuntimeException(
+                                "Illegal return value " + dst + " from " + tag.getClass().getName()
+ ".doStartTag()");
                     }
                 }
             } catch (Exception e) {
-                throw toTemplateModelExceptionOrRethrow(e);
+                throw toTemplateExceptionOrRethrow(e);
             }
         }
 
         /**
          * @return Whether to execute the nested content again (the body, with JSP terminology)
          */
-        private boolean doAfterBody() throws TemplateModelException {
+        private boolean doAfterBody() throws TemplateException {
             try {
                 if (isIterationTag) {
                     int dab = ((IterationTag) tag).doAfterBody();
@@ -210,13 +212,15 @@ class TagDirectiveModel extends JspTagModelBase implements TemplateDirectiveMode
                         case IterationTag.EVAL_BODY_AGAIN:
                             return true;
                         default:
-                            throw new TemplateModelException("Unexpected return value " +
dab + "from " + tag.getClass().getName() + ".doAfterBody()");
+                            throw new TemplateException(
+                                    "Unexpected return value " + dab + "from " + tag.getClass().getName()
+                                    + ".doAfterBody()");
                     }
                 }
                 endEvaluation();
                 return false;
             } catch (Exception e) {
-                throw toTemplateModelExceptionOrRethrow(e);
+                throw toTemplateExceptionOrRethrow(e);
             }
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java
b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java
index 6aaae12..d486772 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java
@@ -63,12 +63,12 @@ import javax.xml.parsers.SAXParserFactory;
 
 import org.apache.freemarker.core.ConfigurationException;
 import org.apache.freemarker.core.Environment;
+import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateFunctionModel;
 import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
 import org.apache.freemarker.core.util.BugException;
 import org.apache.freemarker.core.util.CommonBuilder;
@@ -236,7 +236,7 @@ public class TaglibFactory implements TemplateHashModel {
      *         {@link TemplateFunctionModel}, respectively.
      */
     @Override
-    public TemplateModel get(final String taglibUri) throws TemplateModelException {
+    public TemplateModel get(final String taglibUri) throws TemplateException {
         synchronized (lock) {
             {
                 final Taglib taglib = (Taglib) taglibs.get(taglibUri);
@@ -309,7 +309,7 @@ public class TaglibFactory implements TemplateHashModel {
                 }
             } catch (Exception e) {
                 String failedTLDsList = failedTldListAlreadyIncluded ? null : getFailedTLDsList();
-                throw new TemplateModelException(
+                throw new TemplateException(
                         "Error while looking for TLD file for " + _StringUtils.jQuoteNoXSS(taglibUri)
                         + "; see cause exception."
                         + (failedTLDsList == null
@@ -322,7 +322,7 @@ public class TaglibFactory implements TemplateHashModel {
             try {
                 return loadTaglib(tldLocation, normalizedTaglibUri);
             } catch (Exception e) {
-                throw new TemplateModelException("Error while loading tag library for URI
"
+                throw new TemplateException("Error while loading tag library for URI "
                         + _StringUtils.jQuoteNoXSS(normalizedTaglibUri) + " from TLD location
"
                         + _StringUtils.jQuoteNoXSS(tldLocation) + "; see cause exception.",
                         e);
@@ -914,7 +914,7 @@ public class TaglibFactory implements TemplateHashModel {
         try {
             reqHash = Environment.getCurrentEnvironment().getVariable(
                     FreemarkerServlet.KEY_REQUEST_PRIVATE);
-        } catch (TemplateModelException e) {
+        } catch (TemplateException e) {
             throw new TaglibGettingException("Failed to get FreemarkerServlet request information",
e);
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/_FreeMarkerPageContext21.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/_FreeMarkerPageContext21.java
b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/_FreeMarkerPageContext21.java
index be9d58a..674fa56 100644
--- a/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/_FreeMarkerPageContext21.java
+++ b/freemarker-servlet/src/main/java/org/apache/freemarker/servlet/jsp/_FreeMarkerPageContext21.java
@@ -31,7 +31,7 @@ import javax.servlet.jsp.el.ELException;
 import javax.servlet.jsp.el.ExpressionEvaluator;
 import javax.servlet.jsp.el.VariableResolver;
 
-import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.util._ClassUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -54,7 +54,7 @@ public class _FreeMarkerPageContext21 extends FreeMarkerPageContext {
                 JspFactory.getDefaultFactory().getClass().getName());
     }
 
-    public _FreeMarkerPageContext21() throws TemplateModelException {
+    public _FreeMarkerPageContext21() throws TemplateException {
         super();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/JspTestFreemarkerServlet.java
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/JspTestFreemarkerServlet.java
b/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/JspTestFreemarkerServlet.java
index 5c0197c..1ce54ba 100644
--- a/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/JspTestFreemarkerServlet.java
+++ b/freemarker-servlet/src/test/java/org/apache/freemarker/servlet/jsp/JspTestFreemarkerServlet.java
@@ -21,10 +21,9 @@ package org.apache.freemarker.servlet.jsp;
 
 import javax.servlet.ServletContext;
 
+import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.ObjectWrapper;
-import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.servlet.FreemarkerServlet;
-import org.apache.freemarker.servlet.jsp.TaglibFactory;
 
 public class JspTestFreemarkerServlet extends FreemarkerServlet {
 
@@ -40,7 +39,7 @@ public class JspTestFreemarkerServlet extends FreemarkerServlet {
 
     @Override
     protected TaglibFactory createTaglibFactory(ObjectWrapper objectWrapper, ServletContext
servletContext)
-            throws TemplateModelException {
+            throws TemplateException {
         final TaglibFactory taglibFactory = super.createTaglibFactory(objectWrapper, servletContext);
         taglibFactory.test_emulateNoUrlToFileConversions = emulateNoUrlToFileConversions;
         taglibFactory.test_emulateNoJarURLConnections = emulateNoJarURLConnections;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-servlet/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/customTags1.txt
----------------------------------------------------------------------
diff --git a/freemarker-servlet/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/customTags1.txt
b/freemarker-servlet/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/customTags1.txt
index 492713a..b0da72f 100644
--- a/freemarker-servlet/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/customTags1.txt
+++ b/freemarker-servlet/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/customTags1.txt
@@ -35,7 +35,7 @@ doFinally() called here
 
 <!-- Test abrupt execution -->
 doStartTag() called here
-doCatch() called here with class org.apache.freemarker.core._TemplateModelException: Error
while invoking the "testtag" JSP custom tag; see cause exception
+doCatch() called here with class org.apache.freemarker.core.TemplateException: Error while
invoking the "testtag" JSP custom tag; see cause exception
 doFinally() called here
 
 <!-- Test nested execution -->

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java
----------------------------------------------------------------------
diff --git a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java
b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java
index b5f62e7..a894a7d 100644
--- a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java
+++ b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertEqualsDirective.java
@@ -22,15 +22,14 @@ package org.apache.freemarker.test.templateutil;
 import java.io.IOException;
 import java.io.Writer;
 
+import org.apache.freemarker.core.CallPlace;
 import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.ArgumentArrayLayout;
-import org.apache.freemarker.core.CallPlace;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateNumberModel;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.util.StringToIndexMap;
@@ -87,7 +86,7 @@ public class AssertEqualsDirective implements TemplateDirectiveModel {
         return false;
     }
 
-    private String tryUnwrap(TemplateModel value) throws TemplateModelException {
+    private String tryUnwrap(TemplateModel value) throws TemplateException {
         if (value == null) return "null";
             // This is the same order as comparison goes:
         else if (value instanceof TemplateNumberModel) return ((TemplateNumberModel) value).getAsNumber().toString();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d73da6da/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertFailsDirective.java
----------------------------------------------------------------------
diff --git a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertFailsDirective.java
b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertFailsDirective.java
index 05a5cb0..e315ef6 100644
--- a/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertFailsDirective.java
+++ b/freemarker-test-utils/src/main/java/org/apache/freemarker/test/templateutil/AssertFailsDirective.java
@@ -23,13 +23,12 @@ import java.io.IOException;
 import java.io.Writer;
 import java.util.regex.Pattern;
 
+import org.apache.freemarker.core.CallPlace;
 import org.apache.freemarker.core.Environment;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.ArgumentArrayLayout;
-import org.apache.freemarker.core.CallPlace;
 import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateNumberModel;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.util.StringToIndexMap;
@@ -146,7 +145,7 @@ public class AssertFailsDirective implements TemplateDirectiveModel {
     }
 
     private String getAsString(TemplateModel value, String paramName, Environment env)
-            throws BadParameterTypeException, TemplateModelException {
+            throws TemplateException {
         if (value == null) {
             return null;
         }
@@ -158,14 +157,13 @@ public class AssertFailsDirective implements TemplateDirectiveModel
{
     }
 
     private Pattern getAsPattern(TemplateModel value, String paramName, Environment env)
-            throws TemplateModelException, BadParameterTypeException {
+            throws TemplateException {
         String s = getAsString(value, paramName, env);
         return s != null ? Pattern.compile(s, Pattern.CASE_INSENSITIVE) : null;
     }
 
-    private int getAsInt(TemplateModel value, int defaultValue, String paramName, Environment
env) throws
-            BadParameterTypeException,
-            TemplateModelException {
+    private int getAsInt(TemplateModel value, int defaultValue, String paramName, Environment
env)
+            throws TemplateException {
         if (value == null) {
             return defaultValue;
         }


Mime
View raw message