freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [1/2] incubator-freemarker git commit: Removed reflection trick unnecessary since we require Java 5
Date Fri, 20 Jan 2017 12:47:42 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/2.3-gae 7418c10d2 -> 371b4312f


Removed reflection trick unnecessary since we require  Java 5


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

Branch: refs/heads/2.3-gae
Commit: c23e0bad4ee2d4a3962804ab1fc962ca0cfaca12
Parents: 7418c10
Author: ddekany <ddekany@apache.org>
Authored: Fri Jan 20 13:46:46 2017 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Fri Jan 20 13:46:46 2017 +0100

----------------------------------------------------------------------
 src/main/java/freemarker/ext/beans/BeansWrapper.java | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/c23e0bad/src/main/java/freemarker/ext/beans/BeansWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/beans/BeansWrapper.java b/src/main/java/freemarker/ext/beans/BeansWrapper.java
index 8b51238..71c405f 100644
--- a/src/main/java/freemarker/ext/beans/BeansWrapper.java
+++ b/src/main/java/freemarker/ext/beans/BeansWrapper.java
@@ -94,18 +94,6 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable
{
     @Deprecated
     static final Object CAN_NOT_UNWRAP = ObjectWrapperAndUnwrapper.CANT_UNWRAP_TO_TARGET_CLASS;
     
-    private static final Class<?> ITERABLE_CLASS;
-    static {
-        Class<?> iterable;
-        try {
-            iterable = Class.forName("java.lang.Iterable");
-        } catch (ClassNotFoundException e) {
-            // We're running on a pre-1.5 JRE
-            iterable = null;
-        }
-        ITERABLE_CLASS = iterable;
-    }
-    
     private static final Constructor<?> ENUMS_MODEL_CTOR = enumsModelCtor();
     
     /**
@@ -1119,7 +1107,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable
{
                 }
             }
             
-            if (Collection.class == targetClass || ITERABLE_CLASS == targetClass) {
+            if (Collection.class == targetClass || Iterable.class == targetClass) {
                 if (model instanceof TemplateCollectionModel) {
                     return new CollectionAdapter((TemplateCollectionModel) model, 
                             this);


Mime
View raw message