freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [12/14] incubator-freemarker git commit: (Minor code cleanup)
Date Sun, 04 Oct 2015 14:49:37 GMT
(Minor code cleanup)


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

Branch: refs/heads/master
Commit: 43007bfed4b663e76d99aa77735a42e7a354acc1
Parents: 14fab44
Author: ddekany <ddekany@apache.org>
Authored: Sun Oct 4 16:44:24 2015 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Sun Oct 4 16:44:24 2015 +0200

----------------------------------------------------------------------
 .../freemarker/core/BuiltInsForMultipleTypes.java     | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/43007bfe/src/main/java/freemarker/core/BuiltInsForMultipleTypes.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/BuiltInsForMultipleTypes.java b/src/main/java/freemarker/core/BuiltInsForMultipleTypes.java
index a15c3b6..861b370 100644
--- a/src/main/java/freemarker/core/BuiltInsForMultipleTypes.java
+++ b/src/main/java/freemarker/core/BuiltInsForMultipleTypes.java
@@ -580,14 +580,14 @@ class BuiltInsForMultipleTypes {
             public String getAsString()
             throws TemplateModelException {
                 if (cachedValue == null) {
-                    try {
-                        if (defaultFormat == null) {
-                            if (dateModel.getDateType() == TemplateDateModel.UNKNOWN) {
-                                throw MessageUtil.newCantFormatUnknownTypeDateException(target,
null);
-                            } else {
-                                throw new BugException();
-                            }
+                    if (defaultFormat == null) {
+                        if (dateModel.getDateType() == TemplateDateModel.UNKNOWN) {
+                            throw MessageUtil.newCantFormatUnknownTypeDateException(target,
null);
+                        } else {
+                            throw new BugException();
                         }
+                    }
+                    try {
                         cachedValue = EvalUtil.assertFormatResultNotNull(defaultFormat.formatToPlainText(dateModel));
                     } catch (TemplateValueFormatException e) {
                         try {


Mime
View raw message