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 DefaultObjectWrapper settings that only exist so that you can set backward compatible behavior instead of the recommended value: useAdaptersForContainers, forceLegacyNonListCollections, iterableSupport
Date Sun, 26 Feb 2017 20:54:01 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 59412b293 -> 03aecddc8


Removed DefaultObjectWrapper settings that only exist so that you can set backward compatible behavior instead of the recommended value: useAdaptersForContainers, forceLegacyNonListCollections, iterableSupport


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

Branch: refs/heads/3
Commit: 03aecddc8f1476686311ffb7408b177a53e3fe3d
Parents: 59412b2
Author: ddekany <ddekany@apache.org>
Authored: Sun Feb 26 14:53:13 2017 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Sun Feb 26 21:53:23 2017 +0100

----------------------------------------------------------------------
 .../core/APINotSupportedTemplateException.java  |  17 --
 .../apache/freemarker/core/Configurable.java    |   2 +-
 .../core/model/TemplateCollectionModelEx.java   |  12 +-
 .../core/model/impl/DefaultIterableAdapter.java |   7 +-
 .../impl/DefaultNonListCollectionAdapter.java   |  18 +-
 .../core/model/impl/DefaultObjectWrapper.java   | 164 ++---------------
 .../impl/DefaultObjectWrapperConfiguration.java |  61 -------
 .../core/model/impl/beans/BeansWrapper.java     |   7 +-
 src/manual/en_US/FM3-CHANGE-LOG.txt             |   2 +
 .../freemarker/core/ConfigurationTest.java      |  14 --
 .../core/SimpleObjectWrapperTest.java           |  13 +-
 .../freemarker/core/SimpleObjetWrapperTest.java |  14 +-
 .../model/impl/DefaultObjectWrapperTest.java    | 179 +++++--------------
 .../basic/WEB-INF/expected/attributes.txt       |   2 +-
 .../servlet/jsp/webapps/basic/WEB-INF/web.xml   |   2 +-
 .../freemarker/test/templatesuite/testcases.xml |  14 +-
 16 files changed, 92 insertions(+), 436 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/main/java/org/apache/freemarker/core/APINotSupportedTemplateException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/APINotSupportedTemplateException.java b/src/main/java/org/apache/freemarker/core/APINotSupportedTemplateException.java
