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: JavaDoc: Clarified that TemplateLoader.getReader must not return null. Only findTemplateSource should on missing template.
Date Tue, 27 Mar 2018 15:31:50 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/2.3-gae b5c374210 -> fe37fe57e


JavaDoc: Clarified that TemplateLoader.getReader must not return null. Only findTemplateSource
should on missing template.


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

Branch: refs/heads/2.3-gae
Commit: fe37fe57e3ad00f19ff91cc8cc726acdd44f3460
Parents: b5c3742
Author: ddekany <ddekany@apache.org>
Authored: Tue Mar 27 17:31:45 2018 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Tue Mar 27 17:31:45 2018 +0200

----------------------------------------------------------------------
 src/main/java/freemarker/cache/TemplateLoader.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/fe37fe57/src/main/java/freemarker/cache/TemplateLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/cache/TemplateLoader.java b/src/main/java/freemarker/cache/TemplateLoader.java
index 42d5677..ebbcd9d 100644
--- a/src/main/java/freemarker/cache/TemplateLoader.java
+++ b/src/main/java/freemarker/cache/TemplateLoader.java
@@ -117,6 +117,10 @@ public interface TemplateLoader {
      * template content (based on the {@code #ftl encoding=...} header), this method will
be called for a second time
      * with the correct {@code encoding} parameter value.
      * 
+     * <p>
+     * Unlike {@link #findTemplateSource(String)}, this method must not tolerate if the template
is not found, and
+     * must throw {@link IOException} in that case. 
+     * 
      * @param templateSource
      *            an object representing a template source, obtained through a prior call
to
      *            {@link #findTemplateSource(String)}. This must be an object on which
@@ -126,9 +130,9 @@ public interface TemplateLoader {
      *            to the byte representation of the template stream, and instead directly
obtain a character stream.
      *            These loaders should ignore the encoding parameter.
      * 
-     * @return A {@link Reader} representing the template character stream. It's the responsibility
of the caller (which
-     *         is {@link TemplateCache} usually) to {@code close()} it. The {@link Reader}
is not required to work after
-     *         the {@code templateSource} was closed ({@link #closeTemplateSource(Object)}).
+     * @return A {@link Reader} representing the template character stream; not {@code null}.
It's the responsibility of
+     *         the caller (which is {@link TemplateCache} usually) to {@code close()} it.
The {@link Reader} is not
+     *         required to work after the {@code templateSource} was closed ({@link #closeTemplateSource(Object)}).
      * 
      * @throws IOException
      *             if an I/O error occurs while accessing the stream.


Mime
View raw message