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 parameterless DefaultObjectWrapper and BeansWrapper constructors. Now specifying the incomplatibleImprovement version is required.
Date Mon, 20 Feb 2017 20:57:42 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 ea3a06b5b -> b3365cbc7


Removed parameterless DefaultObjectWrapper and BeansWrapper constructors. Now specifying the
 incomplatibleImprovement version is required.


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

Branch: refs/heads/3
Commit: b3365cbc760f0c1d9c917bc3ed6313a95ce24b01
Parents: ea3a06b
Author: ddekany <ddekany@apache.org>
Authored: Mon Feb 20 21:57:34 2017 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Mon Feb 20 21:57:34 2017 +0100

----------------------------------------------------------------------
 .../core/model/impl/DefaultObjectWrapper.java     | 12 ------------
 src/manual/en_US/FM3-CHANGE-LOG.txt               |  4 +++-
 .../freemarker/core/ast/ListErrorsTest.java       |  4 +++-
 .../core/model/impl/DefaultObjectWrapperTest.java |  2 +-
 .../DefaultObjectWrapperWithSortedMethods.java    |  4 ++--
 .../util/SimpleMapAndCollectionObjectWrapper.java | 18 ++++++++++++++++++
 6 files changed, 27 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b3365cbc/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 2da53de..224836d 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
@@ -68,18 +68,6 @@ public class DefaultObjectWrapper extends org.apache.freemarker.core.model.impl.
     private boolean iterableSupport;
     
     /**
-     * Creates a new instance with the incompatible-improvements-version specified in
-     * {@link Configuration#DEFAULT_INCOMPATIBLE_IMPROVEMENTS}.
-     * 
-     * @deprecated Use {@link DefaultObjectWrapperBuilder}, or in rare cases,
-     *          {@link #DefaultObjectWrapper(Version)} instead.
-     */
-    @Deprecated
-    public DefaultObjectWrapper() {
-        this(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
-    }
-    
-    /**
      * 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.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b3365cbc/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 68899fb..6e6aae2 100644
--- a/src/manual/en_US/FM3-CHANGE-LOG.txt
+++ b/src/manual/en_US/FM3-CHANGE-LOG.txt
@@ -103,6 +103,8 @@ the FreeMarer 3 changelog here:
   - Removed the overridable BeansWrapper.finetuneMethodAppearance method, which was deprecated
by the
     finetuneMethodAppearance setting (BeansWrapper.setFinetuneMethodAppearance).
   - Removed NodeModel static utility classes dealing with parsing XML to DOM. How it's best
to do that is environment
-    and application dependent, and it has security implications. Since XML loading/parsing
it's not the topic of the
+    and application dependent, and it has security implications. Since XML loading/parsing
is not the topic of the
     project, these were removed. Static methods that simplify an already loaded DOM have
remained, because that's
     FreeMarker-specific functionality.
+  - Removed parameterless DefaultObjectWrapper and BeansWrapper constructors. Now specifying
the
+    incomplatibleImprovement version is required.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b3365cbc/src/test/java/org/apache/freemarker/core/ast/ListErrorsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/ListErrorsTest.java b/src/test/java/org/apache/freemarker/core/ast/ListErrorsTest.java
index 9661e85..6f48f7c 100644
--- a/src/test/java/org/apache/freemarker/core/ast/ListErrorsTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/ListErrorsTest.java
@@ -21,6 +21,7 @@ package org.apache.freemarker.core.ast;
 
 import java.io.IOException;
 
+import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
 import org.apache.freemarker.test.TemplateTest;
@@ -127,7 +128,8 @@ public class ListErrorsTest extends TemplateTest {
 
     @Test
     public void testNonEx2NonStringKey() throws IOException, TemplateException {
-        addToDataModel("m", new Listables.NonEx2MapAdapter(ImmutableMap.of("k1", "v1", 2,
"v2"), new DefaultObjectWrapper()));
+        addToDataModel("m", new Listables.NonEx2MapAdapter(ImmutableMap.of("k1", "v1", 2,
"v2"),
+                new DefaultObjectWrapper(Configuration.VERSION_3_0_0)));
         assertOutput("<#list m?keys as k>${k};</#list>", "k1;2;");
         assertErrorContains("<#list m as k, v></#list>",
                 "string", "number", ".TemplateHashModelEx2");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b3365cbc/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 60b993b..d424114 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
@@ -221,7 +221,7 @@ public class DefaultObjectWrapperTest {
     @Test
     public void testConstructors() throws Exception {
         {
-            DefaultObjectWrapper ow = new DefaultObjectWrapper();
+            DefaultObjectWrapper ow = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
             assertEquals(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS, ow.getIncompatibleImprovements());
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b3365cbc/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperWithSortedMethods.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperWithSortedMethods.java
b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperWithSortedMethods.java
index 59917ed..a67aad2 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperWithSortedMethods.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperWithSortedMethods.java
@@ -19,14 +19,14 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
+import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 
 public class DefaultObjectWrapperWithSortedMethods extends DefaultObjectWrapper {
     
     public DefaultObjectWrapperWithSortedMethods(boolean desc) {
-        setMethodSorter(this, desc);
+        this(Configuration.VERSION_3_0_0, desc);
     }
 
     public DefaultObjectWrapperWithSortedMethods(Version incompatibleImprovements, boolean
desc) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b3365cbc/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java
b/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java
index 66f36de..1c787ce 100644
--- a/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java
+++ b/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.freemarker.test.util;
 
 import java.util.Collection;


Mime
View raw message