index b7fc12b..c2864ee 100644
--- a/src/main/java/org/apache/freemarker/core/APINotSupportedTemplateException.java
+++ b/src/main/java/org/apache/freemarker/core/APINotSupportedTemplateException.java
@@ -45,23 +45,6 @@ class APINotSupportedTemplateException extends TemplateException {
 
         if (blamedExpr.isLiteral()) {
             desc.tip("Only adapted Java objects can possibly have API, not values created inside templates.");
-        } else {
-            ObjectWrapper ow = env.getObjectWrapper();
-            if (ow instanceof DefaultObjectWrapper
-                    && (tm instanceof SimpleHash || tm instanceof SimpleSequence)) {
-                DefaultObjectWrapper dow = (DefaultObjectWrapper) ow;
-                if (!dow.getUseAdaptersForContainers()) {
-                    desc.tip("In the FreeMarker configuration, \"", Configurable.OBJECT_WRAPPER_KEY,
-                            "\" is a DefaultObjectWrapper with its \"useAdaptersForContainers\" property set to "
-                            + "false. Setting it to true might solves this problem.");
-                } else if (tm instanceof SimpleSequence && dow.getForceLegacyNonListCollections()) {
-                    desc.tip("In the FreeMarker configuration, \"",
-                            Configurable.OBJECT_WRAPPER_KEY,
-                            "\" is a DefaultObjectWrapper with its \"forceLegacyNonListCollections\" property set "
-                            + "to true. If you are trying to access the API of a non-List Collection, setting the "
-                            + "\"forceLegacyNonListCollections\" property to false might solves this problem.");
-                }
-            }
         }
 
         return desc;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/main/java/org/apache/freemarker/core/Configurable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/Configurable.java b/src/main/java/org/apache/freemarker/core/Configurable.java
index 6f3ec00..2467eeb 100644
--- a/src/main/java/org/apache/freemarker/core/Configurable.java
+++ b/src/main/java/org/apache/freemarker/core/Configurable.java
@@ -1801,7 +1801,7 @@ public class Configurable {
      *       <br>String value: If the value contains dot, then it's interpreted as an <a href="#fm_obe">object builder
      *       expression</a>, with the addition that {@link BeansWrapper}, {@link DefaultObjectWrapper} and
      *       {@link SimpleObjectWrapper} can be referred without package name. For example, these strings are valid
-     *       values: {@code "DefaultObjectWrapper(2.3.21, forceLegacyNonListCollections=false, iterableSupport=true)"},
+     *       values: {@code "DefaultObjectWrapper(3.0.0)"},
      *       {@code "BeansWrapper(2.3.21, simpleMapWrapper=true)"}.
      *       <br>If the value does not contain dot, then it must be one of these special values (case insensitive):
      *       {@code "default"} means the default of {@link Configuration} (the default depends on the

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModelEx.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModelEx.java b/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModelEx.java
index 49fd94f..3444bf0 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModelEx.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModelEx.java
@@ -22,14 +22,10 @@ package org.apache.freemarker.core.model;
 import java.util.Collection;
 
 /**
- * <b>Experimental - subject to change:</b> "extended collection" template language data type: Adds size/emptiness
- * querybility and "contains" test to {@link TemplateCollectionModel}. The added extra operations is provided by all
- * Java {@link Collection}-s, and this interface was added to make that accessible for templates too.
- * 
- * <p>
- * <b>Experimental status warning:</b> This interface is subject to change on non-backward compatible ways, hence, it
- * shouldn't be implemented outside FreeMarker yet.
- * 
+ * "extended collection" template language data type: Adds size/emptiness querybility and "contains" test to
+ * {@link TemplateCollectionModel}. The added extra operations is provided by all Java {@link Collection}-s, and
+ * this interface was added to make that accessible for templates too.
+ *
  * @since 2.3.22
  */
 public interface TemplateCollectionModelEx extends TemplateCollectionModel {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/main/java/org/apache/freemarker/core/model/impl/DefaultIterableAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/DefaultIterableAdapter.java b/src/main/java/org/apache/freemarker/core/model/impl/DefaultIterableAdapter.java
index 571ea6e..1c31212 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/DefaultIterableAdapter.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/DefaultIterableAdapter.java
@@ -44,12 +44,7 @@ import org.apache.freemarker.core.model.WrappingTemplateModel;
  * Thread safety: A {@link DefaultIterableAdapter} is as thread-safe as the {@link Iterable} that it wraps is. Normally
  * you only have to consider read-only access, as the FreeMarker template language doesn't provide mean to call
  * {@link Iterator} modifier methods (though of course, Java methods called from the template can violate this rule).
- * 
- * <p>
- * This adapter is used by {@link DefaultObjectWrapper} if its {@link DefaultObjectWrapper#setIterableSupport(boolean)
- * iterableSupport} property is {@code true}, which is not the default for backward compatibility (so you have to set it
- * explicitly).
- * 
+ *
  * @since 2.3.25
  */
 @SuppressWarnings("serial")

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/main/java/org/apache/freemarker/core/model/impl/DefaultNonListCollectionAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/DefaultNonListCollectionAdapter.java b/src/main/java/org/apache/freemarker/core/model/impl/DefaultNonListCollectionAdapter.java
index 417b8fc..4304b39 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/DefaultNonListCollectionAdapter.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/DefaultNonListCollectionAdapter.java
@@ -38,25 +38,15 @@ import org.apache.freemarker.core.model.WrapperTemplateModel;
 import org.apache.freemarker.core.model.WrappingTemplateModel;
 
 /**
- * <b>Experimental - subject to change:</b> Adapts a non-{@link List} Java {@link Collection} to the corresponding
- * {@link TemplateModel} interface(s), most importantly to {@link TemplateCollectionModelEx}. For {@link List}-s, use
- * {@link DefaultListAdapter}, or else you lose indexed element access.
+ * Adapts a non-{@link List} Java {@link Collection} to the corresponding {@link TemplateModel} interface(s), most
+ * importantly to {@link TemplateCollectionModelEx}. For {@link List}-s, use {@link DefaultListAdapter}, or else you
+ * lose indexed element access.
  * 
  * <p>
  * Thread safety: A {@link DefaultNonListCollectionAdapter} is as thread-safe as the {@link Collection} that it wraps
  * is. Normally you only have to consider read-only access, as the FreeMarker template language doesn't allow writing
  * these collections (though of course, Java methods called from the template can violate this rule).
- * 
- * <p>
- * This adapter is used by {@link DefaultObjectWrapper} if its {@code useAdaptersForCollections} property is
- * {@code true}, which is the default when its {@code incompatibleImprovements} property is 2.3.22 or higher, and its
- * {@link DefaultObjectWrapper#setForceLegacyNonListCollections(boolean) forceLegacyNonListCollections} property is
- * {@code false}, which is still not the default as of 2.3.22 (so you have to set it explicitly).
- * 
- * <p>
- * <b>Experimental status warning:</b> This class is subject to change on non-backward compatible ways, hence, it
- * shouldn't be used from outside FreeMarker yet.
- * 
+ *
  * @since 2.3.22
  */
 public class DefaultNonListCollectionAdapter extends WrappingTemplateModel implements TemplateCollectionModelEx,

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java b/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java
index ba61a2c..0351edd 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapper.java
@@ -25,16 +25,13 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
-import org.apache.freemarker.core.model.TemplateCollectionModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapperConfiguration;
 import org.apache.freemarker.dom.NodeModel;
@@ -44,17 +41,13 @@ import org.w3c.dom.Node;
  * The default implementation of the {@link ObjectWrapper} interface. Usually, you don't need to create instances of
  * this, as an instance of this is already the default value of the
  * {@link Configuration#setObjectWrapper(ObjectWrapper) object_wrapper setting}. Then the
- * {@link #DefaultObjectWrapper(Version) incompatibleImprovements} of the {@link DefaultObjectWrapper} will be the same
- * that you have set for the {@link Configuration} itself. As of this writing, it's highly recommended to use
- * {@link Configuration#Configuration(Version) incompatibleImprovements} 2.3.22 (or higher).
+ * {@link #DefaultObjectWrapper(Version) incompatibleImprovements} of the {@link DefaultObjectWrapper} will be the
+ * same that you have set for the {@link Configuration} itself.
  * 
  * <p>
  * If you still need to create an instance, that should be done with an {@link DefaultObjectWrapperBuilder} (or
  * with {@link Configuration#setSetting(String, String)} with {@code "object_wrapper"} key), not with
- * its constructor, as that allows FreeMarker to reuse singletons. For new projects, it's recommended to set
- * {@link DefaultObjectWrapperBuilder#setForceLegacyNonListCollections(boolean) forceLegacyNonListCollections} to
- * {@code false}, and {@link DefaultObjectWrapperBuilder#setIterableSupport(boolean) iterableSupport} to {@code true};
- * setting {@code incompatibleImprovements} to 2.3.22 won't do these, as they could break legacy templates too easily.
+ * its constructor, as that allows FreeMarker to reuse singletons.
  *
  * <p>
  * This class is only thread-safe after you have finished calling its setter methods, and then safely published it (see
@@ -63,27 +56,13 @@ import org.w3c.dom.Node;
  */
 public class DefaultObjectWrapper extends org.apache.freemarker.core.model.impl.beans.BeansWrapper {
     
-    private boolean useAdaptersForContainers;
-    private boolean forceLegacyNonListCollections;
-    private boolean iterableSupport;
-    
     /**
      * Use {@link DefaultObjectWrapperBuilder} instead if possible. Instances created with this constructor won't share
      * the class introspection caches with other instances. See {@link BeansWrapper#BeansWrapper(Version)} (the
      * superclass constructor) for more details.
      * 
      * @param incompatibleImprovements
-     *            It's the same as in {@link BeansWrapper#BeansWrapper(Version)}, plus these  changes:
-     *            <ul>
-     *              <li>2.3.22 (or higher): The default value of
-     *                  {@link #setUseAdaptersForContainers(boolean) useAdaptersForContainers} changes to
-     *                  {@code true}.</li>
-     *              <li>2.3.24 (or higher): When wrapping an {@link Iterator}, operations on it that only check if the
-     *                  collection is empty without reading an element from it, such as {@code ?has_content},
-     *                  won't cause the a later iteration (or further emptiness check) to fail anymore. Earlier, in
-     *                  certain situations, the second operation has failed saying that the iterator "can be listed only
-     *                  once".  
-     *            </ul>
+     *            It's the same as in {@link BeansWrapper#BeansWrapper(Version)}.
      * 
      * @since 2.3.21
      */
@@ -102,9 +81,6 @@ public class DefaultObjectWrapper extends org.apache.freemarker.core.model.impl.
         DefaultObjectWrapperConfiguration dowDowCfg = bwCfg instanceof DefaultObjectWrapperConfiguration
                 ? (DefaultObjectWrapperConfiguration) bwCfg
                 : new DefaultObjectWrapperConfiguration(bwCfg.getIncompatibleImprovements()) { }; 
-        useAdaptersForContainers = dowDowCfg.getUseAdaptersForContainers();
-        forceLegacyNonListCollections = dowDowCfg.getForceLegacyNonListCollections();
-        iterableSupport = dowDowCfg.getIterableSupport();
         finalizeConstruction(writeProtected);
     }
 
@@ -122,10 +98,8 @@ public class DefaultObjectWrapper extends org.apache.freemarker.core.model.impl.
      * Wraps the parameter object to {@link TemplateModel} interface(s). Simple types like numbers, strings, booleans
      * and dates will be wrapped into the corresponding {@code SimpleXxx} classes (like {@link SimpleNumber}).
      * {@link Map}-s, {@link List}-s, other {@link Collection}-s, arrays and {@link Iterator}-s will be wrapped into the
-     * corresponding {@code SimpleXxx} or {@code DefaultXxxAdapter} classes (like {@link SimpleHash} or
-     * {@link DefaultMapAdapter}), depending on {@link #getUseAdaptersForContainers()} and
-     * {@link #getForceLegacyNonListCollections()}. After that, the wrapping is handled by
-     * {@link #handleUnknownType(Object)}, so see more there.
+     * corresponding {@code DefaultXxxAdapter} classes ({@link DefaultMapAdapter}), depending on). After that, the
+     * wrapping is handled by {@link #handleUnknownType(Object)}, so see more there.
      */
     @Override
     public TemplateModel wrap(Object obj) throws TemplateModelException {
@@ -155,40 +129,23 @@ public class DefaultObjectWrapper extends org.apache.freemarker.core.model.impl.
         }
         final Class<?> objClass = obj.getClass();
         if (objClass.isArray()) {
-            if (useAdaptersForContainers) {
-                return DefaultArrayAdapter.adapt(obj, this);
-            } else {
-                obj = convertArray(obj);
-                // Falls through (a strange legacy...)
-            }
+            return DefaultArrayAdapter.adapt(obj, this);
         }
         if (obj instanceof Collection) {
-            if (useAdaptersForContainers) {
-                if (obj instanceof List) {
-                    return DefaultListAdapter.adapt((List<?>) obj, this);
-                } else {
-                    return forceLegacyNonListCollections
-                            ? new SimpleSequence((Collection<?>) obj, this)
-                            : DefaultNonListCollectionAdapter.adapt((Collection<?>) obj, this);
-                }
-            } else {
-                return new SimpleSequence((Collection<?>) obj, this);
-            }
+            return obj instanceof List
+                    ? DefaultListAdapter.adapt((List<?>) obj, this)
+                    : DefaultNonListCollectionAdapter.adapt((Collection<?>) obj, this);
         }
         if (obj instanceof Map) {
-            return useAdaptersForContainers
-                    ? DefaultMapAdapter.adapt((Map<?, ?>) obj, this)
-                    : new SimpleHash((Map<?, ?>) obj, this);
+            return DefaultMapAdapter.adapt((Map<?, ?>) obj, this);
         }
         if (obj instanceof Boolean) {
             return obj.equals(Boolean.TRUE) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE;
         }
         if (obj instanceof Iterator) {
-            return useAdaptersForContainers
-                    ? DefaultIteratorAdapter.adapt((Iterator<?>) obj, this)
-                    : new SimpleCollection((Iterator<?>) obj, this);
+            return DefaultIteratorAdapter.adapt((Iterator<?>) obj, this);
         }
-        if (iterableSupport && obj instanceof Iterable) {
+        if (obj instanceof Iterable) {
             return DefaultIterableAdapter.adapt((Iterable<?>) obj, this);
         }
         return handleUnknownType(obj);
@@ -229,98 +186,6 @@ public class DefaultObjectWrapper extends org.apache.freemarker.core.model.impl.
     }
 
     /**
-     * The getter pair of {@link #setUseAdaptersForContainers(boolean)}.
-     * 
-     * @since 2.3.22
-     */
-    public boolean getUseAdaptersForContainers() {
-        return useAdaptersForContainers;
-    }
-
-    /**
-     * Sets if to wrap container objects ({@link Map}-s, {@link List}-s, arrays and such) the legacy copying approach or
-     * the newer adapter approach should be used. {@code true} is recommended, which is also the default. To
-     * understand the difference, check some of the classes that implement the two approaches:
-     * <ul>
-     * <li>Copying approach: {@link SimpleHash}, {@link SimpleSequence}</li>
-     * <li>Adapter approach: {@link DefaultMapAdapter}, {@link DefaultListAdapter}, {@link DefaultArrayAdapter},
-     * {@link DefaultIteratorAdapter}</li>
-     * </ul>
-     * 
-     * <p>
-     * See also the related Version History entry under 2.3.22 in the FreeMarker Manual, which gives a breakdown of
-     * the consequences.
-     * 
-     * <p>
-     * <b>Attention:</b> For backward compatibility, currently, non-{@link List} collections (like {@link Set}-s) will
-     * only be wrapped with adapter approach (with {@link DefaultNonListCollectionAdapter}) if
-     * {@link #setForceLegacyNonListCollections(boolean) forceLegacyNonListCollections} was set to {@code false}.
-     * Currently the default is {@code true}, but in new projects you should set it to {@code false}. See
-     * {@link #setForceLegacyNonListCollections(boolean)} for more.
-     * 
-     * @see #setForceLegacyNonListCollections(boolean)
-     * 
-     * @since 2.3.22
-     */
-    public void setUseAdaptersForContainers(boolean useAdaptersForContainers) {
-        checkModifiable();
-        this.useAdaptersForContainers = useAdaptersForContainers;
-    }
-    
-    /**
-     * Getter pair of {@link #setForceLegacyNonListCollections(boolean)}; see there.
-     * 
-     * @since 2.3.22
-     */
-    public boolean getForceLegacyNonListCollections() {
-        return forceLegacyNonListCollections;
-    }
-
-    /**
-     * Specifies whether non-{@link List} {@link Collection}-s (like {@link Set}-s) must be wrapped by pre-fetching into
-     * a {@link SimpleSequence}. The modern approach is wrapping into a {@link DefaultNonListCollectionAdapter}. This
-     * setting only has effect when {@link #getUseAdaptersForContainers()} is also {@code true}, as otherwise
-     * {@link SimpleSequence} will be used regardless of this. In new projects you should set this to {@code false}. At
-     * least before {@code incompatible_improvements} 2.4.0 it defaults to {@code true}, because of backward
-     * compatibility concerns: with {@link TemplateSequenceModel} templates could access the items by index if they
-     * wanted to (the index values were defined by the iteration order). This was not very useful, or was even
-     * confusing, and it conflicts with the adapter approach.
-     * 
-     * @see #setUseAdaptersForContainers(boolean)
-     * 
-     * @since 2.3.22
-     */
-    public void setForceLegacyNonListCollections(boolean forceLegacyNonListCollections) {
-        checkModifiable();
-        this.forceLegacyNonListCollections = forceLegacyNonListCollections;
-    }
-
-    /**
-     * Getter pair of {@link #setIterableSupport(boolean)}; see there.
-     * 
-     * @since 2.3.25
-     */
-    public boolean getIterableSupport() {
-        return iterableSupport;
-    }
-
-    /**
-     * Specifies whether {@link Iterable}-s (not to be confused with {@link Iterator}-s) that don't implement any other
-     * recognized Java interfaces (most notably {@link Collection}) will be recognized as listable objects
-     * ({@link TemplateCollectionModel}-s), or they will be just seen as generic objects (JavaBean-s). Defaults to
-     * {@code false} for backward compatibility, but in new projects you should set this to {@code true}. Before setting
-     * this to {@code true} in older projects, check if you have called {@code myIterable.iterator()} directly from any
-     * templates, because the Java API is only exposed to the templates if the {@link Iterable} is wrapped as generic
-     * object.
-     * 
-     * @since 2.3.25
-     */
-    public void setIterableSupport(boolean iterableSupport) {
-        checkModifiable();
-        this.iterableSupport = iterableSupport;
-    }
-
-    /**
      * Returns the lowest version number that is equivalent with the parameter version.
      * 
      * @since 2.3.22
@@ -344,8 +209,7 @@ public class DefaultObjectWrapper extends org.apache.freemarker.core.model.impl.
             }
         }
         
-        return "useAdaptersForContainers=" + useAdaptersForContainers + ", forceLegacyNonListCollections="
-                + forceLegacyNonListCollections + ", iterableSupport=" + iterableSupport + bwProps;
+        return "";
     }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperConfiguration.java b/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperConfiguration.java
index df97ce6..307d278 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperConfiguration.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperConfiguration.java
@@ -34,69 +34,8 @@ import org.apache.freemarker.core.model.impl.beans.BeansWrapperConfiguration;
  */
 public abstract class DefaultObjectWrapperConfiguration extends BeansWrapperConfiguration {
     
-    private boolean useAdaptersForContainers = true;
-    private boolean forceLegacyNonListCollections = true; // [FM3] [2.4]: = IcI < _CoreAPI.VERSION_INT_2_4_0;
-    private boolean iterableSupport;
-
     protected DefaultObjectWrapperConfiguration(Version incompatibleImprovements) {
         super(DefaultObjectWrapper.normalizeIncompatibleImprovementsVersion(incompatibleImprovements), true);
     }
 
-    /** See {@link DefaultObjectWrapper#getUseAdaptersForContainers()}. */
-    public boolean getUseAdaptersForContainers() {
-        return useAdaptersForContainers;
-    }
-
-    /** See {@link DefaultObjectWrapper#setUseAdaptersForContainers(boolean)}. */
-    public void setUseAdaptersForContainers(boolean useAdaptersForContainers) {
-        this.useAdaptersForContainers = useAdaptersForContainers;
-    }
-    
-    /** See {@link DefaultObjectWrapper#getForceLegacyNonListCollections()}. */
-    public boolean getForceLegacyNonListCollections() {
-        return forceLegacyNonListCollections;
-    }
-
-    /** See {@link DefaultObjectWrapper#setForceLegacyNonListCollections(boolean)}. */
-    public void setForceLegacyNonListCollections(boolean forceLegacyNonListCollections) {
-        this.forceLegacyNonListCollections = forceLegacyNonListCollections;
-    }
-
-    /**
-     * See {@link DefaultObjectWrapper#getIterableSupport()}.
-     * 
-     * @since 2.3.25 
-     */
-    public boolean getIterableSupport() {
-        return iterableSupport;
-    }
-
-    /**
-     * See {@link DefaultObjectWrapper#setIterableSupport(boolean)}.
-     * 
-     * @since 2.3.25 
-     */
-    public void setIterableSupport(boolean iterableSupport) {
-        this.iterableSupport = iterableSupport;
-    }
-    
-    @Override
-    public int hashCode() {
-        int result = super.hashCode();
-        final int prime = 31;
-        result = result * prime + (useAdaptersForContainers ? 1231 : 1237);
-        result = result * prime + (forceLegacyNonListCollections ? 1231 : 1237);
-        result = result * prime + (iterableSupport ? 1231 : 1237);
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object that) {
-        if (!super.equals(that)) return false;
-        final DefaultObjectWrapperConfiguration thatDowCfg = (DefaultObjectWrapperConfiguration) that;
-        return useAdaptersForContainers == thatDowCfg.getUseAdaptersForContainers()
-                && forceLegacyNonListCollections == thatDowCfg.forceLegacyNonListCollections
-                && iterableSupport == thatDowCfg.iterableSupport;
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/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 b9b9a7a..86ab72e 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
@@ -230,9 +230,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
         // Attention! Don't don anything here, as the instance is possibly already visible to other threads through the
         // model factory callbacks.
     }
-    
-    private static volatile boolean ftmaDeprecationWarnLogged;
-    
+
     /**
      * Same as {@link #BeansWrapper(BeansWrapperConfiguration, boolean, boolean)} with {@code true}
      * {@code finalizeConstruction} argument.
@@ -1326,8 +1324,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
     public TemplateHashModel getStaticModels() {
         return staticModels;
     }
-    
-    
+
     /**
      * Returns a hash model that represents the so-called class enum models.
      * Every class' enum model is itself a hash through which you can access

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/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 52564b7..9486c33 100644
--- a/src/manual/en_US/FM3-CHANGE-LOG.txt
+++ b/src/manual/en_US/FM3-CHANGE-LOG.txt
@@ -118,3 +118,5 @@ the FreeMarer 3 changelog here:
 - setSetting (and the like) doesn't throw ParseException (the same exception used when parsing templates) anymore, but ConfigurationException.
   Also, on the places where ParseException was used for other than template   parsing, o.a.f.core.util.GenericParseException is used now instead,
   which doesn't have the template parsing related fields that we can't fill.
+- Removed DefaultObjectWrapper settings that only exist so that you can set backward compatible behavior instead of the
+  recommended value: useAdaptersForContainers, forceLegacyNonListCollections, iterableSupport
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ConfigurationTest.java b/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
index e5f3282..89fd456 100644
--- a/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
+++ b/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
@@ -661,20 +661,6 @@ public class ConfigurationTest extends TestCase {
             cfg.setSetting(Configurable.OBJECT_WRAPPER_KEY, "simple");
             assertSame(_StaticObjectWrappers.SIMPLE_OBJECT_WRAPPER, cfg.getObjectWrapper());
         }
-        
-        {
-            cfg.setSetting(Configurable.OBJECT_WRAPPER_KEY,
-                    "DefaultObjectWrapper(3.0.0, useAdaptersForContainers=true, forceLegacyNonListCollections=false)");
-            DefaultObjectWrapper dow = (DefaultObjectWrapper) cfg.getObjectWrapper();
-            assertEquals(Configuration.VERSION_3_0_0, dow.getIncompatibleImprovements());
-            assertFalse(dow.getForceLegacyNonListCollections());
-        }
-        
-        {
-            cfg.setSetting(Configurable.OBJECT_WRAPPER_KEY, "defAult");
-            DefaultObjectWrapper dow = (DefaultObjectWrapper) cfg.getObjectWrapper();
-            assertTrue(dow.getForceLegacyNonListCollections());
-        }
     }
     
     public void testTemplateLookupStrategyDefaultAndSet() throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/test/java/org/apache/freemarker/core/SimpleObjectWrapperTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/SimpleObjectWrapperTest.java b/src/test/java/org/apache/freemarker/core/SimpleObjectWrapperTest.java
index 924e170..1a84982 100644
--- a/src/test/java/org/apache/freemarker/core/SimpleObjectWrapperTest.java
+++ b/src/test/java/org/apache/freemarker/core/SimpleObjectWrapperTest.java
@@ -19,38 +19,37 @@
 
 package org.apache.freemarker.core;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashSet;
+import javax.annotation.PostConstruct;
 
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.impl.DefaultArrayAdapter;
 import org.apache.freemarker.core.model.impl.DefaultListAdapter;
 import org.apache.freemarker.core.model.impl.DefaultMapAdapter;
+import org.apache.freemarker.core.model.impl.DefaultNonListCollectionAdapter;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapperTest.TestBean;
 import org.apache.freemarker.core.model.impl.SimpleDate;
 import org.apache.freemarker.core.model.impl.SimpleNumber;
 import org.apache.freemarker.core.model.impl.SimpleObjectWrapper;
 import org.apache.freemarker.core.model.impl.SimpleScalar;
-import org.apache.freemarker.core.model.impl.SimpleSequence;
 import org.junit.Test;
 
 public class SimpleObjectWrapperTest {
-    
+
     @Test
     public void testBasics() throws TemplateModelException {
+        PostConstruct.class.toString();
         SimpleObjectWrapper ow = new SimpleObjectWrapper(Configuration.VERSION_3_0_0);
         testCustomizationCommonPart(ow);
         assertTrue(ow.wrap(Collections.emptyMap()) instanceof DefaultMapAdapter);
         assertTrue(ow.wrap(Collections.emptyList()) instanceof DefaultListAdapter);
         assertTrue(ow.wrap(new boolean[] { }) instanceof DefaultArrayAdapter);
-        assertTrue(ow.wrap(new HashSet()) instanceof SimpleSequence);  // at least until IcI 2.4
+        assertTrue(ow.wrap(new HashSet()) instanceof DefaultNonListCollectionAdapter);
     }
 
     @SuppressWarnings("boxing")

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/test/java/org/apache/freemarker/core/SimpleObjetWrapperTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/SimpleObjetWrapperTest.java b/src/test/java/org/apache/freemarker/core/SimpleObjetWrapperTest.java
index 7d9b00e..b746cfa 100644
--- a/src/test/java/org/apache/freemarker/core/SimpleObjetWrapperTest.java
+++ b/src/test/java/org/apache/freemarker/core/SimpleObjetWrapperTest.java
@@ -37,15 +37,7 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.apache.freemarker.core.model.TemplateBooleanModel;
-import org.apache.freemarker.core.model.TemplateCollectionModel;
-import org.apache.freemarker.core.model.TemplateDateModel;
-import org.apache.freemarker.core.model.TemplateHashModelEx;
-import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.TemplateModelWithAPISupport;
-import org.apache.freemarker.core.model.TemplateNumberModel;
-import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.TemplateSequenceModel;
+import org.apache.freemarker.core.model.*;
 import org.apache.freemarker.core.model.impl.SimpleObjectWrapper;
 import org.junit.Test;
 import org.w3c.dom.Document;
@@ -78,8 +70,8 @@ public class SimpleObjetWrapperTest {
         assertTrue(sow.wrap(new ArrayList()) instanceof TemplateSequenceModel);
         assertTrue(sow.wrap(new String[0]) instanceof TemplateSequenceModel);
         assertTrue(sow.wrap(new ArrayList().iterator()) instanceof TemplateCollectionModel);
-        assertTrue(sow.wrap(new HashSet()) instanceof TemplateSequenceModel);
-        assertTrue(sow.wrap(new HashMap()) instanceof TemplateHashModelEx);
+        assertTrue(sow.wrap(new HashSet()) instanceof TemplateCollectionModelEx);
+        assertTrue(sow.wrap(new HashMap()) instanceof TemplateHashModelEx2);
         assertNull(sow.wrap(null));
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/test/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperTest.java b/src/test/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperTest.java
index 2c39d94..ccda098 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/DefaultObjectWrapperTest.java
@@ -86,16 +86,6 @@ public class DefaultObjectWrapperTest {
     private final static DefaultObjectWrapper OW300 = new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0)
             .build();
 
-    private final static DefaultObjectWrapper OW300CA = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
-    static {
-        OW300CA.setForceLegacyNonListCollections(false);
-    }
-
-    private final static DefaultObjectWrapper OW300IS = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
-    static {
-        OW300IS.setIterableSupport(true);
-    }
-
     @Test
     public void testIncompatibleImprovementsVersionBreakPoints() throws Exception {
         List<Version> expected = new ArrayList<>();
@@ -160,57 +150,12 @@ public class DefaultObjectWrapperTest {
             assertEquals(Configuration.VERSION_3_0_0, bw.getIncompatibleImprovements());
             assertTrue(bw.isWriteProtected());
             assertEquals(simpleMapWrapper, bw.isSimpleMapWrapper());
-            assertTrue(bw.getUseAdaptersForContainers());
-            assertTrue(bw.getForceLegacyNonListCollections());
-            assertTrue(bw.wrap(new HashMap()) instanceof DefaultMapAdapter);
-            assertTrue(bw.wrap(new ArrayList()) instanceof DefaultListAdapter);
-            assertTrue(bw.wrap(new String[] {}) instanceof DefaultArrayAdapter);
-            assertTrue(bw.wrap(new HashSet()) instanceof SimpleSequence);
-        }
-
-        {
-            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.getVersion());
-            builder.setSimpleMapWrapper(true);
-            BeansWrapper bw = builder.build();
-            assertSame(bw, builder.build());
-            assertSame(bw.getClass(), DefaultObjectWrapper.class);
-            assertEquals(
-                    DefaultObjectWrapper.normalizeIncompatibleImprovementsVersion(Configuration.getVersion()),
-                    bw.getIncompatibleImprovements());
-            assertTrue(bw.isWriteProtected());
-            assertTrue(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof DefaultMapAdapter);
-        }
-
-        {
-            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0);
-            builder.setForceLegacyNonListCollections(false);
-            DefaultObjectWrapper bw = builder.build();
-            assertSame(bw, builder.build());
-            assertFalse(bw.getForceLegacyNonListCollections());
-
-            assertTrue(bw.wrap(new HashMap()) instanceof DefaultMapAdapter);
-            assertTrue(bw.wrap(new ArrayList()) instanceof DefaultListAdapter);
-            assertTrue(bw.wrap(new String[] {}) instanceof DefaultArrayAdapter);
-            assertTrue(bw.wrap(new HashSet()) instanceof DefaultNonListCollectionAdapter);
-        }
-        
-        {
-            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.getVersion());
-            DefaultObjectWrapper bw = builder.build();
-            assertSame(bw, builder.build());
-            assertFalse(bw.getIterableSupport());
-
-            assertFalse(bw.wrap(new PureIterable()) instanceof DefaultIterableAdapter);
-        }
-        {
-            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.getVersion());
-            builder.setIterableSupport(true);
-            DefaultObjectWrapper bw = builder.build();
-            assertSame(bw, builder.build());
-            assertTrue(bw.getIterableSupport());
 
-            assertTrue(bw.wrap(new PureIterable()) instanceof DefaultIterableAdapter);
+            assertThat(bw.wrap(new HashMap()), instanceOf(DefaultMapAdapter.class));
+            assertThat(bw.wrap(new ArrayList()), instanceOf(DefaultListAdapter.class));
+            assertThat(bw.wrap(new String[] {}), instanceOf(DefaultArrayAdapter.class));
+            assertThat(bw.wrap(new HashSet()), instanceOf(DefaultNonListCollectionAdapter.class));
+            assertThat(bw.wrap(new PureIterable()), instanceOf(DefaultIterableAdapter.class));
         }
     }
     
@@ -225,8 +170,6 @@ public class DefaultObjectWrapperTest {
             DefaultObjectWrapper ow = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
             assertEquals(Configuration.VERSION_3_0_0, ow.getIncompatibleImprovements());
             assertFalse(ow.isWriteProtected());
-            assertTrue(ow.getUseAdaptersForContainers());
-            assertTrue(ow.getForceLegacyNonListCollections());
         }
         
         try {
@@ -242,7 +185,6 @@ public class DefaultObjectWrapperTest {
     public void testCustomization() throws TemplateModelException {
         CustomizedDefaultObjectWrapper ow = new CustomizedDefaultObjectWrapper(Configuration.VERSION_3_0_0);
         assertEquals(Configuration.VERSION_3_0_0, ow.getIncompatibleImprovements());
-        assertTrue(ow.getUseAdaptersForContainers());
         assertFalse(ow.isWriteProtected());
         
         TemplateSequenceModel seq = (TemplateSequenceModel) ow.wrap(new Tupple(11, 22));
@@ -258,7 +200,7 @@ public class DefaultObjectWrapperTest {
         assertTrue(ow.wrap(Collections.emptyMap()) instanceof DefaultMapAdapter);
         assertTrue(ow.wrap(Collections.emptyList()) instanceof DefaultListAdapter);
         assertTrue(ow.wrap(new boolean[] { }) instanceof DefaultArrayAdapter);
-        assertTrue(ow.wrap(new HashSet()) instanceof SimpleSequence);  // at least until IcI 2.4
+        assertTrue(ow.wrap(new HashSet()) instanceof DefaultNonListCollectionAdapter);
         assertTrue(ow.wrap('c') instanceof TemplateScalarModel); // StringModel right now, but should change later
         
         TemplateHashModel bean = (TemplateHashModel) ow.wrap(new TestBean());
@@ -540,25 +482,25 @@ public class DefaultObjectWrapperTest {
             set.add("a");
             set.add("b");
             set.add("c");
-            TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300CA.wrap(set);
+            TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300.wrap(set);
             assertTrue(coll instanceof DefaultNonListCollectionAdapter);
             assertEquals(3, coll.size());
             assertFalse(coll.isEmpty());
             assertCollectionTMEquals(coll, "a", "b", "c");
 
-            assertTrue(coll.contains(OW300CA.wrap("a")));
-            assertTrue(coll.contains(OW300CA.wrap("b")));
-            assertTrue(coll.contains(OW300CA.wrap("c")));
-            assertTrue(coll.contains(OW300CA.wrap("c")));
-            assertFalse(coll.contains(OW300CA.wrap("d")));
+            assertTrue(coll.contains(OW300.wrap("a")));
+            assertTrue(coll.contains(OW300.wrap("b")));
+            assertTrue(coll.contains(OW300.wrap("c")));
+            assertTrue(coll.contains(OW300.wrap("c")));
+            assertFalse(coll.contains(OW300.wrap("d")));
             try {
-                assertFalse(coll.contains(OW300CA.wrap(1)));
+                assertFalse(coll.contains(OW300.wrap(1)));
                 fail();
             } catch (TemplateModelException e) {
                 assertThat(e.getMessage(), containsString("Integer"));
             }
 
-            assertRoundtrip(OW300CA, set, DefaultNonListCollectionAdapter.class, TreeSet.class, "[a, b, c]");
+            assertRoundtrip(OW300, set, DefaultNonListCollectionAdapter.class, TreeSet.class, "[a, b, c]");
             
             assertSizeThroughAPIModel(3, coll);
         }
@@ -568,24 +510,24 @@ public class DefaultObjectWrapperTest {
             final List<String> list = Collections.singletonList("b");
             set.add(list);
             set.add(null);
-            TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300CA.wrap(set);
+            TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300.wrap(set);
             TemplateModelIterator it = coll.iterator();
             final TemplateModel tm1 = it.next();
-            Object obj1 = OW300CA.unwrap(tm1);
+            Object obj1 = OW300.unwrap(tm1);
             final TemplateModel tm2 = it.next();
-            Object obj2 = OW300CA.unwrap(tm2);
+            Object obj2 = OW300.unwrap(tm2);
             assertTrue(obj1 == null || obj2 == null);
             assertTrue(obj1 != null && obj1.equals(list) || obj2 != null && obj2.equals(list));
             assertTrue(tm1 instanceof DefaultListAdapter || tm2 instanceof DefaultListAdapter);
 
             List similarList = new ArrayList();
             similarList.add("b");
-            assertTrue(coll.contains(OW300CA.wrap(similarList)));
-            assertTrue(coll.contains(OW300CA.wrap(null)));
-            assertFalse(coll.contains(OW300CA.wrap("a")));
-            assertFalse(coll.contains(OW300CA.wrap(1)));
+            assertTrue(coll.contains(OW300.wrap(similarList)));
+            assertTrue(coll.contains(OW300.wrap(null)));
+            assertFalse(coll.contains(OW300.wrap("a")));
+            assertFalse(coll.contains(OW300.wrap(1)));
 
-            assertRoundtrip(OW300CA, set, DefaultNonListCollectionAdapter.class, HashSet.class, "[" + obj1 + ", "
+            assertRoundtrip(OW300, set, DefaultNonListCollectionAdapter.class, HashSet.class, "[" + obj1 + ", "
                     + obj2 + "]");
         }
     }
@@ -595,14 +537,14 @@ public class DefaultObjectWrapperTest {
     public void testCollectionAdapterOutOfBounds() throws TemplateModelException {
         Set set = Collections.singleton(123);
 
-        TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300CA.wrap(set);
+        TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300.wrap(set);
         TemplateModelIterator it = coll.iterator();
 
         for (int i = 0; i < 3; i++) {
             assertTrue(it.hasNext());
         }
 
-        assertEquals(123, OW300CA.unwrap(it.next()));
+        assertEquals(123, OW300.unwrap(it.next()));
 
         for (int i = 0; i < 3; i++) {
             assertFalse(it.hasNext());
@@ -620,29 +562,13 @@ public class DefaultObjectWrapperTest {
         Set set = new HashSet();
         set.add(null);
 
-        DefaultObjectWrapper dow = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
-        dow.setForceLegacyNonListCollections(false);
-        TemplateCollectionModelEx coll = (TemplateCollectionModelEx) dow.wrap(set);
+        TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300.wrap(set);
         assertEquals(1, coll.size());
         assertFalse(coll.isEmpty());
         assertNull(coll.iterator().next());
     }
 
     @Test
-    public void testLegacyNonListCollectionWrapping() throws TemplateModelException {
-        Set set = new TreeSet();
-        set.add("a");
-        set.add("b");
-        set.add("c");
-        TemplateSequenceModel seq = (TemplateSequenceModel) OW300.wrap(set);
-        assertTrue(seq instanceof SimpleSequence);
-        assertEquals(3, seq.size());
-        assertEquals("a", OW300.unwrap(seq.get(0)));
-        assertEquals("b", OW300.unwrap(seq.get(1)));
-        assertEquals("c", OW300.unwrap(seq.get(2)));
-    }
-
-    @Test
     public void testIteratorWrapping() throws TemplateModelException, ClassNotFoundException {
         final List<String> list = ImmutableList.of("a", "b", "c");
         Iterator<String> it = list.iterator();
@@ -719,42 +645,29 @@ public class DefaultObjectWrapperTest {
         
         String listingFTL = "<#list value as x>${x}<#sep>, </#list>";
         
-        {
-            DefaultObjectWrapper ow = OW300;
-            TemplateModel tm = ow.wrap(iterable);
-            assertThat(tm, instanceOf(TemplateHashModel.class));
-            assertThat(tm, not(instanceOf(TemplateCollectionModel.class)));
-            assertThat(tm, not(instanceOf(TemplateSequenceModel.class)));
-            assertNotNull(((TemplateHashModel) tm).get("iterator"));
-            
-            assertTemplateFails(ow, iterable, listingFTL, "iterableSupport");
-        }
-        
-        {
-            DefaultObjectWrapper ow = OW300IS;
-            TemplateModel tm = ow.wrap(iterable);
-            assertThat(tm, instanceOf(TemplateCollectionModel.class));
-            TemplateCollectionModel iterableTM = (TemplateCollectionModel) tm;
-            
-            for (int i = 0; i < 2; i++) {
-                TemplateModelIterator iteratorTM = iterableTM.iterator();
-                assertTrue(iteratorTM.hasNext());
-                assertEquals("a", ow.unwrap(iteratorTM.next()));
-                assertTrue(iteratorTM.hasNext());
-                assertEquals("b", ow.unwrap(iteratorTM.next()));
-                assertTrue(iteratorTM.hasNext());
-                assertEquals("c", ow.unwrap(iteratorTM.next()));
-                assertFalse(iteratorTM.hasNext());
-                try {
-                    iteratorTM.next();
-                    fail();
-                } catch (TemplateModelException e) {
-                    assertThat(e.getMessage(), containsStringIgnoringCase("no more"));
-                }
+        DefaultObjectWrapper ow = OW300;
+        TemplateModel tm = ow.wrap(iterable);
+        assertThat(tm, instanceOf(TemplateCollectionModel.class));
+        TemplateCollectionModel iterableTM = (TemplateCollectionModel) tm;
+
+        for (int i = 0; i < 2; i++) {
+            TemplateModelIterator iteratorTM = iterableTM.iterator();
+            assertTrue(iteratorTM.hasNext());
+            assertEquals("a", ow.unwrap(iteratorTM.next()));
+            assertTrue(iteratorTM.hasNext());
+            assertEquals("b", ow.unwrap(iteratorTM.next()));
+            assertTrue(iteratorTM.hasNext());
+            assertEquals("c", ow.unwrap(iteratorTM.next()));
+            assertFalse(iteratorTM.hasNext());
+            try {
+                iteratorTM.next();
+                fail();
+            } catch (TemplateModelException e) {
+                assertThat(e.getMessage(), containsStringIgnoringCase("no more"));
             }
-            
-            assertTemplateOutput(OW300IS, iterable, listingFTL, "a, b, c");
         }
+
+        assertTemplateOutput(OW300, iterable, listingFTL, "a, b, c");
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes.txt b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes.txt
index 15d4efd..01c8f88 100644
--- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes.txt
+++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes.txt
@@ -70,4 +70,4 @@ MyList: [1, 2, 3] [org.apache.freemarker.servlet.jsp.RealServletContainertTest$M
 LinkedHashMap: {a=1, b=2, c=3} [java.util.LinkedHashMap]
 TreeMap: {a=1, b=2, c=3} [java.util.TreeMap]
 MyMap: {a=1, b=2, c=3} [org.apache.freemarker.servlet.jsp.RealServletContainertTest$MyMap]
-TreeSet: [1, 2, 3] [org.apache.freemarker.core.model.impl.beans.SequenceAdapter]
\ No newline at end of file
+TreeSet: [1, 2, 3] [java.util.TreeSet]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml
index 0fa1a03..0b984af 100644
--- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml
+++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/web.xml
@@ -97,7 +97,7 @@
         </init-param>
         <init-param>
             <param-name>object_wrapper</param-name>
-            <param-value>DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)</param-value>
+            <param-value>DefaultObjectWrapper(3.0.0)</param-value>
         </init-param>
         
         <!-- Common parts: -->

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/03aecddc/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml b/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml
index afd7a84..c573c72 100644
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml
@@ -18,7 +18,7 @@
   under the License.
 -->
 
-<!DOCTYPE testcases [
+<!DOCTYPE testCases [
   <!ELEMENT testCases (setting?, testCase*)>
   <!ELEMENT testCase (setting?)>
      <!ATTLIST testCase 
@@ -57,7 +57,7 @@ Note that for the incompatible_improvements setting you can specify a list of ve
    
    <testCase name="api-builtins" noOutput="true">
       <setting
-            object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)"
+            object_wrapper="DefaultObjectWrapper(3.0.0)"
             api_builtin_enabled="true"
       />
    </testCase>
@@ -108,23 +108,23 @@ Note that for the incompatible_improvements setting you can specify a list of ve
       <setting object_wrapper="org.apache.freemarker.test.util.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
    </testCase>
    <testCase name="list[#endTN]-collectionAdapter" expected="list.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)" />
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
    </testCase>
    <testCase name="list2[#endTN]-simpleTemplateModels" expected="list2.txt">
       <setting object_wrapper="org.apache.freemarker.test.util.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
    </testCase>
    <testCase name="list2[#endTN]-collectionAdapter" expected="list2.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)" />
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
    </testCase>
    <testCase name="list3[#endTN]-simpleTemplateModels" expected="list3.txt">
       <setting object_wrapper="org.apache.freemarker.test.util.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
    </testCase>
    <testCase name="list3[#endTN]-collectionAdapter" expected="list3.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)" />
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
    </testCase>
    <testCase name="list-bis" />
    <testCase name="list-bis[#endTN]-collectionAdapter" expected="list-bis.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)" />
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)" />
    </testCase>
    <testCase name="listhash" />
    <testCase name="listhashliteral" />
@@ -168,7 +168,7 @@ Note that for the incompatible_improvements setting you can specify a list of ve
       <setting object_wrapper="default"/> 
    </testCase>
    <testCase name="sequence-builtins[#endTN]-with-DefaultObjectWrapper-collAdapters" expected="sequence-builtins.txt">
-      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)"/> 
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0)"/>
    </testCase>
    <testCase name="simplehash-char-key" noOutput="true" />
    <testCase name="existence-operators" noOutput="true" />


Mime
View raw message