You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2017/02/20 10:14:24 UTC

[1/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.

Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 410fd0d8c -> 8ba7883e5


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods.ftl
new file mode 100644
index 0000000..2d85dcc
--- /dev/null
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods.ftl
@@ -0,0 +1,413 @@
+<#--
+  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.
+-->
+
+<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringList) expected="mStringArrayVsListPreference(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringArray) expected="mStringArrayVsListPreference(String[] [a, b])" />
+<#if dow>
+  <@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaObjectArray) expected="mStringArrayVsListPreference(List [a, b])" />
+</#if>
+
+<#-- Check if non-overloaded calls still work; they share some code with overloaded methods: -->
+<@assertEquals actual=obj.mIntArrayNonOverloaded([1, 2, 3]) expected="mIntArrayNonOverloaded(int[] [1, 2, 3])" />
+<@assertEquals actual=obj.mIntegerArrayNonOverloaded([1, 2, 3]) expected="mIntegerArrayNonOverloaded(Integer[] [1, 2, 3])" />
+<@assertEquals actual=obj.mIntegerListNonOverloaded([1, 2, 3]) expected="mIntegerListNonOverloaded(List<Integer> [1, 2, 3])" />
+<@assertEquals actual=obj.mStringListNonOverloaded(['a', 'b', 'c']) expected="mStringListNonOverloaded(List<String> [a, b, c])" />
+<@assertEquals actual=obj.mStringListNonOverloaded(obj.javaStringList) expected="mStringListNonOverloaded(List<String> [a, b])" />
+<@assertEquals actual=obj.mStringListNonOverloaded(obj.javaStringArray) expected="mStringListNonOverloaded(List<String> [a, b])" />
+<@assertEquals actual=obj.mStringArrayNonOverloaded(['a', 'b', 'c']) expected="mStringArrayNonOverloaded(String[] [a, b, c])" />
+<@assertEquals actual=obj.mStringArrayNonOverloaded(obj.javaStringList) expected="mStringArrayNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayNonOverloaded(obj.javaStringArray) expected="mStringArrayNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mObjectListNonOverloaded(['a', 'b', 3]) expected="mObjectListNonOverloaded(List<Object> [a, b, 3])" />
+<@assertEquals actual=obj.mObjectListNonOverloaded(obj.javaStringList) expected="mObjectListNonOverloaded(List<Object> [a, b])" />
+<@assertEquals actual=obj.mObjectListNonOverloaded(obj.javaStringArray) expected="mObjectListNonOverloaded(List<Object> [a, b])" />
+<@assertEquals actual=obj.mObjectArrayNonOverloaded(['a', 'b', 3]) expected="mObjectArrayNonOverloaded(Object[] [a, b, 3])" />
+<@assertEquals actual=obj.mObjectArrayNonOverloaded(obj.javaStringList) expected="mObjectArrayNonOverloaded(Object[] [a, b])" />
+<@assertEquals actual=obj.mObjectArrayNonOverloaded(obj.javaStringArray) expected="mObjectArrayNonOverloaded(Object[] [a, b])" />
+
+<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringArray) expected="mStringArrayVsListPreference(String[] [a, b])" />
+
+<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded('a', 'b') expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(['a', 'b']) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(obj.javaStringList) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(obj.javaStringArray) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
+
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded1('a', 'b') expected="mStringArrayVarargsOverloaded1(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(['a', 'b']) expected="mStringArrayVarargsOverloaded1(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(obj.javaStringList) expected="mStringArrayVarargsOverloaded1(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(obj.javaStringArray) expected="mStringArrayVarargsOverloaded1(String[] [a, b])" />
+
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2('a', 'b') expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2('a') expected="mStringArrayVarargsOverloaded2(String a)" />
+
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a']) expected="mStringArrayVarargsOverloaded3(String[] [a])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a', 'b']) expected="mStringArrayVarargsOverloaded3(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a', 'b', 'c']) expected="mStringArrayVarargsOverloaded3(String[] [a, b, c])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a') expected="mStringArrayVarargsOverloaded3(String[] [a])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a', 'b') expected="mStringArrayVarargsOverloaded3(String a, String b)" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a', 'b', 'c') expected="mStringArrayVarargsOverloaded3(String[] [a, b, c])" />
+
+<@assertEquals actual=obj.mListOrString(['a', 'b']) expected="mListOrString(List [a, b])" />
+<@assertEquals actual=obj.mListOrString('a') expected="mListOrString(String a)" />
+<@assertEquals actual=obj.mListListOrString([['a'], 'b', 3]) expected="mListListOrString(List [[a], b, 3])" />
+<@assertEquals actual=obj.mListListOrString('s') expected="mListListOrString(String s)" />
+
+<#-- Because the fixed arg interpretations are ambiguous, it only considers the vararg interpretations:  -->
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(['a', 'b', 'c']) expected="mStringArrayVarargsOverloaded4(List[] [[a, b, c]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4('a', 'b', 'c') expected="mStringArrayVarargsOverloaded4(String[] [a, b, c])" />
+
+<#-- Fixed arg solutions have priority: -->
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(String[] [a, b])" />
+
+<#-- Choses between the vararg solutions: -->
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
+
+<#-- Until there's no overloading String->Character conversion work: -->
+<@assertEquals actual=obj.mCharNonOverloaded('c') expected="mCharNonOverloaded(char c)" />
+<@assertEquals actual=obj.mCharNonOverloaded(obj.javaString) expected="mCharNonOverloaded(char s)" />
+<@assertEquals actual=obj.mCharacterNonOverloaded('c') expected="mCharacterNonOverloaded(Character c)" />
+<@assertEquals actual=obj.mCharacterNonOverloaded(obj.javaString) expected="mCharacterNonOverloaded(Character s)" />
+
+<@assertEquals actual=obj.mCharOrStringOverloaded('s', 1) expected="mCharOrStringOverloaded(String s, int 1)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded('s', 1) expected="mCharacterOrStringOverloaded(String s, int 1)" />
+<@assertEquals actual=obj.mCharOrStringOverloaded2('ss') expected="mCharOrStringOverloaded2(String ss)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded2('ss') expected="mCharacterOrStringOverloaded2(String ss)" />
+
+<@assertEquals actual=obj.mVarargs('a', obj.getNnS('b'), obj.getNnS('c')) expected='mVarargs(String... a1 = abc)' />
+
+<@assertEquals actual=obj.mNull1(null) expected="mNull1(String a1 = null)" />
+<@assertEquals actual=obj.mNull1(123) expected="mNull1(int a1 = 123)" />
+<@assertEquals actual=obj.mNull2(null) expected="mNull2(String a1 = null)" />
+<@assertEquals actual=obj.mVarargs('a', null) expected="mVarargs(String... a1 = anull)" />
+<@assertEquals actual=obj.mVarargs(null, 'a') expected="mVarargs(File a1, String... a2)" />
+<@assertEquals actual=obj.mSpecificity('a', 'b') expected="mSpecificity(String a1, Object a2)" />
+
+<@assertEquals actual=obj.mChar('a') expected='mChar(char a1 = a)' />
+<@assertEquals actual=obj.mBoolean(true) expected="mBoolean(boolean a1 = true)" />
+<@assertEquals actual=obj.mBoolean(null) expected="mBoolean(Boolean a1 = null)" />
+
+<@assertEquals actual=obj.mIntNonOverloaded(123?long) expected=123 />
+<@assertEquals actual=obj.mIntNonOverloaded(123) expected=123 />
+<@assertEquals actual=obj.mIntNonOverloaded(123.5) expected=123 />
+<@assertEquals actual=obj.mIntNonOverloaded(2147483648) expected=-2147483648 /> <#-- overflow -->
+<@assertEquals actual=obj.mNumBoxedVSBoxed(123.5) expected='mNumBoxedVSBoxed(Long a1 = 123)' />
+<@assertEquals actual=obj.mNumBoxedVSBoxed(123?int) expected='mNumBoxedVSBoxed(Long a1 = 123)' />
+<@assertEquals actual=obj.mNumBoxedVSBoxed(123?long) expected="mNumBoxedVSBoxed(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedVSBoxed(123?short) expected="mNumBoxedVSBoxed(Short a1 = 123)" />
+<@assertEquals 
+    actual=obj.mNumUnambigous(2147483648) expected="mNumUnambigous(Integer a1 = -2147483648)" /> <#-- overflow -->
+
+<@assertEquals actual=obj.mIntPrimVSBoxed(123?int) expected="mIntPrimVSBoxed(int a1 = 123)" />
+<@assertEquals actual=obj.mIntPrimVSBoxed(123?short) expected="mIntPrimVSBoxed(int a1 = 123)" />
+<@assertEquals actual=obj.mIntPrimVSBoxed(123) expected="mIntPrimVSBoxed(int a1 = 123)" />
+<#-- This doesn't fail as 123L can be converted to int without loss: -->
+<@assertEquals actual=obj.mIntPrimVSBoxed(123?long) expected="mIntPrimVSBoxed(int a1 = 123)" />
+
+<@assertEquals actual=obj.mNumPrimVSPrim(123?short) expected="mNumPrimVSPrim(short a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimVSPrim(123?int) expected="mNumPrimVSPrim(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimVSPrim(123?long) expected="mNumPrimVSPrim(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimVSPrim(123?double) expected="mNumPrimVSPrim(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimVSPrim(123456) expected="mNumPrimVSPrim(long a1 = 123456)" />
+
+<@assertEquals actual=obj.mNumPrimAll(123?byte) expected="mNumPrimAll(byte a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(123?short) expected="mNumPrimAll(short a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(123?int) expected="mNumPrimAll(int a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(123?long) expected="mNumPrimAll(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(123?float) expected="mNumPrimAll(float a1 = 123.0)" />
+<@assertEquals actual=obj.mNumPrimAll(123?double) expected="mNumPrimAll(double a1 = 123.0)" />
+<@assertEquals actual=obj.mNumPrimAll(123) expected="mNumPrimAll(BigDecimal a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll(obj.bigInteger(123)) expected="mNumPrimAll(BigInteger a1 = 123)" />
+
+<@assertEquals actual=obj.mNumBoxedAll(123?byte) expected="mNumBoxedAll(Byte a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?short) expected="mNumBoxedAll(Short a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?int) expected="mNumBoxedAll(Integer a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?long) expected="mNumBoxedAll(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?float) expected="mNumBoxedAll(Float a1 = 123.0)" />
+<@assertEquals actual=obj.mNumBoxedAll(123?double) expected="mNumBoxedAll(Double a1 = 123.0)" />
+<@assertEquals actual=obj.mNumBoxedAll(123) expected="mNumBoxedAll(BigDecimal a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll(obj.bigInteger(123)) expected="mNumBoxedAll(BigInteger a1 = 123)" />
+
+<@assertEquals actual=obj.mNumPrimAll2nd(123?byte) expected="mNumPrimAll2nd(short a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?short) expected="mNumPrimAll2nd(short a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?int) expected="mNumPrimAll2nd(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?long) expected="mNumPrimAll2nd(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?float) expected="mNumPrimAll2nd(double a1 = 123.0)" />
+<@assertEquals actual=obj.mNumPrimAll2nd(123?double) expected="mNumPrimAll2nd(double a1 = 123.0)" />
+
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?byte) expected="mNumBoxedAll2nd(Short a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?short) expected="mNumBoxedAll2nd(Short a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?int) expected="mNumBoxedAll2nd(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?long) expected="mNumBoxedAll2nd(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?float) expected="mNumBoxedAll2nd(Double a1 = 123.0)" />
+<@assertEquals actual=obj.mNumBoxedAll2nd(123?double) expected="mNumBoxedAll2nd(Double a1 = 123.0)" />
+ 
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?int) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?long) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?double) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123.5?double) expected="mNumPrimFallbackToNumber(Number a1 = 123.5)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(123) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(123)) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(9223372036854775808))
+    expected="mNumPrimFallbackToNumber(Number a1 = 9223372036854775808)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.rational(246, 2)) expected="mNumPrimFallbackToNumber(Number a1 = 246/2)" />
+<@assertEquals actual=obj.mNumPrimFallbackToNumber('x') expected="mNumPrimFallbackToNumber(Object a1 = x)" />
+
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?int) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?long) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?double) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123.5?double) expected="mNumBoxedFallbackToNumber(Number a1 = 123.5)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(123)) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(9223372036854775808))
+    expected="mNumBoxedFallbackToNumber(Number a1 = 9223372036854775808)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.rational(246, 2)) expected="mNumBoxedFallbackToNumber(Number a1 = 246/2)" />
+<@assertEquals actual=obj.mNumBoxedFallbackToNumber('x') expected="mNumBoxedFallbackToNumber(Object a1 = x)" />
+
+<@assertEquals actual=obj.mDecimalLoss(1.5) expected="mDecimalLoss(double a1 = 1.5)" />
+<@assertEquals actual=obj.mDecimalLoss(1.5?double) expected="mDecimalLoss(double a1 = 1.5)" />
+
+<@assertEquals actual=obj.mNumConversionLoses1(1?double, '', '') expected="Number 1.0 java.lang.Double" />
+<@assertEquals actual=obj.mNumConversionLoses1(1?short, '', '') expected="Number 1 java.lang.Short" />
+<@assertEquals actual=obj.mNumConversionLoses1(1?long, '', '') expected="Number 1 java.lang.Long" />
+<@assertEquals actual=obj.mNumConversionLoses2(1?double, '', '') expected="Number 1.0 java.lang.Double" />
+<@assertEquals actual=obj.mNumConversionLoses2(1?short, '', '') expected="Number 1 java.lang.Short" />
+<@assertEquals actual=obj.mNumConversionLoses2(1?long, '', '') expected="Number 1 java.lang.Long" />
+<@assertEquals actual=obj.mNumConversionLoses3(1?double, '', '') expected="Serializable 1.0 java.lang.Double" />
+<@assertEquals actual=obj.mNumConversionLoses3(1?int, '', '') expected="Serializable 1 java.lang.Integer" />
+<@assertEquals actual=obj.mNumConversionLoses3(1?short, '', '') expected="Serializable 1 java.lang.Short" />
+<@assertEquals actual=obj.mNumConversionLoses3(1?long, '', '') expected="Serializable 1 java.lang.Long" />
+
+<#-- BigDecimal-to-int is preferred over to-long for BC and user expectations: -->
+<@assertEquals actual=obj.nIntAndLong(1) expected="nIntAndLong(int 1)" />
+<@assertEquals actual=obj.nIntAndLong(1?long) expected="nIntAndLong(long 1)" />
+<#-- BigDecimal-to-short is, however unfavored due to the higher chance of overflow: -->
+<@assertEquals actual=obj.nIntAndShort(1) expected="nIntAndShort(int 1)" />
+<@assertEquals actual=obj.nIntAndShort(1?short) expected="nIntAndShort(short 1)" />
+<@assertEquals actual=obj.nLongAndShort(1) expected="nLongAndShort(long 1)" />
+<@assertEquals actual=obj.nLongAndShort(1?short) expected="nLongAndShort(short 1)" />
+
+<@assertEquals actual=obj.varargs1(null, 1, 2, 3.5) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.5])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2.5, 3) expected='varargs1(String s = null, double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs1(null, 1.5, 2, 3) expected='varargs1(String s = null, double... xs = [1.5, 2.0, 3.0])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2, 'c') expected='varargs1(String s = null, Object... xs = [1, 2, c])' />
+<@assertEquals actual=obj.varargs1(null, 1, 'b', 3) expected='varargs1(String s = null, Object... xs = [1, b, 3])' />
+<@assertEquals actual=obj.varargs1(null, 'a', 2, 3) expected='varargs1(String s = null, Object... xs = [a, 2, 3])' />
+<@assertEquals actual=obj.varargs1('s', 1, 2, 3) expected='varargs1(String s = "s", int... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1('s', 1.1, 2.1, 3.1) expected='varargs1(String s = "s", double... xs = [1.1, 2.1, 3.1])' />
+<@assertEquals actual=obj.varargs1('s', 'a', 'b', 'c') expected='varargs1(String s = "s", Object... xs = [a, b, c])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2, 3) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1(null, 1.1, 2.1, 3.1) expected='varargs1(String s = null, double... xs = [1.1, 2.1, 3.1])' />
+<@assertEquals actual=obj.varargs1(null, 'a', 'b', 'c') expected='varargs1(String s = null, Object... xs = [a, b, c])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2, 3?double) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2?double, 3?double) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.0])' />
+<@assertEquals actual=obj.varargs1(null, 1, 2?float, 3?float) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.0])' />
+<@assertEquals actual=obj.varargs1(null, 1?double, 2?byte, 3?byte) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1(0, 1, 2, 3) expected='varargs1(Object s = 0, Object... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs1('s') expected='varargs1(String s = "s", int... xs = [])' />
+
+<@assertEquals actual=obj.varargs2(1, 2.5, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs2(1, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs2(1?int, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs2(1?long, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
+<@assertEquals actual=obj.varargs2(1?long, 2?double, 3) expected='varargs2(int... xs = [1, 2, 3])' />
+
+<@assertEquals actual=obj.varargs3(1, 2, 3) expected='varargs3(Comparable... xs = [1, 2, 3])' />
+<@assertEquals actual=obj.varargs3('a', 'b', 'c') expected='varargs3(String... xs = [a, b, c])' />
+<@assertEquals actual=obj.varargs3(1, 'b', 'c') expected='varargs3(Comparable... xs = [1, b, c])' />
+<@assertEquals actual=obj.varargs3('a', 'b', 3) expected='varargs3(Comparable... xs = [a, b, 3])' />
+<@assertEquals actual=obj.varargs3('a', [], 3) expected='varargs3(Object... xs = [a, [], 3])' />
+<@assertEquals actual=obj.varargs3(null, 'b', null) expected='varargs3(String... xs = [null, b, null])' />
+<@assertEquals actual=obj.varargs3(null, 2, null) expected='varargs3(Comparable... xs = [null, 2, null])' />
+<@assertEquals actual=obj.varargs3(null, [], null) expected='varargs3(Object... xs = [null, [], null])' />
+<@assertEquals actual=obj.varargs3(null, null, null) expected='varargs3(String... xs = [null, null, null])' />
+<@assertEquals actual=obj.varargs3() expected='varargs3(String... xs = [])' />
+
+<@assertEquals actual=obj.varargs4(null) expected='varargs4(Integer... xs = [null])' />
+<@assertEquals actual=obj.varargs4(null, null, null) expected='varargs4(Integer... xs = [null, null, null])' />
+<@assertEquals actual=obj.varargs4(1, null, 2) expected='varargs4(Integer... xs = [1, null, 2])' />
+<@assertEquals actual=obj.varargs4(1) expected='varargs4(int... xs = [1])' />
+<@assertEquals actual=obj.varargs4(1, 2, 3) expected='varargs4(int... xs = [1, 2, 3])' />
+
+<@assertEquals actual=obj.varargs5(1, 2, 3, 4, 5) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [4, 5])' />
+<@assertEquals actual=obj.varargs5(1, 2, 3, 4) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [4])' />
+<@assertEquals actual=obj.varargs5(1, 2, 3) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [])' />
+<@assertEquals actual=obj.varargs5(1, 2) expected='varargs5(int a1 = 1, int a2 = 2, int... xs = [])' />
+<@assertEquals actual=obj.varargs5(1) expected='varargs5(int a1 = 1, int... xs = [])' />
+<@assertEquals actual=obj.varargs5() expected='varargs5(int... xs = [])' />
+
+<@assertEquals actual=obj.varargs6('s', 2) expected='varargs6(String a1 = s, int... xs = [2])' />
+<@assertEquals actual=obj.varargs6('s') expected='varargs6(String a1 = s, int... xs = [])' />
+<@assertEquals actual=obj.varargs6(1, 2) expected='varargs6(Object a1 = 1, int a2 = 2, int... xs = [])' />
+<@assertFails message="no compatible overloaded">${obj.varargs6(1)}</@>
+
+<@assertEquals actual=obj.varargs7(1?int, 2?int) expected='varargs7(int... xs = [1, 2])' />
+<@assertEquals actual=obj.varargs7(1?short, 2?int) expected='varargs7(short a1 = 1, int... xs = [2])' />
+
+<#-- Tests that a pre-2.3.21 bug is fixed now: -->
+<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3) expected='mVarargsIgnoredTail(int... is = [1, 2, 3])' />
+<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3.5) expected='mVarargsIgnoredTail(int i = 1, double... ds = [2.0, 3.5])' />
+
+<@assertEquals actual=obj.mNullAmbiguous('a') expected='mNullAmbiguous(String s = a)' />
+<@assertEquals actual=obj.mNullAmbiguous(123) expected='mNullAmbiguous(int i = 123)' />
+<@assertEquals actual=obj.mNullAmbiguous(1.9) expected='mNullAmbiguous(int i = 1)' />
+<@assertEquals actual=obj.mNullAmbiguous(1?double) expected='mNullAmbiguous(int i = 1)' />
+<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(1.9?double)}</@>
+<@assertFails message="multiple compatible overloaded">${obj.mNullAmbiguous(null)}</@>
+
+<@assertFails message="multiple compatible overloaded">${obj.mNullAmbiguous2(null)}</@>
+
+<@assertEquals actual=obj.mNullNonAmbiguous(null) expected='mNullNonAmbiguous(String s = null)' />
+
+<#-- The primitive int-s will win twice, but then String wins over Object, which is stronger: -->
+<@assertEquals actual=obj.mLowRankWins(1, 2, 'a') expected='mLowRankWins(Integer x = 1, Integer y = 2, String s = a)' />
+
+<@assertEquals actual=obj.mRareWrappings(obj.file, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringWrappedAsBoolean)
+               expected='mRareWrappings(File f = file, double d1 = 123.0002, Double d2 = 123.0002, double d3 = 123.0002, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.stringWrappedAsBoolean, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringAdaptedToBoolean)
+               expected='mRareWrappings(String s = yes, double d1 = 123.0002, Double d2 = 123.0002, double d3 = 123.0002, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.stringAdaptedToBoolean2, obj.wrapperNumber, obj.wrapperNumber, obj.wrapperNumber, obj.stringAdaptedToBoolean2)
+               expected='mRareWrappings(String s = yes, double d1 = 123.0001, Double d2 = 123.0001, double d3 = 123.0001, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, obj.booleanWrappedAsAnotherBoolean)
+               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.adaptedNumber, 0, 0, 0, !obj.booleanWrappedAsAnotherBoolean)
+               expected='mRareWrappings(Object o = 124, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
+<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, !obj.stringAdaptedToBoolean)
+               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
+               
+<@assertEquals actual=obj.mRareWrappings2(obj.adaptedNumber) expected='mRareWrappings2(byte b = 124)' />
+
+<#-- Test for List VS array problems due to too vague hinting: -->
+
+<@assertEquals actual=obj.mSeqToArrayNonOverloaded(['a', 'b'], 'c') expected='mSeqToArrayNonOverloaded(String[] [a, b], String c)' />
+
+<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 'c') expected='mSeqToArrayGoodHint(String[] [a, b], String c)' />
+<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 3) expected='mSeqToArrayGoodHint(String[] [a, b], int 3)' />
+
+<@assertEquals actual=obj.mSeqToArrayGoodHint2(['a', 'b'], 'c') expected='mSeqToArrayGoodHint2(String[] [a, b], String c)' />
+<@assertEquals actual=obj.mSeqToArrayGoodHint2('a') expected='mSeqToArrayGoodHint2(String a)' />
+
+<@assertEquals actual=obj.mSeqToArrayPoorHint(['a', 'b'], 'c') expected='mSeqToArrayPoorHint(String[] [a, b], String c)' />
+<@assertEquals actual=obj.mSeqToArrayPoorHint('a', 2) expected='mSeqToArrayPoorHint(String a, int 2)' />
+
+<@assertEquals actual=obj.mSeqToArrayPoorHint2(['a', 'b']) expected='mSeqToArrayPoorHint2(String[] [a, b])' />
+<@assertEquals actual=obj.mSeqToArrayPoorHint2('a') expected='mSeqToArrayPoorHint2(String a)' />
+
+<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3(['a', 'b']) expected='mSeqToArrayPoorHint3(String[] [a, b])' /></@>
+<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3([1, 2]) expected='mSeqToArrayPoorHint3(int[] [a, b])' /></@>
+
+<@assertEquals actual=obj.mStringArrayVsListPreference(['a', 'b']) expected="mStringArrayVsListPreference(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaObjectArray) expected="mStringArrayVsListPreference(List [a, b])" />
+<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(['a', 'b']) expected="mStringArrayVsObjectArrayPreference(Object[] [a, b])" />
+<@assertEquals actual=obj.mIntArrayVsIntegerArrayPreference([1, 2]) expected="mIntArrayVsIntegerArrayPreference(Integer[] [1, 2])" />
+
+<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaStringArray) expected="mStringArrayVsObjectArrayPreference(String[] [a, b])" />
+<@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaIntArray)}</@>
+<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaIntegerArray) expected="mStringArrayVsObjectArrayPreference(Object[] [11, 22])" />
+
+<@assertEquals actual=obj.mIntegerArrayOverloaded([1, 2], 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
+<@assertEquals actual=obj.mIntegerArrayOverloaded([1?byte, 2?byte], 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
+<@assertEquals actual=obj.mIntegerArrayOverloaded(obj.javaIntegerList, 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
+<@assertEquals actual=obj.mIntegerArrayOverloaded(obj.javaByteList, 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
+
+<@assertEquals actual=obj.mStringArrayOverloaded(['a', 'b'], 3) expected="mStringArrayOverloaded(String[] [a, b], int 3)" />
+<@assertEquals actual=obj.mStringArrayOverloaded(obj.javaStringList, 3) expected="mStringArrayOverloaded(String[] [a, b], int 3)" />
+<@assertEquals actual=obj.mStringArrayOverloaded(obj.javaCharacterList, 3) expected="mStringArrayOverloaded(String[] [c, C], int 3)" />
+<@assertFails message="Failed to convert sequence">${obj.mStringArrayOverloaded([1, 2], 3)}</@>
+<@assertFails message="Failed to convert">${obj.mStringArrayOverloaded(obj.javaIntegerList, 3)}</@>
+
+<@assertEquals actual=obj.mCharArrayOverloaded(['a', 'b'], 3) expected="mCharArrayOverloaded(char[] [a, b], int 3)" />
+<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaCharacterList, 3) expected="mCharArrayOverloaded(char[] [c, C], int 3)" />
+<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaStringList, 3) expected="mCharArrayOverloaded(char[] [a, b], int 3)" />
+<@assertFails message="Failed to convert sequence">${obj.mCharArrayOverloaded(['aa', 'bb'], 3)}</@>
+<@assertFails message="Failed to convert">${obj.mCharArrayOverloaded(obj.javaString2List, 3)}</@>
+<@assertEquals actual=obj.mCharArrayOverloaded(['a', 'b'], 's') expected="mCharArrayOverloaded(Character[] [a, b], String s)" />
+<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaCharacterList, 's') expected="mCharArrayOverloaded(Character[] [c, C], String s)" />
+<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaStringList, 's') expected="mCharArrayOverloaded(Character[] [a, b], String s)" />
+<@assertFails message="Failed to convert sequence">${obj.mCharArrayOverloaded(['aa', 'bb'], 's')}</@>
+<@assertFails message="Failed to convert">${obj.mCharArrayOverloaded(obj.javaString2List, 's')}</@>
+
+<@assertEquals actual=obj.mStringArrayArrayOverloaded([['a', 'b'], ['c']], 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
+<@assertEquals actual=obj.mStringArrayArrayOverloaded(obj.javaStringListList, 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
+<@assertEquals actual=obj.mStringArrayArrayOverloaded(obj.javaStringSequenceList, 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
+<@assertFails message="Failed to convert">${obj.mStringArrayArrayOverloaded(obj.javaStringList, 3)}</@>
+<@assertFails message="Failed to convert">${obj.mStringArrayArrayOverloaded(obj.javaIntegerListList, 3)}</@>
+<@assertEquals actual=obj.mIntArrayArrayOverloaded(obj.javaListOfIntArrays) expected="mIntArrayArrayOverloaded([[1, 2, 3], [], [4]])" />
+<@assertEquals actual=obj.mArrayOfListsOverloaded(obj.javaListOfIntArrays) expected="mArrayOfListsOverloaded([[1, 2, 3], [], [4]])" />
+<@assertEquals actual=obj.mIntArrayArrayNonOverloaded(obj.javaListOfIntArrays) expected="mIntArrayArrayNonOverloaded([[1, 2, 3], [], [4]])" />
+<@assertEquals actual=obj.mArrayOfListsNonOverloaded(obj.javaListOfIntArrays) expected="mArrayOfListsNonOverloaded([[1, 2, 3], [], [4]])" />
+
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(['a', 'b']) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringList) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringArray) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(['a']) expected="mStringArrayVarargsOverloaded2(String[] [a])" />
+
+<#-- Situations that lead to array-to-List conversion: -->
+<@assertEquals actual=obj.mListOrString(obj.javaStringArray) expected="mListOrString(List [a, b])" />
+<@assertEquals actual=obj.mListOrString(obj.javaEmptyStringArray) expected="mListOrString(List [])" />
+<@assertEquals actual=obj.mListOrString(obj.javaIntArray) expected="mListOrString(List [11, 22])" />
+<@assertEquals actual=obj.mListListOrString(obj.javaStringArrayArray) expected="mListListOrString(List [[a, b], [], [c]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
+<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
+
+<@assertEquals actual=obj.mMapOrBoolean(obj.hashAndScalarModel) expected="mMapOrBoolean(Map {})" />
+<@assertEquals actual=obj.mMapOrBoolean(obj.booleanAndScalarModel) expected="mMapOrBoolean(boolean true)" />
+<@assertEquals actual=obj.mMapOrBoolean(obj.allModels) expected="mMapOrBoolean(boolean true)" />
+
+<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.hashAndScalarModel) expected="mMapOrBooleanVarargs(Map... [{}])" />
+<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanVarargs(Map... [{}, {}])" />
+<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.allModels) expected="mMapOrBooleanVarargs(boolean... [true])" />
+<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.allModels, obj.allModels) expected="mMapOrBooleanVarargs(boolean... [true, true])" />
+
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map {})" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map... [{}, {}])" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map... [{}, {}, {}])" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean true)" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean... [true, true])" />
+<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels, obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean... [true, true, true])" />
+
+<@assertEquals actual=obj.mNumberOrArray(obj.allModels) expected="mNumberOrArray(Number 1)" />
+<@assertEquals actual=obj.mNumberOrArray([obj.allModels]) expected="mNumberOrArray(Object[] [1])" />
+<@assertEquals actual=obj.mIntOrArray(obj.allModels) expected="mIntOrArray(int 1)" />
+<@assertEquals actual=obj.mDateOrArray(obj.allModels) expected="mDateOrArray(Date 0)" />
+<@assertEquals actual=obj.mStringOrArray(obj.allModels) expected="mStringOrArray(String s)" />
+<@assertEquals actual=obj.mBooleanOrArray(obj.allModels) expected="mBooleanOrArray(boolean true)" />
+<@assertEquals actual=obj.mMapOrArray(obj.allModels) expected="mMapOrArray(Map {})" />
+<@assertEquals actual=obj.mListOrArray(obj.allModels) expected="mListOrArray(List [])" />
+<@assertEquals actual=obj.mSetOrArray(obj.allModels) expected="mSetOrArray(Set [])" />
+
+<@assertEquals actual=obj.mCharOrCharacterOverloaded('c') expected="mCharOrCharacterOverloaded(char c)" />
+<@assertEquals actual=obj.mCharOrCharacterOverloaded(obj.javaString) expected="mCharOrCharacterOverloaded(char s)" />
+<@assertEquals actual=obj.mCharOrCharacterOverloaded(null) expected="mCharOrCharacterOverloaded(Character null)" />
+
+<@assertEquals actual=obj.mCharOrBooleanOverloaded('c') expected="mCharOrBooleanOverloaded(char c)" />
+<@assertEquals actual=obj.mCharOrBooleanOverloaded(true) expected="mCharOrBooleanOverloaded(boolean true)" />
+
+<@assertEquals actual=obj.mCharOrStringOverloaded('c', true) expected="mCharOrStringOverloaded(char c, boolean true)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded('c', true) expected="mCharacterOrStringOverloaded(Character c, boolean true)" />
+
+<@assertEquals actual=obj.mCharOrStringOverloaded2('c') expected="mCharOrStringOverloaded2(char c)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded2('c') expected="mCharacterOrStringOverloaded2(Character c)" />
+<@assertEquals actual=obj.mCharOrStringOverloaded2('ss') expected="mCharOrStringOverloaded2(String ss)" />
+<@assertEquals actual=obj.mCharacterOrStringOverloaded2('ss') expected="mCharacterOrStringOverloaded2(String ss)" />
+
+<#-- The exmple given in bug report 363 -->
+<#assign theMap = {'name':'Billy', 'lastName', 'Pilgrim'} />
+<@assertEquals actual=obj.bugReport363(theMap, []) expected="Executed: testMethod(Map fields, List listField) on input: fields={name=Billy, lastName=Pilgrim} and listField=[]" />
+<@assertEquals actual=obj.bugReport363(theMap, null) expected="Executed: testMethod(Map fields, List listField) on input: fields={name=Billy, lastName=Pilgrim} and listField=null" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-ici-2.3.20.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-ici-2.3.20.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-ici-2.3.20.ftl
deleted file mode 100644
index 1dbd5b7..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-ici-2.3.20.ftl
+++ /dev/null
@@ -1,37 +0,0 @@
-<#--
-  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.
--->
-<#include 'range-common.ftl'>
-
-<#-- Legacy quirk: right-unbounded ranges are apparently empty: -->
-<@assertEquals actual=(4..)?size expected=0 />
-<@assertEquals actual=join(1.., ' ') expected="" />
-
-<#list 4.. as i>
-  <#stop "Shouldn't be reached">
-</#list>
-
-<@assertFails message="missing">
-	<@assertEquals actual=(4..)[0] expected=4 />
-</@>
-<@assertFails message="missing">
-	<@assertEquals actual=(4..)[1] expected=5 />
-</@>
-<@assertFails message="out of bounds">
-	<@assertEquals actual=(4..)[-1] expected=5 />
-</@>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-ici-2.3.21.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-ici-2.3.21.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-ici-2.3.21.ftl
deleted file mode 100644
index 33f7c7f..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range-ici-2.3.21.ftl
+++ /dev/null
@@ -1,50 +0,0 @@
-<#--
-  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.
--->
-<#include 'range-common.ftl'>
-
-<@assertEquals actual=(4..)?size expected=2147483647 />
-<@assertEquals actual=limitedJoin(4.., 3) expected="4, 5, 6, ..." />
-
-<@assertEquals actual=(4..)[0] expected=4 />
-<@assertEquals actual=(4..)[1] expected=5 />
-<@assertEquals actual=(4..)[1000000] expected=1000004 />
-<@assertFails message="out of bounds">
-	<@assertEquals actual=(4..)[-1] expected=5 />
-</@>
-
-<#assign r = 2147483646..>
-<@assertEquals actual=r?size expected=2147483647 />
-<@assertEquals actual=limitedJoin(r, 3) expected="2147483646, 2147483647, 2147483648, ..." />
-<@assertEquals actual=r[100] expected=2147483746 />
-
-<#assign r = -2..>
-<@assertEquals actual=limitedJoin(r, 5) expected="-2, -1, 0, 1, 2, ..." />
-<@assertEquals actual=r[0] expected=-2 />
-<@assertEquals actual=r[1] expected=-1 />
-
-<#function limitedJoin range limit>
-	<#assign joined="">
-	<#list range as i>
-		<#assign joined = joined + i?c>
-		<#if i_has_next><#assign joined = joined + ', '></#if>
-		<#local limit = limit - 1>
-		<#if limit == 0><#assign joined = joined + "..."><#break></#if>
-	</#list>
-	<#return joined>
-</#function>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range.ftl
new file mode 100644
index 0000000..33f7c7f
--- /dev/null
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/range.ftl
@@ -0,0 +1,50 @@
+<#--
+  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.
+-->
+<#include 'range-common.ftl'>
+
+<@assertEquals actual=(4..)?size expected=2147483647 />
+<@assertEquals actual=limitedJoin(4.., 3) expected="4, 5, 6, ..." />
+
+<@assertEquals actual=(4..)[0] expected=4 />
+<@assertEquals actual=(4..)[1] expected=5 />
+<@assertEquals actual=(4..)[1000000] expected=1000004 />
+<@assertFails message="out of bounds">
+	<@assertEquals actual=(4..)[-1] expected=5 />
+</@>
+
+<#assign r = 2147483646..>
+<@assertEquals actual=r?size expected=2147483647 />
+<@assertEquals actual=limitedJoin(r, 3) expected="2147483646, 2147483647, 2147483648, ..." />
+<@assertEquals actual=r[100] expected=2147483746 />
+
+<#assign r = -2..>
+<@assertEquals actual=limitedJoin(r, 5) expected="-2, -1, 0, 1, 2, ..." />
+<@assertEquals actual=r[0] expected=-2 />
+<@assertEquals actual=r[1] expected=-1 />
+
+<#function limitedJoin range limit>
+	<#assign joined="">
+	<#list range as i>
+		<#assign joined = joined + i?c>
+		<#if i_has_next><#assign joined = joined + ', '></#if>
+		<#local limit = limit - 1>
+		<#if limit == 0><#assign joined = joined + "..."><#break></#if>
+	</#list>
+	<#return joined>
+</#function>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-ici-2.3.19.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-ici-2.3.19.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-ici-2.3.19.ftl
deleted file mode 100644
index 033920d..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-ici-2.3.19.ftl
+++ /dev/null
@@ -1,22 +0,0 @@
-<#--
-  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.
--->
-<#-- Same as before... just checking against one-off bugs for 2.3.20 -->
-<@assertEquals actual="'"?html expected="'" />
-<@assertEquals actual="'"?xhtml expected="&#39;" />
-<@assertEquals actual="'"?xml expected="&apos;" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-ici-2.3.20.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-ici-2.3.20.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-ici-2.3.20.ftl
deleted file mode 100644
index 62cbb68..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins-ici-2.3.20.ftl
+++ /dev/null
@@ -1,21 +0,0 @@
-<#--
-  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.
--->
-<@assertEquals actual="'"?html expected="&#39;" />
-<@assertEquals actual="'"?xhtml expected="&#39;" />
-<@assertEquals actual="'"?xml expected="&apos;" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins1.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins1.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins1.ftl
index 93dc88d..40c00bb 100644
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins1.ftl
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/string-builtins1.ftl
@@ -35,7 +35,7 @@ trim4:      ${"foo bar "?trim}
 upper_case: ${x?upper_case}
 xml:        ${x?xml}
 xhtml:      ${"\"Blah's is > 1 & < 2\""?xhtml}
-<@assertEquals actual="'"?html expected=(iciIntValue gte 2003020)?string("&#39;", "'") />
+<@assertEquals actual="'"?html expected="&#39;" />
 <@assertEquals actual="'"?xhtml expected="&#39;" />
 <@assertEquals actual="'"?xml expected="&apos;" />
 <#-- ?substring: -->

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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 288adae..afd7a84 100644
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/testcases.xml
@@ -47,19 +47,23 @@
             api_builtin_enabled CDATA #IMPLIED
       >
 ]>
+<!--
+Note that for the incompatible_improvements setting you can specify a list of versions, for example:
+<setting incompatible_improvements="min, 3.0.5, max" /> 
+-->
 
 <testCases>
    <setting input_encoding="UTF-8" output_encoding="UTF-8" />
    
    <testCase name="api-builtins" noOutput="true">
       <setting
-            object_wrapper="DefaultObjectWrapper(2.3.22, forceLegacyNonListCollections=false)"
+            object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)"
             api_builtin_enabled="true"
       />
    </testCase>
    <testCase name="api-builtins[#endTN]-bw" noOutput="true">
       <setting
-            object_wrapper="BeansWrapper(2.3.0)"
+            object_wrapper="BeansWrapper(3.0.0)"
             api_builtin_enabled="true"
       />
    </testCase>
@@ -67,7 +71,7 @@
    <testCase name="assignments" noOutput="true" />
    <testCase name="bean-maps"/>
    <testCase name="beans">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapper"/>
+      <setting object_wrapper="beans"/>
    </testCase>
    <testCase name="boolean" />
    <testCase name="charset-in-header">
@@ -79,27 +83,15 @@
    <testCase name="then-builtin" noOutput="true" />
    <testCase name="dateformat-java" />
    <testCase name="dateformat-iso-like" noOutput="true" />
-   <testCase name="dateformat-iso-bi" noOutput="true">
-      <setting incompatible_improvements="min, 2.3.20" /> 
-   </testCase>
-   <testCase name="dateformat-iso-bi-ici-2.3.21" noOutput="true">
-      <setting incompatible_improvements="2.3.21, max" /> 
-   </testCase>   
+   <testCase name="dateformat-iso-bi" noOutput="true" />
    <testCase name="dateparsing" noOutput="true" />
    <testCase name="default"/>
    <testCase name="default-xmlns">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapper"/>
-   </testCase>
-   <testCase name="encoding-builtins">
-      <setting incompatible_improvements="min, 2.3.19" /> 
-   </testCase>
-   <testCase name="encoding-builtins[#endTN]-ici-2.3.20">
-      <setting incompatible_improvements="2.3.20, max" /> 
+      <setting object_wrapper="beans"/>
    </testCase>
+   <testCase name="encoding-builtins" />
    <testCase name="escapes" />
-   <testCase name="hashliteral">
-      <setting incompatible_improvements="min, 2.3.20, 2.3.21, max" /> 
-   </testCase>
+   <testCase name="hashliteral" />
    <testCase name="identifier-non-ascii" />
    <testCase name="identifier-escaping" />
    <testCase name="import">
@@ -112,29 +104,30 @@
    <testCase name="interpret"/>
    <testCase name="iterators"/>
    <testCase name="lastcharacter"/>
-   <testCase name="list" />
+   <testCase name="list[#endTN]-simpleTemplateModels" expected="list.txt">
+      <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(2.3.22, forceLegacyNonListCollections=false)" />
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)" />
+   </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" />
    <testCase name="list2[#endTN]-collectionAdapter" expected="list2.txt">
-      <setting object_wrapper="DefaultObjectWrapper(2.3.22, forceLegacyNonListCollections=false)" />
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)" />
+   </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" />
    <testCase name="list3[#endTN]-collectionAdapter" expected="list3.txt">
-      <setting object_wrapper="DefaultObjectWrapper(2.3.22, forceLegacyNonListCollections=false)" />
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)" />
    </testCase>
    <testCase name="list-bis" />
    <testCase name="list-bis[#endTN]-collectionAdapter" expected="list-bis.txt">
-      <setting object_wrapper="DefaultObjectWrapper(2.3.22, forceLegacyNonListCollections=false)" />
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)" />
    </testCase>
    <testCase name="listhash" />
-   <testCase name="listhashliteral[#endTN]-ici-2.3.20">
-      <setting incompatible_improvements="min, 2.3.20" /> 
-   </testCase>
-   <testCase name="listhashliteral[#endTN]-ici-2.3.21">
-      <setting incompatible_improvements="2.3.21, max" /> 
-   </testCase>
+   <testCase name="listhashliteral" />
    <testCase name="listliteral" />
    <testCase name="localization" >
       <setting locale="en_AU"/>
@@ -148,9 +141,7 @@
    <testCase name="newlines1" />
    <testCase name="newlines2" />
    <testCase name="noparse" />
-   <testCase name="number-format">
-      <setting incompatible_improvements="min, 2.3.21, max" /> 
-   </testCase>
+   <testCase name="number-format" />
    <testCase name="number-literal" >
       <setting locale="fr_FR"/>
    </testCase>
@@ -163,32 +154,25 @@
        <setting output_encoding="ISO-8859-1" url_escaping_charset="UTF-16" />
    </testCase>
    <testCase name="precedence"/>
-   <testCase name="range-ici-2.3.20" noOutput="true">
-   	  <setting incompatible_improvements="min, 2.3.20"/>
-   </testCase>
-   <testCase name="range-ici-2.3.21" noOutput="true">
-      <setting incompatible_improvements="2.3.21, max"/>
-   </testCase>
+   <testCase name="range" noOutput="true" />
    <testCase name="recover" />
    <testCase name="root" />
    <testCase name="setting" noOutput="true" />
    <testCase name="sequence-builtins[#endTN]-with-BeansWrapper" expected="sequence-builtins.txt">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapper"/> 
+      <setting object_wrapper="beans"/> 
+   </testCase>
+   <testCase name="sequence-builtins[#endTN]-with-SimpleTemplateModel" expected="sequence-builtins.txt">
+      <setting object_wrapper="org.apache.freemarker.test.util.SimpleMapAndCollectionObjectWrapper(3.0.0)" />
    </testCase>
    <testCase name="sequence-builtins[#endTN]-with-DefaultObjectWrapper" expected="sequence-builtins.txt">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.DefaultObjectWrapper"/> 
+      <setting object_wrapper="default"/> 
    </testCase>
    <testCase name="sequence-builtins[#endTN]-with-DefaultObjectWrapper-collAdapters" expected="sequence-builtins.txt">
-      <setting object_wrapper="DefaultObjectWrapper(2.3.22, forceLegacyNonListCollections=false)"/> 
-   </testCase>
-   <testCase name="sequence-builtins[#endTN]-with-SimpleObjectWrapper" expected="sequence-builtins.txt">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.SimpleObjectWrapper(2.3.25)"/> 
+      <setting object_wrapper="DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)"/> 
    </testCase>
    <testCase name="simplehash-char-key" noOutput="true" />
    <testCase name="existence-operators" noOutput="true" />
-   <testCase name="string-builtins1">
-      <setting incompatible_improvements="min, 2.3.20, max"/>
-   </testCase>
+   <testCase name="string-builtins1" />
    <testCase name="string-builtins2" />
    <testCase name="string-builtins3" noOutput="true" />
    <testCase name="string-builtins-regexps" />
@@ -199,15 +183,7 @@
    <testCase name="switch" />
    <testCase name="switch-builtin" noOutput="true" />
    <testCase name="transforms"/>
-   <testCase name="type-builtins">
-      <setting incompatible_improvements="min, 2.3.20"/>
-   </testCase>
-   <testCase name="type-builtins[#endTN]-ici-2.3.21">
-   	  <setting incompatible_improvements="2.3.21, 2.3.23"/>
-   </testCase>
-   <testCase name="type-builtins[#endTN]-ici-2.3.24">
-      <setting incompatible_improvements="2.3.24, max"/>
-   </testCase>
+   <testCase name="type-builtins" />
    <testCase name="date-type-builtins" noOutput="true" />
    <testCase name="url" noOutput="true" />
    <testCase name="var-layers"/>
@@ -215,20 +191,20 @@
    <testCase name="whitespace-trim"/>
    <testCase name="wstrip-in-header"/>
    <testCase name="xml-fragment">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapper"/> 
+      <setting object_wrapper="beans"/> 
    </testCase>
    <testCase name="xmlns1">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapper"/>
+      <setting object_wrapper="beans"/>
    </testCase>
    <testCase name="xmlns2" template="xmlns1.ftl"  expected="xmlns1.txt" />
    <testCase name="xmlns3">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapper"/>
+      <setting object_wrapper="beans"/>
    </testCase>   
    <testCase name="xmlns4">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapper"/>
+      <setting object_wrapper="beans"/>
    </testCase>   
    <testCase name="xmlns5">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapper"/>
+      <setting object_wrapper="beans"/>
    </testCase>   
    <testCase name="xml-ns_prefix-scope" template="xml-ns_prefix-scope-main.ftl" />
    <testCase name="hashconcat"/>
@@ -253,44 +229,17 @@
    <testCase name="boolean-formatting"  />
    <testCase name="number-math-builtins" noOutput="true" />
    <testCase name="string-builtin-coercion" noOutput="true" />
-   <testCase name="string-builtins-ici-2.3.20" noOutput="true">
-      <setting incompatible_improvements="2.3.20"/>
-   </testCase>
-   <testCase name="string-builtins-ici-2.3.19" noOutput="true">
-      <setting incompatible_improvements="2.3.19"/>
-   </testCase>
    
-   <testCase name="overloaded-methods-23bc" noOutput="true">
-      <setting incompatible_improvements="2.3.0, 2.3.19"/>
-   </testCase>
-   <testCase name="overloaded-methods-2-inc-bwici-2.3.20" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapperInc2003020"/>
-   </testCase>
-   <testCase name="overloaded-methods-2-desc-bwici-2.3.20" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapperDesc2003020"/>
-   </testCase>
-   <testCase name="overloaded-methods-2-bwici-2.3.21[#endTN]-inc" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapperInc2003021"/>
-   </testCase>
-   <testCase name="overloaded-methods-2-bwici-2.3.21[#endTN]-desc" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapperDesc2003021"/>
-   </testCase>
-   <testCase name="overloaded-methods-2-inc-bwici-2.3.20[#endTN]-dow" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.DefaultObjectWrapperInc2003020"/>
-   </testCase>
-   <testCase name="overloaded-methods-2-desc-bwici-2.3.20[#endTN]-dow" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.DefaultObjectWrapperDesc2003020"/>
-   </testCase>
-   <testCase name="overloaded-methods-2-bwici-2.3.21[#endTN]-inc-dow" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.DefaultObjectWrapperInc2003021"/>
+   <testCase name="overloaded-methods[#endTN]-inc-bw" noOutput="true">
+      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapperInc"/>
    </testCase>
-   <testCase name="overloaded-methods-2-bwici-2.3.21[#endTN]-desc-dow" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.DefaultObjectWrapperDesc2003021"/>
+   <testCase name="overloaded-methods[#endTN]-desc-bw" noOutput="true">
+      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.BeansWrapperDesc"/>
    </testCase>
-   <testCase name="overloaded-methods-2-bwici-2.3.21[#endTN]-inc-dow-2.3.22" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.DefaultObjectWrapperInc2003022"/>
+   <testCase name="overloaded-methods[#endTN]-inc-dow" noOutput="true">
+      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.DefaultObjectWrapperInc"/>
    </testCase>
-   <testCase name="overloaded-methods-2-bwici-2.3.21[#endTN]-desc-dow-2.3.22" noOutput="true">
-      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.DefaultObjectWrapperDesc2003022"/>
+   <testCase name="overloaded-methods[#endTN]-desc-dow" noOutput="true">
+      <setting object_wrapper="org.apache.freemarker.core.model.impl.beans.DefaultObjectWrapperDesc"/>
    </testCase>
 </testCases>


[5/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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 4906d50..c1fd449 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
@@ -76,21 +76,7 @@ import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.WrapperTemplateModel;
 import org.apache.freemarker.core.model.WrappingTemplateModel;
-import org.apache.freemarker.core.model.impl.DefaultArrayAdapter;
-import org.apache.freemarker.core.model.impl.DefaultIterableAdapter;
-import org.apache.freemarker.core.model.impl.DefaultIteratorAdapter;
-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.DefaultObjectWrapper;
-import org.apache.freemarker.core.model.impl.DefaultObjectWrapperBuilder;
-import org.apache.freemarker.core.model.impl.SimpleDate;
-import org.apache.freemarker.core.model.impl.SimpleHash;
-import org.apache.freemarker.core.model.impl.SimpleNumber;
-import org.apache.freemarker.core.model.impl.SimpleScalar;
-import org.apache.freemarker.core.model.impl.SimpleSequence;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.HashAdapter;
 import org.junit.Test;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
@@ -101,45 +87,31 @@ import com.google.common.collect.ImmutableMap;
 
 public class DefaultObjectWrapperTest {
 
-    private final static DefaultObjectWrapper OW0 = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_0)
+    private final static DefaultObjectWrapper OW300 = new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0)
             .build();
 
-    private final static DefaultObjectWrapper OW22 = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_22)
-            .build();
-
-    private final static DefaultObjectWrapper OW22NM = new DefaultObjectWrapper(Configuration.VERSION_2_3_22);
+    private final static DefaultObjectWrapper OW300NM = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
     static {
-        OW22NM.setNullModel(NullModel.INSTANCE);
+        OW300NM.setNullModel(NullModel.INSTANCE);
     }
 
-    private final static DefaultObjectWrapper OW22CA = new DefaultObjectWrapper(Configuration.VERSION_2_3_22);
+    private final static DefaultObjectWrapper OW300CA = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
     static {
-        OW22CA.setForceLegacyNonListCollections(false);
+        OW300CA.setForceLegacyNonListCollections(false);
     }
 
-    private final static DefaultObjectWrapper OW22IS = new DefaultObjectWrapper(Configuration.VERSION_2_3_22);
+    private final static DefaultObjectWrapper OW300IS = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
     static {
-        OW22IS.setIterableSupport(true);
+        OW300IS.setIterableSupport(true);
     }
 
-    private final static Version LAST_2_3_VERSION = Configuration.VERSION_2_3_26;
-    
     @Test
     public void testIncompatibleImprovementsVersionBreakPoints() throws Exception {
         List<Version> expected = new ArrayList<>();
-        for (int u = 0; u < 21; u++) {
-            expected.add(Configuration.VERSION_2_3_0);
-        }
-        expected.add(Configuration.VERSION_2_3_21);
-        expected.add(Configuration.VERSION_2_3_22);
-        expected.add(Configuration.VERSION_2_3_22); // no non-BC change in 2.3.23
-        expected.add(Configuration.VERSION_2_3_24);
-        expected.add(Configuration.VERSION_2_3_24); // no non-BC change in 2.3.25
-        expected.add(Configuration.VERSION_2_3_24); // no non-BC change in 2.3.26
         expected.add(Configuration.VERSION_3_0_0);
 
         List<Version> actual = new ArrayList<>();
-        int i = _TemplateAPI.VERSION_INT_2_3_0;
+        int i = _TemplateAPI.VERSION_INT_3_0_0;
         while (i <= Configuration.getVersion().intValue()) {
             int major = i / 1000000;
             int minor = i % 1000000 / 1000;
@@ -153,11 +125,7 @@ public class DefaultObjectWrapperTest {
             assertEquals(normalizedVersion, builder.getIncompatibleImprovements());
             assertEquals(normalizedVersion, builder.build().getIncompatibleImprovements());
             
-            if (LAST_2_3_VERSION.equals(version)) {
-                i = Configuration.VERSION_3_0_0.intValue();
-            } else {
-                i++;
-            }
+            i++;
         }
 
         assertEquals(expected, actual);
@@ -192,59 +160,21 @@ public class DefaultObjectWrapperTest {
     @SuppressWarnings("boxing")
     @Test
     public void testBuilder() throws Exception {
-        {
-            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_19);
+        for (boolean simpleMapWrapper : new boolean[] { true, false }) {
+            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0);
+            builder.setSimpleMapWrapper(simpleMapWrapper); // Shouldn't mater
             DefaultObjectWrapper bw = builder.build();
             assertSame(bw, builder.build());
             assertSame(bw.getClass(), DefaultObjectWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, bw.getIncompatibleImprovements());
             assertTrue(bw.isWriteProtected());
-            assertTrue(bw.isClassIntrospectionCacheRestricted());
-
-            assertFalse(bw.getUseAdaptersForContainers());
+            assertEquals(simpleMapWrapper, bw.isSimpleMapWrapper());
+            assertTrue(bw.getUseAdaptersForContainers());
             assertTrue(bw.getForceLegacyNonListCollections());
-            assertTrue(bw.wrap(new HashMap()) instanceof SimpleHash);
-            assertTrue(bw.wrap(new ArrayList()) instanceof SimpleSequence);
-            assertTrue(bw.wrap(new String[] {}) instanceof SimpleSequence);
+            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);
-
-        }
-
-        for (boolean simpleMapWrapper : new boolean[] { true, false }) {
-            {
-                DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_21);
-                builder.setSimpleMapWrapper(simpleMapWrapper); // Shouldn't mater
-                DefaultObjectWrapper bw = builder.build();
-                assertSame(bw, builder.build());
-                assertSame(bw.getClass(), DefaultObjectWrapper.class);
-                assertEquals(Configuration.VERSION_2_3_21, bw.getIncompatibleImprovements());
-                assertTrue(bw.isWriteProtected());
-                assertEquals(simpleMapWrapper, bw.isSimpleMapWrapper());
-                assertFalse(bw.getUseAdaptersForContainers());
-                assertTrue(bw.getForceLegacyNonListCollections());
-                assertTrue(bw.wrap(new HashMap()) instanceof SimpleHash);
-                assertTrue(bw.wrap(new ArrayList()) instanceof SimpleSequence);
-                assertTrue(bw.wrap(new String[] {}) instanceof SimpleSequence);
-                assertTrue(bw.wrap(new HashSet()) instanceof SimpleSequence);
-                assertTrue(bw.wrap('c') instanceof TemplateScalarModel); // StringModel now, but should change later
-            }
-
-            {
-                DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_22);
-                builder.setSimpleMapWrapper(simpleMapWrapper); // Shouldn't mater
-                DefaultObjectWrapper bw = builder.build();
-                assertSame(bw, builder.build());
-                assertSame(bw.getClass(), DefaultObjectWrapper.class);
-                assertEquals(Configuration.VERSION_2_3_22, 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);
-            }
         }
 
         {
@@ -262,80 +192,7 @@ public class DefaultObjectWrapperTest {
         }
 
         {
-            DefaultObjectWrapper bw = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_19).build();
-            assertSame(bw.getClass(), DefaultObjectWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
-            assertTrue(bw.isWriteProtected());
-            assertFalse(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof SimpleHash);
-
-            assertSame(bw, new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_20).build());
-            assertSame(bw, new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_0).build());
-            assertSame(bw, new DefaultObjectWrapperBuilder(new Version(2, 3, 5)).build());
-        }
-
-        {
-            DefaultObjectWrapper bw = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_21).build();
-            assertSame(bw.getClass(), DefaultObjectWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_21, bw.getIncompatibleImprovements());
-            assertTrue(bw.isWriteProtected());
-            assertFalse(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof SimpleHash);
-            assertTrue(bw.isClassIntrospectionCacheRestricted());
-
-            assertSame(bw, new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_21).build());
-        }
-
-        {
-            DefaultObjectWrapper bw = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_19).build();
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
-        }
-
-        {
-            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_19);
-            builder.setExposureLevel(BeansWrapper.EXPOSE_PROPERTIES_ONLY);
-            DefaultObjectWrapper bw = builder.build();
-            DefaultObjectWrapper bw2 = builder.build();
-            assertSame(bw, bw2); // not cached
-
-            assertSame(bw.getClass(), DefaultObjectWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
-            assertTrue(bw.isWriteProtected());
-            assertFalse(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof SimpleHash);
-            assertEquals(BeansWrapper.EXPOSE_PROPERTIES_ONLY, bw.getExposureLevel());
-        }
-
-        {
-            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_19);
-            builder.setExposeFields(true);
-            BeansWrapper bw = builder.build();
-            BeansWrapper bw2 = builder.build();
-            assertSame(bw, bw2); // not cached
-
-            assertSame(bw.getClass(), DefaultObjectWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
-            assertTrue(bw.isWriteProtected());
-            assertFalse(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof SimpleHash);
-            assertEquals(true, bw.isExposeFields());
-        }
-
-        {
-            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_21);
-            builder.setForceLegacyNonListCollections(false);
-            DefaultObjectWrapper bw = builder.build();
-            assertSame(bw, builder.build());
-            assertFalse(bw.getForceLegacyNonListCollections());
-
-            assertTrue(bw.wrap(new HashMap()) instanceof SimpleHash);
-            assertTrue(bw.wrap(new ArrayList()) instanceof SimpleSequence);
-            assertTrue(bw.wrap(new String[] {}) instanceof SimpleSequence);
-            assertTrue(bw.wrap(new HashSet()) instanceof SimpleSequence);
-        }
-
-        {
-            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_22);
+            DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0);
             builder.setForceLegacyNonListCollections(false);
             DefaultObjectWrapper bw = builder.build();
             assertSame(bw, builder.build());
@@ -371,30 +228,11 @@ public class DefaultObjectWrapperTest {
         {
             DefaultObjectWrapper ow = new DefaultObjectWrapper();
             assertEquals(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS, ow.getIncompatibleImprovements());
-            assertFalse(ow.isWriteProtected());
-            assertFalse(ow.getUseAdaptersForContainers());
-            assertTrue(ow.getForceLegacyNonListCollections());
-        }
-
-        {
-            DefaultObjectWrapper ow = new DefaultObjectWrapper(Configuration.VERSION_2_3_20);
-            assertEquals(Configuration.VERSION_2_3_0, ow.getIncompatibleImprovements());
-            assertFalse(ow.isWriteProtected());
-            assertFalse(ow.getUseAdaptersForContainers());
-            assertTrue(ow.getForceLegacyNonListCollections());
-        }
-
-        {
-            DefaultObjectWrapper ow = new DefaultObjectWrapper(Configuration.VERSION_2_3_21);
-            assertEquals(Configuration.VERSION_2_3_21, ow.getIncompatibleImprovements());
-            assertFalse(ow.isWriteProtected());
-            assertFalse(ow.getUseAdaptersForContainers());
-            assertTrue(ow.getForceLegacyNonListCollections());
         }
         
         {
-            DefaultObjectWrapper ow = new DefaultObjectWrapper(Configuration.VERSION_2_3_22);
-            assertEquals(Configuration.VERSION_2_3_22, ow.getIncompatibleImprovements());
+            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());
@@ -411,37 +249,9 @@ public class DefaultObjectWrapperTest {
     
     @Test
     public void testCustomization() throws TemplateModelException {
-        {
-            CustomizedDefaultObjectWrapper ow = new CustomizedDefaultObjectWrapper(Configuration.VERSION_2_3_22);
-            assertEquals(Configuration.VERSION_2_3_22, ow.getIncompatibleImprovements());
-            assertTrue(ow.getUseAdaptersForContainers());
-            testCustomizationCommonPart(ow,
-                    DefaultMapAdapter.class, DefaultListAdapter.class, DefaultArrayAdapter.class);
-        }
-        
-        {
-            CustomizedDefaultObjectWrapper ow = new CustomizedDefaultObjectWrapper(Configuration.VERSION_2_3_21);
-            assertFalse(ow.getUseAdaptersForContainers());
-            assertEquals(Configuration.VERSION_2_3_21, ow.getIncompatibleImprovements());
-            testCustomizationCommonPart(ow,
-                    SimpleHash.class, SimpleSequence.class, SimpleSequence.class);
-        }
-        
-        {
-            CustomizedDefaultObjectWrapper ow = new CustomizedDefaultObjectWrapper(Configuration.VERSION_2_3_20);
-            assertFalse(ow.getUseAdaptersForContainers());
-            assertEquals(Configuration.VERSION_2_3_0, ow.getIncompatibleImprovements());
-            testCustomizationCommonPart(ow,
-                    SimpleHash.class, SimpleSequence.class, SimpleSequence.class);
-        }
-    }
-
-    @SuppressWarnings("boxing")
-    private void testCustomizationCommonPart(CustomizedDefaultObjectWrapper ow,
-            Class<? extends TemplateHashModel> mapTMClass,
-            Class<? extends TemplateSequenceModel> listTMClass,
-            Class<? extends TemplateSequenceModel> arrayTMClass)
-            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));
@@ -454,9 +264,9 @@ public class DefaultObjectWrapperTest {
         assertTrue(ow.wrap(new Date()) instanceof SimpleDate);
         assertEquals(TemplateBooleanModel.TRUE, ow.wrap(true));
         
-        assertTrue(mapTMClass.isInstance(ow.wrap(Collections.emptyMap())));
-        assertTrue(listTMClass.isInstance(ow.wrap(Collections.emptyList())));
-        assertTrue(arrayTMClass.isInstance(ow.wrap(new boolean[] { })));
+        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('c') instanceof TemplateScalarModel); // StringModel right now, but should change later
         
@@ -468,7 +278,7 @@ public class DefaultObjectWrapperTest {
             assertEquals(
                     Collections.singletonList(1),
                     ow.unwrap(mr));
-            assertTrue(listTMClass.isInstance(mr));
+            assertTrue(DefaultListAdapter.class.isInstance(mr));
         }
         {
             // Check custom TM usage and round trip:
@@ -482,8 +292,7 @@ public class DefaultObjectWrapperTest {
     @SuppressWarnings("boxing")
     @Test
     public void testRoundtripping() throws TemplateModelException, ClassNotFoundException {
-        DefaultObjectWrapper dow21 = new DefaultObjectWrapper(Configuration.VERSION_2_3_21);
-        DefaultObjectWrapper dow22 = new DefaultObjectWrapper(Configuration.VERSION_2_3_22);
+        DefaultObjectWrapper dow22 = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
 
         final Map hashMap = new HashMap();
         inintTestMap(hashMap);
@@ -499,17 +308,6 @@ public class DefaultObjectWrapperTest {
         final int[] intArray = new int[] { 1, 2, 3 };
         final String[] stringArray = new String[] { "a", "b", "c" };
 
-        assertRoundtrip(dow21, linkedHashMap, SimpleHash.class, HashAdapter.class, linkedHashMap.toString());
-        assertRoundtrip(dow21, treeMap, SimpleHash.class, HashAdapter.class, treeMap.toString());
-        assertRoundtrip(dow21, gMap, SimpleHash.class, HashAdapter.class, hashMap.toString());
-        assertRoundtrip(dow21, linkedList, SimpleSequence.class, Class.forName("org.apache.freemarker.core.model.impl.beans.SequenceAdapter"),
-                linkedList.toString());
-        assertRoundtrip(dow21, intArray, SimpleSequence.class, Class.forName("org.apache.freemarker.core.model.impl.beans.SequenceAdapter"),
-                "[1, 2, 3]");
-        assertRoundtrip(dow21, stringArray, SimpleSequence.class,
-                Class.forName("org.apache.freemarker.core.model.impl.beans.SequenceAdapter"),
-                "[a, b, c]");
-
         assertRoundtrip(dow22, linkedHashMap, DefaultMapAdapter.class, LinkedHashMap.class, linkedHashMap.toString());
         assertRoundtrip(dow22, treeMap, DefaultMapAdapter.class, TreeMap.class, treeMap.toString());
         assertRoundtrip(dow22, gMap, DefaultMapAdapter.class, ImmutableMap.class, gMap.toString());
@@ -535,7 +333,7 @@ public class DefaultObjectWrapperTest {
         testMap.put("d", Collections.singletonList("x"));
 
         {
-            TemplateHashModelEx hash = (TemplateHashModelEx) OW22.wrap(testMap);
+            TemplateHashModelEx hash = (TemplateHashModelEx) OW300.wrap(testMap);
             assertEquals(4, hash.size());
             assertFalse(hash.isEmpty());
             assertNull(hash.get("e"));
@@ -551,11 +349,11 @@ public class DefaultObjectWrapperTest {
         }
 
         {
-            assertTrue(((TemplateHashModel) OW22.wrap(Collections.emptyMap())).isEmpty());
+            assertTrue(((TemplateHashModel) OW300.wrap(Collections.emptyMap())).isEmpty());
         }
 
         {
-            final TemplateHashModelEx hash = (TemplateHashModelEx) OW22NM.wrap(testMap);
+            final TemplateHashModelEx hash = (TemplateHashModelEx) OW300NM.wrap(testMap);
             assertSame(NullModel.INSTANCE, hash.get("b"));
             assertNull(hash.get("e"));
 
@@ -574,14 +372,14 @@ public class DefaultObjectWrapperTest {
                 if (idx >= expectedItems.length) {
                     fail("Number of items is more than the expected " + expectedItems.length);
                 }
-                assertEquals(expectedItems[idx], OW22.unwrap(actualItem));
+                assertEquals(expectedItems[idx], OW300.unwrap(actualItem));
                 if (i == 1) {
                     // In the 2nd round we also test with two iterators in parallel.
                     // This 2nd iterator is also special in that its hasNext() is never called.
                     if (it2 == null) {
                         it2 = coll.iterator();
                     }
-                    assertEquals(expectedItems[idx], OW22.unwrap(it2.next()));
+                    assertEquals(expectedItems[idx], OW300.unwrap(it2.next()));
                 }
                 idx++;
             }
@@ -601,7 +399,7 @@ public class DefaultObjectWrapperTest {
             testList.add("c");
             testList.add(new String[] { "x" });
 
-            TemplateSequenceModel seq = (TemplateSequenceModel) OW22.wrap(testList);
+            TemplateSequenceModel seq = (TemplateSequenceModel) OW300.wrap(testList);
             assertTrue(seq instanceof DefaultListAdapter);
             assertFalse(seq instanceof TemplateCollectionModel); // Maybe changes at 2.4.0
             assertEquals(4, seq.size());
@@ -621,7 +419,7 @@ public class DefaultObjectWrapperTest {
             testList.add(null);
             testList.add("c");
 
-            TemplateSequenceModel seq = (TemplateSequenceModel) OW22.wrap(testList);
+            TemplateSequenceModel seq = (TemplateSequenceModel) OW300.wrap(testList);
             assertTrue(seq instanceof DefaultListAdapter);
             assertTrue(seq instanceof TemplateCollectionModel); // Maybe changes at 2.4.0
             assertEquals(3, seq.size());
@@ -649,7 +447,7 @@ public class DefaultObjectWrapperTest {
             List testList = new ArrayList<>();
             testList.add(null);
 
-            final TemplateSequenceModel seq = (TemplateSequenceModel) OW22NM.wrap(testList);
+            final TemplateSequenceModel seq = (TemplateSequenceModel) OW300NM.wrap(testList);
             assertSame(NullModel.INSTANCE, seq.get(0));
             assertNull(seq.get(1));
         }
@@ -657,16 +455,16 @@ public class DefaultObjectWrapperTest {
 
     @Test
     public void testArrayAdapterTypes() throws TemplateModelException {
-        assertArrayAdapterClass("Object", OW22.wrap(new Object[] {}));
-        assertArrayAdapterClass("Object", OW22.wrap(new String[] {}));
-        assertArrayAdapterClass("byte", OW22.wrap(new byte[] {}));
-        assertArrayAdapterClass("short", OW22.wrap(new short[] {}));
-        assertArrayAdapterClass("int", OW22.wrap(new int[] {}));
-        assertArrayAdapterClass("long", OW22.wrap(new long[] {}));
-        assertArrayAdapterClass("float", OW22.wrap(new float[] {}));
-        assertArrayAdapterClass("double", OW22.wrap(new double[] {}));
-        assertArrayAdapterClass("boolean", OW22.wrap(new boolean[] {}));
-        assertArrayAdapterClass("char", OW22.wrap(new char[] {}));
+        assertArrayAdapterClass("Object", OW300.wrap(new Object[] {}));
+        assertArrayAdapterClass("Object", OW300.wrap(new String[] {}));
+        assertArrayAdapterClass("byte", OW300.wrap(new byte[] {}));
+        assertArrayAdapterClass("short", OW300.wrap(new short[] {}));
+        assertArrayAdapterClass("int", OW300.wrap(new int[] {}));
+        assertArrayAdapterClass("long", OW300.wrap(new long[] {}));
+        assertArrayAdapterClass("float", OW300.wrap(new float[] {}));
+        assertArrayAdapterClass("double", OW300.wrap(new double[] {}));
+        assertArrayAdapterClass("boolean", OW300.wrap(new boolean[] {}));
+        assertArrayAdapterClass("char", OW300.wrap(new char[] {}));
     }
 
     private void assertArrayAdapterClass(String adapterCompType, TemplateModel adaptedArray) {
@@ -682,7 +480,7 @@ public class DefaultObjectWrapperTest {
             final String[] testArray = new String[] { "a", null, "c" };
 
             {
-                TemplateSequenceModel seq = (TemplateSequenceModel) OW22.wrap(testArray);
+                TemplateSequenceModel seq = (TemplateSequenceModel) OW300.wrap(testArray);
                 assertEquals(3, seq.size());
                 assertNull(seq.get(-1));
                 assertEquals("a", ((TemplateScalarModel) seq.get(0)).getAsString());
@@ -692,7 +490,7 @@ public class DefaultObjectWrapperTest {
             }
 
             {
-                TemplateSequenceModel seq = (TemplateSequenceModel) OW22NM.wrap(testArray);
+                TemplateSequenceModel seq = (TemplateSequenceModel) OW300NM.wrap(testArray);
                 assertNull(seq.get(-1));
                 assertEquals("a", ((TemplateScalarModel) seq.get(0)).getAsString());
                 assertSame(NullModel.INSTANCE, seq.get(1));
@@ -703,7 +501,7 @@ public class DefaultObjectWrapperTest {
 
         {
             final int[] testArray = new int[] { 11, 22 };
-            TemplateSequenceModel seq = (TemplateSequenceModel) OW22.wrap(testArray);
+            TemplateSequenceModel seq = (TemplateSequenceModel) OW300.wrap(testArray);
             assertEquals(2, seq.size());
             assertNull(seq.get(-1));
             assertEqualsAndSameClass(Integer.valueOf(11), ((TemplateNumberModel) seq.get(0)).getAsNumber());
@@ -713,7 +511,7 @@ public class DefaultObjectWrapperTest {
 
         {
             final double[] testArray = new double[] { 11, 22 };
-            TemplateSequenceModel seq = (TemplateSequenceModel) OW22.wrap(testArray);
+            TemplateSequenceModel seq = (TemplateSequenceModel) OW300.wrap(testArray);
             assertEquals(2, seq.size());
             assertNull(seq.get(-1));
             assertEqualsAndSameClass(Double.valueOf(11), ((TemplateNumberModel) seq.get(0)).getAsNumber());
@@ -723,7 +521,7 @@ public class DefaultObjectWrapperTest {
 
         {
             final boolean[] testArray = new boolean[] { true, false };
-            TemplateSequenceModel seq = (TemplateSequenceModel) OW22.wrap(testArray);
+            TemplateSequenceModel seq = (TemplateSequenceModel) OW300.wrap(testArray);
             assertEquals(2, seq.size());
             assertNull(seq.get(-1));
             assertEqualsAndSameClass(Boolean.valueOf(true), ((TemplateBooleanModel) seq.get(0)).getAsBoolean());
@@ -733,7 +531,7 @@ public class DefaultObjectWrapperTest {
 
         {
             final char[] testArray = new char[] { 'a', 'b' };
-            TemplateSequenceModel seq = (TemplateSequenceModel) OW22.wrap(testArray);
+            TemplateSequenceModel seq = (TemplateSequenceModel) OW300.wrap(testArray);
             assertEquals(2, seq.size());
             assertNull(seq.get(-1));
             assertEquals("a", ((TemplateScalarModel) seq.get(0)).getAsString());
@@ -780,25 +578,25 @@ public class DefaultObjectWrapperTest {
             set.add("a");
             set.add("b");
             set.add("c");
-            TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW22CA.wrap(set);
+            TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300CA.wrap(set);
             assertTrue(coll instanceof DefaultNonListCollectionAdapter);
             assertEquals(3, coll.size());
             assertFalse(coll.isEmpty());
             assertCollectionTMEquals(coll, "a", "b", "c");
 
-            assertTrue(coll.contains(OW22CA.wrap("a")));
-            assertTrue(coll.contains(OW22CA.wrap("b")));
-            assertTrue(coll.contains(OW22CA.wrap("c")));
-            assertTrue(coll.contains(OW22CA.wrap("c")));
-            assertFalse(coll.contains(OW22CA.wrap("d")));
+            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")));
             try {
-                assertFalse(coll.contains(OW22CA.wrap(1)));
+                assertFalse(coll.contains(OW300CA.wrap(1)));
                 fail();
             } catch (TemplateModelException e) {
                 assertThat(e.getMessage(), containsString("Integer"));
             }
 
-            assertRoundtrip(OW22CA, set, DefaultNonListCollectionAdapter.class, TreeSet.class, "[a, b, c]");
+            assertRoundtrip(OW300CA, set, DefaultNonListCollectionAdapter.class, TreeSet.class, "[a, b, c]");
             
             assertSizeThroughAPIModel(3, coll);
         }
@@ -808,24 +606,24 @@ public class DefaultObjectWrapperTest {
             final List<String> list = Collections.singletonList("b");
             set.add(list);
             set.add(null);
-            TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW22CA.wrap(set);
+            TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300CA.wrap(set);
             TemplateModelIterator it = coll.iterator();
             final TemplateModel tm1 = it.next();
-            Object obj1 = OW22CA.unwrap(tm1);
+            Object obj1 = OW300CA.unwrap(tm1);
             final TemplateModel tm2 = it.next();
-            Object obj2 = OW22CA.unwrap(tm2);
+            Object obj2 = OW300CA.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(OW22CA.wrap(similarList)));
-            assertTrue(coll.contains(OW22CA.wrap(null)));
-            assertFalse(coll.contains(OW22CA.wrap("a")));
-            assertFalse(coll.contains(OW22CA.wrap(1)));
+            assertTrue(coll.contains(OW300CA.wrap(similarList)));
+            assertTrue(coll.contains(OW300CA.wrap(null)));
+            assertFalse(coll.contains(OW300CA.wrap("a")));
+            assertFalse(coll.contains(OW300CA.wrap(1)));
 
-            assertRoundtrip(OW22CA, set, DefaultNonListCollectionAdapter.class, HashSet.class, "[" + obj1 + ", "
+            assertRoundtrip(OW300CA, set, DefaultNonListCollectionAdapter.class, HashSet.class, "[" + obj1 + ", "
                     + obj2 + "]");
         }
     }
@@ -835,14 +633,14 @@ public class DefaultObjectWrapperTest {
     public void testCollectionAdapterOutOfBounds() throws TemplateModelException {
         Set set = Collections.singleton(123);
 
-        TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW22CA.wrap(set);
+        TemplateCollectionModelEx coll = (TemplateCollectionModelEx) OW300CA.wrap(set);
         TemplateModelIterator it = coll.iterator();
 
         for (int i = 0; i < 3; i++) {
             assertTrue(it.hasNext());
         }
 
-        assertEquals(123, OW22CA.unwrap(it.next()));
+        assertEquals(123, OW300CA.unwrap(it.next()));
 
         for (int i = 0; i < 3; i++) {
             assertFalse(it.hasNext());
@@ -861,7 +659,7 @@ public class DefaultObjectWrapperTest {
         set.add(null);
 
         {
-            DefaultObjectWrapper dow = new DefaultObjectWrapper(Configuration.VERSION_2_3_22);
+            DefaultObjectWrapper dow = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
             dow.setForceLegacyNonListCollections(false);
             TemplateCollectionModelEx coll = (TemplateCollectionModelEx) dow.wrap(set);
             assertEquals(1, coll.size());
@@ -870,7 +668,7 @@ public class DefaultObjectWrapperTest {
         }
 
         {
-            DefaultObjectWrapper dow = new DefaultObjectWrapper(Configuration.VERSION_2_3_22);
+            DefaultObjectWrapper dow = new DefaultObjectWrapper(Configuration.VERSION_3_0_0);
             dow.setForceLegacyNonListCollections(false);
             dow.setNullModel(NullModel.INSTANCE);
             TemplateCollectionModelEx coll = (TemplateCollectionModelEx) dow.wrap(set);
@@ -886,36 +684,30 @@ public class DefaultObjectWrapperTest {
         set.add("a");
         set.add("b");
         set.add("c");
-        TemplateSequenceModel seq = (TemplateSequenceModel) OW22.wrap(set);
+        TemplateSequenceModel seq = (TemplateSequenceModel) OW300.wrap(set);
         assertTrue(seq instanceof SimpleSequence);
         assertEquals(3, seq.size());
-        assertEquals("a", OW22.unwrap(seq.get(0)));
-        assertEquals("b", OW22.unwrap(seq.get(1)));
-        assertEquals("c", OW22.unwrap(seq.get(2)));
+        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 {
-        testIteratorWrapping(OW0, SimpleCollection.class, Class.forName("org.apache.freemarker.core.model.impl.beans.SetAdapter"));
-        testIteratorWrapping(OW22, DefaultIteratorAdapter.class, Iterator.class);
-    }
-
-    private void testIteratorWrapping(DefaultObjectWrapper ow, Class<?> expectedTMClass, Class<?> expectedPOJOClass)
-            throws TemplateModelException {
         final List<String> list = ImmutableList.<String> of("a", "b", "c");
         Iterator<String> it = list.iterator();
-        TemplateCollectionModel coll = (TemplateCollectionModel) ow.wrap(it);
+        TemplateCollectionModel coll = (TemplateCollectionModel) OW300.wrap(it);
 
-        assertRoundtrip(ow, coll, expectedTMClass, expectedPOJOClass, null);
+        assertRoundtrip(OW300, coll, DefaultIteratorAdapter.class, Iterator.class, null);
 
         TemplateModelIterator itIt = coll.iterator();
         TemplateModelIterator itIt2 = coll.iterator(); // used later
         assertTrue(itIt.hasNext());
-        assertEquals("a", ow.unwrap(itIt.next()));
+        assertEquals("a", OW300.unwrap(itIt.next()));
         assertTrue(itIt.hasNext());
-        assertEquals("b", ow.unwrap(itIt.next()));
+        assertEquals("b", OW300.unwrap(itIt.next()));
         assertTrue(itIt.hasNext());
-        assertEquals("c", ow.unwrap(itIt.next()));
+        assertEquals("c", OW300.unwrap(itIt.next()));
         assertFalse(itIt.hasNext());
         try {
             itIt.next();
@@ -952,24 +744,22 @@ public class DefaultObjectWrapperTest {
         Map sortedMapC = new TreeMap<>();
         sortedMapC.put('a', 1);
         
-        for (DefaultObjectWrapper ow : new DefaultObjectWrapper[] { OW0, OW22 } ) {
-            assertEquals(1, ow.unwrap(((TemplateHashModel) ow.wrap(hashMapS)).get("a")));
-            assertEquals(1, ow.unwrap(((TemplateHashModel) ow.wrap(hashMapC)).get("a")));
-            assertEquals(1, ow.unwrap(((TemplateHashModel) ow.wrap(sortedMapS)).get("a")));
-            try {
-                ((TemplateHashModel) ow.wrap(sortedMapC)).get("a");
-            } catch (TemplateModelException e) {
-                assertThat(e.getMessage(), containsStringIgnoringCase("String key"));
-            }
-            
-            assertNull(((TemplateHashModel) ow.wrap(hashMapS)).get("b"));
-            assertNull(((TemplateHashModel) ow.wrap(hashMapC)).get("b"));
-            assertNull(((TemplateHashModel) ow.wrap(sortedMapS)).get("b"));
-            try {
-                ((TemplateHashModel) ow.wrap(sortedMapC)).get("b");
-            } catch (TemplateModelException e) {
-                assertThat(e.getMessage(), containsStringIgnoringCase("String key"));
-            }
+        assertEquals(1, OW300.unwrap(((TemplateHashModel) OW300.wrap(hashMapS)).get("a")));
+        assertEquals(1, OW300.unwrap(((TemplateHashModel) OW300.wrap(hashMapC)).get("a")));
+        assertEquals(1, OW300.unwrap(((TemplateHashModel) OW300.wrap(sortedMapS)).get("a")));
+        try {
+            ((TemplateHashModel) OW300.wrap(sortedMapC)).get("a");
+        } catch (TemplateModelException e) {
+            assertThat(e.getMessage(), containsStringIgnoringCase("String key"));
+        }
+        
+        assertNull(((TemplateHashModel) OW300.wrap(hashMapS)).get("b"));
+        assertNull(((TemplateHashModel) OW300.wrap(hashMapC)).get("b"));
+        assertNull(((TemplateHashModel) OW300.wrap(sortedMapS)).get("b"));
+        try {
+            ((TemplateHashModel) OW300.wrap(sortedMapC)).get("b");
+        } catch (TemplateModelException e) {
+            assertThat(e.getMessage(), containsStringIgnoringCase("String key"));
         }
     }
     
@@ -980,7 +770,7 @@ public class DefaultObjectWrapperTest {
         String listingFTL = "<#list value as x>${x}<#sep>, </#list>";
         
         {
-            DefaultObjectWrapper ow = OW22;
+            DefaultObjectWrapper ow = OW300;
             TemplateModel tm = ow.wrap(iterable);
             assertThat(tm, instanceOf(TemplateHashModel.class));
             assertThat(tm, not(instanceOf(TemplateCollectionModel.class)));
@@ -991,7 +781,7 @@ public class DefaultObjectWrapperTest {
         }
         
         {
-            DefaultObjectWrapper ow = OW22IS;
+            DefaultObjectWrapper ow = OW300IS;
             TemplateModel tm = ow.wrap(iterable);
             assertThat(tm, instanceOf(TemplateCollectionModel.class));
             TemplateCollectionModel iterableTM = (TemplateCollectionModel) tm;
@@ -1013,7 +803,7 @@ public class DefaultObjectWrapperTest {
                 }
             }
             
-            assertTemplateOutput(OW22IS, iterable, listingFTL, "a, b, c");
+            assertTemplateOutput(OW300IS, iterable, listingFTL, "a, b, c");
         }
     }
     
@@ -1024,7 +814,7 @@ public class DefaultObjectWrapperTest {
         InputSource is = new InputSource();
         is.setCharacterStream(new StringReader("<doc><sub a='1' /></doc>"));
         Document doc = db.parse(is);        
-        assertTrue(OW22.wrap(doc) instanceof TemplateNodeModel);
+        assertTrue(OW300.wrap(doc) instanceof TemplateNodeModel);
     }
     
     private void assertSizeThroughAPIModel(int expectedSize, TemplateModel normalModel) throws TemplateModelException {
@@ -1054,7 +844,7 @@ public class DefaultObjectWrapperTest {
     
     private String processTemplate(ObjectWrapper objectWrapper, Object value, String ftl)
             throws TemplateException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_24);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setLogTemplateExceptions(false);
         cfg.setObjectWrapper(objectWrapper);
         StringWriter out = new StringWriter();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansAPINewInstanceTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansAPINewInstanceTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansAPINewInstanceTest.java
index b75147e..34e2a4f 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansAPINewInstanceTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansAPINewInstanceTest.java
@@ -19,17 +19,14 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import junit.framework.TestCase;
-
 import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
-import org.apache.freemarker.core.model.impl.beans._BeansAPI;
 import org.apache.freemarker.test.util.TestUtil;
 
+import junit.framework.TestCase;
+
 public class BeansAPINewInstanceTest extends TestCase {
 
-    private BeansWrapper beansWrapper = new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
+    private BeansWrapper beansWrapper = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
 
     public BeansAPINewInstanceTest(String name) {
         super(name);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBasics.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBasics.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBasics.java
index cd01e75..b1b4a60 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBasics.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBasics.java
@@ -19,21 +19,12 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateModelWithAPISupport;
-import org.apache.freemarker.core.model.impl.beans.APIModel;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
-import org.apache.freemarker.core.model.impl.beans.BooleanModel;
-import org.apache.freemarker.core.model.impl.beans.CollectionModel;
-import org.apache.freemarker.core.model.impl.beans.MapModel;
-import org.apache.freemarker.core.model.impl.beans.NumberModel;
-import org.apache.freemarker.core.model.impl.beans.SimpleMapModel;
-import org.apache.freemarker.core.model.impl.beans.StringModel;
 import org.junit.Test;
 
 import com.google.common.collect.ImmutableList;
@@ -45,7 +36,7 @@ public class BeansWrapperBasics {
     @Test
     public void testAPIBuiltInSupport() throws TemplateModelException {
         {
-            BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_2_3_0).build();
+            BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
             assertWrappingResult(StringModel.class, bw.wrap("s"));
             assertWrappingResult(NumberModel.class, bw.wrap(1.5));
             assertWrappingResult(BooleanModel.class, bw.wrap(true));
@@ -54,7 +45,7 @@ public class BeansWrapperBasics {
         }
         
         {
-            BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_2_3_0);
+            BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             bwb.setSimpleMapWrapper(true);
             BeansWrapper bw = bwb.build();
             assertWrappingResult(SimpleMapModel.class, bw.wrap(ImmutableMap.of("a", 1)));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc.java
new file mode 100644
index 0000000..6fd9a8c
--- /dev/null
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc.java
@@ -0,0 +1,30 @@
+/*
+ * 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.core.model.impl.beans;
+
+import org.apache.freemarker.core.Configuration;
+
+public class BeansWrapperDesc extends BeansWrapperWithShortedMethods {
+
+    public BeansWrapperDesc() {
+        super(Configuration.VERSION_3_0_0, true);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc2003020.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc2003020.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc2003020.java
deleted file mode 100644
index a4a667e..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc2003020.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class BeansWrapperDesc2003020 extends BeansWrapperWithShortedMethods {
-
-    public BeansWrapperDesc2003020() {
-        super(Configuration.VERSION_2_3_20, true);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc2003021.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc2003021.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc2003021.java
deleted file mode 100644
index 75ddd98..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperDesc2003021.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class BeansWrapperDesc2003021 extends BeansWrapperWithShortedMethods {
-
-    public BeansWrapperDesc2003021() {
-        super(Configuration.VERSION_2_3_21, true);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc.java
new file mode 100644
index 0000000..b347b95
--- /dev/null
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc.java
@@ -0,0 +1,30 @@
+/*
+ * 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.core.model.impl.beans;
+
+import org.apache.freemarker.core.Configuration;
+
+public class BeansWrapperInc extends BeansWrapperWithShortedMethods {
+
+    public BeansWrapperInc() {
+        super(Configuration.VERSION_3_0_0, false);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc2003020.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc2003020.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc2003020.java
deleted file mode 100644
index 9bdd756..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc2003020.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class BeansWrapperInc2003020 extends BeansWrapperWithShortedMethods {
-
-    public BeansWrapperInc2003020() {
-        super(Configuration.VERSION_2_3_20, false);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc2003021.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc2003021.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc2003021.java
deleted file mode 100644
index 96c5f08..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperInc2003021.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class BeansWrapperInc2003021 extends BeansWrapperWithShortedMethods {
-
-    public BeansWrapperInc2003021() {
-        super(Configuration.VERSION_2_3_21, false);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
index a49ec16..4baf16a 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
@@ -20,6 +20,7 @@
 package org.apache.freemarker.core.model.impl.beans;
 
 import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.instanceOf;
 import static org.junit.Assert.assertThat;
 
 import java.lang.ref.Reference;
@@ -57,8 +58,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
     }
 
     public void testBeansWrapperFactoryEquals() throws Exception {
-        assertEquals(Configuration.VERSION_2_3_21, new BeansWrapperBuilder(Configuration.VERSION_2_3_21).getIncompatibleImprovements());
-        assertEquals(Configuration.VERSION_2_3_0, new BeansWrapperBuilder(Configuration.VERSION_2_3_20).getIncompatibleImprovements());
+        assertEquals(Configuration.VERSION_3_0_0, new BeansWrapperBuilder(Configuration.VERSION_3_0_0).getIncompatibleImprovements());
         try {
             new BeansWrapperBuilder(TestUtil.getClosestFutureVersion());
             fail("Maybe you need to update this test for the new FreeMarker version");
@@ -69,8 +69,8 @@ public class BeansWrapperSingletonsTest extends TestCase {
         BeansWrapperBuilder pa1;
         BeansWrapperBuilder pa2;
         
-        pa1 = new BeansWrapperBuilder(Configuration.VERSION_2_3_21);
-        pa2 = new BeansWrapperBuilder(Configuration.VERSION_2_3_21);
+        pa1 = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
+        pa2 = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
         assertEquals(pa1, pa2);
         
         pa1.setSimpleMapWrapper(true);
@@ -145,15 +145,15 @@ public class BeansWrapperSingletonsTest extends TestCase {
         assertEquals(0, getBeansWrapperInstanceCacheSize());
         
         {
-            BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_2_3_19, true);
+            BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_3_0_0, true);
             assertEquals(1, getBeansWrapperInstanceCacheSize());
             assertSame(bw.getClass(), BeansWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, bw.getIncompatibleImprovements());
             assertTrue(bw.isWriteProtected());
             assertTrue(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof SimpleMapModel);
+            assertThat(bw.wrap(new HashMap()), instanceOf(SimpleMapModel.class));
             assertFalse(bw.isStrict());
-            assertFalse(bw.getUseCache());
+            assertFalse(bw.getUseModelCache());
             assertEquals(TemplateDateModel.UNKNOWN, bw.getDefaultDateType());
             assertSame(bw, bw.getOuterIdentity());
             assertTrue(bw.isClassIntrospectionCacheRestricted());
@@ -167,98 +167,39 @@ public class BeansWrapperSingletonsTest extends TestCase {
                 assertThat(e.getMessage(), containsString("modify"));
             }
             
-            assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_2_3_20, true));
-            assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_2_3_0, true));
-            assertEquals(1, getBeansWrapperInstanceCacheSize());
-            
-            BeansWrapperBuilder factory = new BeansWrapperBuilder(new Version(2, 3, 5));
-            factory.setSimpleMapWrapper(true);
-            assertSame(bw, factory.build());
+            assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_3_0_0, true));
             assertEquals(1, getBeansWrapperInstanceCacheSize());
             
             hardReferences.add(bw);            
         }
         
         {
-            BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_2_3_21, true);
+            BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_3_0_0, false);
             assertEquals(2, getBeansWrapperInstanceCacheSize());
             assertSame(bw.getClass(), BeansWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_21, bw.getIncompatibleImprovements());
-            assertTrue(bw.isWriteProtected());
-            assertTrue(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof SimpleMapModel);
-            assertTrue(bw.isClassIntrospectionCacheRestricted());
-            assertNull(bw.getMethodAppearanceFineTuner());
-            assertNull(bw.getMethodSorter());
-            
-            BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_21);
-            factory.setSimpleMapWrapper(true);
-            assertSame(bw, factory.build());
-            assertEquals(2, getBeansWrapperInstanceCacheSize());
-            
-            hardReferences.add(bw);            
-        }
-        
-        {
-            // Again... same as the very first
-            BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_2_3_19, true);
-            assertEquals(2, getBeansWrapperInstanceCacheSize());
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
-        }
-        
-        {
-            BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_2_3_19, false);
-            assertEquals(3, getBeansWrapperInstanceCacheSize());
-            assertSame(bw.getClass(), BeansWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
-            assertTrue(bw.isWriteProtected());
-            assertFalse(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof MapModel);
-            
-            assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_2_3_20, false));
-            assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_2_3_0, false));
-            assertSame(bw, new BeansWrapperBuilder(new Version(2, 3, 5)).build());
-            assertEquals(3, getBeansWrapperInstanceCacheSize());
-            
-            hardReferences.add(bw);            
-        }
-        
-        {
-            BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_2_3_21, false);
-            assertEquals(4, getBeansWrapperInstanceCacheSize());
-            assertSame(bw.getClass(), BeansWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_21, bw.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, bw.getIncompatibleImprovements());
             assertTrue(bw.isWriteProtected());
             assertFalse(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof MapModel);
+            assertThat(bw.wrap(new HashMap()), instanceOf(MapModel.class));
             
-            assertSame(bw, new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build());
-            assertEquals(4, getBeansWrapperInstanceCacheSize());
+            assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_3_0_0, false));
             
             hardReferences.add(bw);            
         }
-
-        {
-            // Again... same as earlier
-            BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_2_3_21, true);
-            assertEquals(Configuration.VERSION_2_3_21, bw.getIncompatibleImprovements());
-            assertTrue(bw.isSimpleMapWrapper());
-            assertEquals(4, getBeansWrapperInstanceCacheSize());
-        }
         
         {
-            BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_19);
+            BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             factory.setExposureLevel(BeansWrapper.EXPOSE_PROPERTIES_ONLY);
             BeansWrapper bw = factory.build();
             BeansWrapper bw2 = factory.build();
-            assertEquals(5, getBeansWrapperInstanceCacheSize());
+            assertEquals(3, getBeansWrapperInstanceCacheSize());
             assertSame(bw, bw2);
             
             assertSame(bw.getClass(), BeansWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, bw.getIncompatibleImprovements());
             assertTrue(bw.isWriteProtected());
             assertFalse(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof MapModel);
+            assertThat(bw.wrap(new HashMap()), instanceOf(MapModel.class));
             assertEquals(BeansWrapper.EXPOSE_PROPERTIES_ONLY, bw.getExposureLevel());
             assertFalse(bw.isStrict());
             assertEquals(TemplateDateModel.UNKNOWN, bw.getDefaultDateType());
@@ -268,30 +209,29 @@ public class BeansWrapperSingletonsTest extends TestCase {
         }
         
         {
-            BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_19);
+            BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             factory.setExposeFields(true);
             BeansWrapper bw = factory.build();
             BeansWrapper bw2 = factory.build();
-            assertEquals(6, getBeansWrapperInstanceCacheSize());
+            assertEquals(4, getBeansWrapperInstanceCacheSize());
             assertSame(bw, bw2);
             
             assertSame(bw.getClass(), BeansWrapper.class);
-            assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, bw.getIncompatibleImprovements());
             assertTrue(bw.isWriteProtected());
             assertFalse(bw.isSimpleMapWrapper());
-            assertTrue(bw.wrap(new HashMap()) instanceof MapModel);
             assertTrue(bw.isExposeFields());
             
             hardReferences.add(bw);            
         }
         
         {
-            BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_19);
+            BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             factory.setStrict(true);
             factory.setDefaultDateType(TemplateDateModel.DATETIME);
-            factory.setOuterIdentity(new SimpleObjectWrapper(Configuration.VERSION_2_3_0));
+            factory.setOuterIdentity(new SimpleObjectWrapper(Configuration.VERSION_3_0_0));
             BeansWrapper bw = factory.build();
-            assertEquals(7, getBeansWrapperInstanceCacheSize());
+            assertEquals(5, getBeansWrapperInstanceCacheSize());
             assertTrue(bw.isStrict());
             assertEquals(TemplateDateModel.DATETIME, bw.getDefaultDateType());
             assertSame(SimpleObjectWrapper.class, bw.getOuterIdentity().getClass());
@@ -301,34 +241,34 @@ public class BeansWrapperSingletonsTest extends TestCase {
         
         // Effect of reference and cache clearings:
         {
-            BeansWrapper bw1 = new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
-            assertEquals(7, getBeansWrapperInstanceCacheSize());
-            assertEquals(7, getBeansWrapperNonClearedInstanceCacheSize());
+            BeansWrapper bw1 = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
+            assertEquals(5, getBeansWrapperInstanceCacheSize());
+            assertEquals(5, getBeansWrapperNonClearedInstanceCacheSize());
             
             clearBeansWrapperInstanceCacheReferences(false);
-            assertEquals(7, getBeansWrapperInstanceCacheSize());
+            assertEquals(5, getBeansWrapperInstanceCacheSize());
             assertEquals(0, getBeansWrapperNonClearedInstanceCacheSize());
             
-            BeansWrapper bw2 = new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
+            BeansWrapper bw2 = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
             assertNotSame(bw1, bw2);
-            assertEquals(7, getBeansWrapperInstanceCacheSize());
+            assertEquals(5, getBeansWrapperInstanceCacheSize());
             assertEquals(1, getBeansWrapperNonClearedInstanceCacheSize());
             
-            assertSame(bw2, new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build());
+            assertSame(bw2, new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build());
             assertEquals(1, getBeansWrapperNonClearedInstanceCacheSize());
             
             clearBeansWrapperInstanceCacheReferences(true);
-            BeansWrapper bw3 = new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
+            BeansWrapper bw3 = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
             assertNotSame(bw2, bw3);
             assertEquals(1, getBeansWrapperInstanceCacheSize());
             assertEquals(1, getBeansWrapperNonClearedInstanceCacheSize());
         }
 
         {
-            BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_19);
+            BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             factory.setUseModelCache(true);
             BeansWrapper bw = factory.build();
-            assertTrue(bw.getUseCache());
+            assertTrue(bw.getUseModelCache());
             assertEquals(2, getBeansWrapperInstanceCacheSize());
             
             hardReferences.add(bw);            
@@ -348,7 +288,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
         
         assertEquals(0, getBeansWrapperInstanceCacheSize());
         
-        BeansWrapper bw1 = new BeansWrapperBuilder(Configuration.VERSION_2_3_19).build();
+        BeansWrapper bw1 = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
         assertEquals(1, getBeansWrapperInstanceCacheSize());
         hardReferences.add(bw1);
         
@@ -359,44 +299,49 @@ public class BeansWrapperSingletonsTest extends TestCase {
         BeansWrapper bw2;
         Thread.currentThread().setContextClassLoader(newTCCL);
         try {
-            bw2 = new BeansWrapperBuilder(Configuration.VERSION_2_3_19).build();
+            bw2 = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
             assertEquals(2, getBeansWrapperInstanceCacheSize());
             hardReferences.add(bw2);
             
             assertNotSame(bw1, bw2);
-            assertSame(bw2, new BeansWrapperBuilder(Configuration.VERSION_2_3_19).build());
+            assertSame(bw2, new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build());
         } finally {
             Thread.currentThread().setContextClassLoader(oldTCCL);
         }
         
-        assertSame(bw1, new BeansWrapperBuilder(Configuration.VERSION_2_3_19).build());
+        assertSame(bw1, new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build());
         assertEquals(2, getBeansWrapperInstanceCacheSize());
 
         BeansWrapper bw3;
         Thread.currentThread().setContextClassLoader(newTCCL);
         try {
-            assertSame(bw2, new BeansWrapperBuilder(Configuration.VERSION_2_3_19).build());
+            assertSame(bw2, new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build());
             
-            bw3 = new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
+            BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
+            bwb.setExposeFields(true);
+            bw3 = bwb.build();
             assertEquals(3, getBeansWrapperInstanceCacheSize());
             hardReferences.add(bw3);
         } finally {
             Thread.currentThread().setContextClassLoader(oldTCCL);
         }
         
-        BeansWrapper bw4 = new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
-        assertEquals(4, getBeansWrapperInstanceCacheSize());
-        hardReferences.add(bw4);
-        
-        assertNotSame(bw3, bw4);
+        {
+            BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
+            bwb.setExposeFields(true);
+            BeansWrapper bw4 = bwb.build();
+            assertEquals(4, getBeansWrapperInstanceCacheSize());
+            assertNotSame(bw3, bw4);
+            hardReferences.add(bw4);
+        }
         
         assertTrue(hardReferences.size() != 0);  // just to save it from GC until this line        
     }
     
     public void testClassInrospectorCache() throws TemplateModelException {
         assertFalse(new BeansWrapper().isClassIntrospectionCacheRestricted());
-        assertFalse(new BeansWrapper(Configuration.VERSION_2_3_21).isClassIntrospectionCacheRestricted());
-        assertTrue(new BeansWrapperBuilder(Configuration.VERSION_2_3_20).build().isClassIntrospectionCacheRestricted());
+        assertFalse(new BeansWrapper(Configuration.VERSION_3_0_0).isClassIntrospectionCacheRestricted());
+        assertTrue(new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build().isClassIntrospectionCacheRestricted());
         
         ClassIntrospectorBuilder.clearInstanceCache();
         BeansWrapperBuilder.clearInstanceCache();
@@ -406,7 +351,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
         BeansWrapperBuilder factory;
         
         {
-            factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_19);
+            factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             
             BeansWrapper bw1 = factory.build();
             checkClassIntrospectorCacheSize(1);
@@ -432,7 +377,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
         }
         
         {
-            factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_19);
+            factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             factory.setExposeFields(true);
             BeansWrapper bw = factory.build();
             checkClassIntrospectorCacheSize(2);
@@ -517,7 +462,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
         }
         
         {
-            factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_21);
+            factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             factory.setExposeFields(false);
             factory.setExposureLevel(BeansWrapper.EXPOSE_PROPERTIES_ONLY);
             
@@ -580,7 +525,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
         }
         
         {
-            factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_19);
+            factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             BeansWrapper bw = factory.build();
             checkClassIntrospectorCacheSize(8);
             assertEquals(2, getClassIntrospectorNonClearedInstanceCacheSize());
@@ -598,7 +543,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
         assertEquals(0, getClassIntrospectorNonClearedInstanceCacheSize());
         
         {
-            factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_21);
+            factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             factory.setExposeFields(true);
             BeansWrapper bw = factory.build();
             checkClassIntrospectorCacheSize(1);
@@ -612,7 +557,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
         }
         
         {
-            factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_19);
+            factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
             factory.setMethodAppearanceFineTuner(new MethodAppearanceFineTuner() {
                 @Override
                 public void process(MethodAppearanceDecisionInput in, MethodAppearanceDecision out) {
@@ -644,8 +589,9 @@ public class BeansWrapperSingletonsTest extends TestCase {
         }
 
         {
-            factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_19);
-            factory.setMethodAppearanceFineTuner(GetlessMethodsAsPropertyGettersRule.INSTANCE);  // doesn't spoils sharing
+            factory = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
+            factory.setMethodAppearanceFineTuner(
+                    GetlessMethodsAsPropertyGettersRule.INSTANCE);  // doesn't spoils sharing
             
             BeansWrapper bw1 = factory.build();
             assertSame(bw1, factory.build());

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/CommonSupertypeForUnwrappingHintTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/CommonSupertypeForUnwrappingHintTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/CommonSupertypeForUnwrappingHintTest.java
index a0962a4..edf8c41 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/CommonSupertypeForUnwrappingHintTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/CommonSupertypeForUnwrappingHintTest.java
@@ -22,45 +22,19 @@ package org.apache.freemarker.core.model.impl.beans;
 import java.io.Serializable;
 import java.util.List;
 
-import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.CallableMemberDescriptor;
-import org.apache.freemarker.core.model.impl.beans.MaybeEmptyMemberAndArguments;
-import org.apache.freemarker.core.model.impl.beans.OverloadedMethodsSubset;
 
 import junit.framework.TestCase;
 
 public class CommonSupertypeForUnwrappingHintTest extends TestCase {
     
-    final OverloadedMethodsSubset buggy
-            = new DummyOverloadedMethodsSubset(new BeansWrapper(Configuration.VERSION_2_3_20).is2321Bugfixed());
-    final OverloadedMethodsSubset fixed
-            = new DummyOverloadedMethodsSubset(new BeansWrapper(Configuration.VERSION_2_3_21).is2321Bugfixed());
+    final OverloadedMethodsSubset oms = new DummyOverloadedMethodsSubset();
 
     public CommonSupertypeForUnwrappingHintTest(String name) {
         super(name);
     }
 
-    public void testSame() {
-        testSame(buggy);
-        testSame(fixed);
-    }
-
-    /** These will be the same with fixed and buggy: */
-    private void testSame(OverloadedMethodsSubset oms) {
-        assertEquals(char.class, oms.getCommonSupertypeForUnwrappingHint(char.class, char.class));
-        assertEquals(Integer.class, oms.getCommonSupertypeForUnwrappingHint(Integer.class, Integer.class));
-        assertEquals(String.class, oms.getCommonSupertypeForUnwrappingHint(String.class, String.class));
-    }
-
     public void testInterfaces() {
-        testInterfaces(fixed);
-        testInterfaces(buggy);
-    }
-
-    /** These will be the same with fixed and buggy: */
-    private void testInterfaces(OverloadedMethodsSubset oms) {
         assertEquals(Serializable.class, oms.getCommonSupertypeForUnwrappingHint(String.class, Number.class));
         assertEquals(C1I1.class, oms.getCommonSupertypeForUnwrappingHint(C2ExtC1I1.class, C3ExtC1I1.class));
         assertEquals(Object.class, oms.getCommonSupertypeForUnwrappingHint(C3I1I2.class, C4I1I2.class));
@@ -69,24 +43,15 @@ public class CommonSupertypeForUnwrappingHintTest extends TestCase {
         assertEquals(I2.class, oms.getCommonSupertypeForUnwrappingHint(C3I1I2.class, I2.class));
         assertEquals(I1.class, oms.getCommonSupertypeForUnwrappingHint(I1I2.class, I1.class));
         assertEquals(I2.class, oms.getCommonSupertypeForUnwrappingHint(I1I2.class, I2.class));
-    }
-    
-    public void testBuggyInterfaces() {
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(String.class, StringBuilder.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(C7ExtC6I1.class, C8ExtC6I1.class));
-    }
-    
-    public void testFixedInterfaces() {
-        assertEquals(CharSequence.class, fixed.getCommonSupertypeForUnwrappingHint(String.class, StringBuilder.class));
-        assertEquals(C6.class, fixed.getCommonSupertypeForUnwrappingHint(C7ExtC6I1.class, C8ExtC6I1.class));
+        assertEquals(CharSequence.class, oms.getCommonSupertypeForUnwrappingHint(String.class, StringBuilder.class));
+        assertEquals(C6.class, oms.getCommonSupertypeForUnwrappingHint(C7ExtC6I1.class, C8ExtC6I1.class));
     }
 
     public void testArrayAndOther() {
-        testArrayAndOther(buggy);
-        testArrayAndOther(fixed);
+        testArrayAndOther(oms);
     }
     
-    /** These will be the same with fixed and buggy: */
+    /** These will be the same with oms and buggy: */
     private void testArrayAndOther(OverloadedMethodsSubset oms) {
         assertEquals(Serializable.class, oms.getCommonSupertypeForUnwrappingHint(int[].class, String.class));
         assertEquals(Serializable.class, oms.getCommonSupertypeForUnwrappingHint(Object[].class, String.class));
@@ -98,52 +63,31 @@ public class CommonSupertypeForUnwrappingHintTest extends TestCase {
         assertEquals(Object[].class, oms.getCommonSupertypeForUnwrappingHint(Object[].class, Object[].class));
     }
     
-    public void testArrayAndDifferentArrayBuggy() {
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(int[].class, Object[].class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(int[].class, long[].class));
-    }
-    
-    public void testArrayAndDifferentArrayFixed() {
-        assertEquals(Serializable.class, fixed.getCommonSupertypeForUnwrappingHint(int[].class, Object[].class));
-        assertEquals(Serializable.class, fixed.getCommonSupertypeForUnwrappingHint(int[].class, long[].class));
+    public void testArrayAndDifferentArray() {
+        assertEquals(Serializable.class, oms.getCommonSupertypeForUnwrappingHint(int[].class, Object[].class));
+        assertEquals(Serializable.class, oms.getCommonSupertypeForUnwrappingHint(int[].class, long[].class));
     }
     
-    public void testFixedPrimitive() {
-        assertEquals(Integer.class, fixed.getCommonSupertypeForUnwrappingHint(int.class, Integer.class));
-        assertEquals(Integer.class, fixed.getCommonSupertypeForUnwrappingHint(Integer.class, int.class));
-        assertEquals(Number.class, fixed.getCommonSupertypeForUnwrappingHint(int.class, Long.class));
-        assertEquals(Number.class, fixed.getCommonSupertypeForUnwrappingHint(Long.class, int.class));
-        assertEquals(Number.class, fixed.getCommonSupertypeForUnwrappingHint(Integer.class, long.class));
-        assertEquals(Number.class, fixed.getCommonSupertypeForUnwrappingHint(long.class, Integer.class));
-        assertEquals(Boolean.class, fixed.getCommonSupertypeForUnwrappingHint(boolean.class, Boolean.class));
-        assertEquals(Boolean.class, fixed.getCommonSupertypeForUnwrappingHint(Boolean.class, boolean.class));
-        assertEquals(Character.class, fixed.getCommonSupertypeForUnwrappingHint(char.class, Character.class));
-        assertEquals(Character.class, fixed.getCommonSupertypeForUnwrappingHint(Character.class, char.class));
-        assertEquals(Number.class, fixed.getCommonSupertypeForUnwrappingHint(int.class, short.class));
-        assertEquals(Number.class, fixed.getCommonSupertypeForUnwrappingHint(short.class, int.class));
-    }
-
-    public void testBuggyPrimitive() {
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(int.class, Integer.class));
-        assertEquals(Integer.class, buggy.getCommonSupertypeForUnwrappingHint(Integer.class, int.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(int.class, Long.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(Long.class, int.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(Integer.class, long.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(long.class, Integer.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(boolean.class, Boolean.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(Boolean.class, boolean.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(char.class, Character.class));
-        assertEquals(Character.class, buggy.getCommonSupertypeForUnwrappingHint(Character.class, char.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(int.class, short.class));
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(short.class, int.class));
+    public void testPrimitive() {
+        assertEquals(Integer.class, oms.getCommonSupertypeForUnwrappingHint(int.class, Integer.class));
+        assertEquals(Integer.class, oms.getCommonSupertypeForUnwrappingHint(Integer.class, int.class));
+        assertEquals(Number.class, oms.getCommonSupertypeForUnwrappingHint(int.class, Long.class));
+        assertEquals(Number.class, oms.getCommonSupertypeForUnwrappingHint(Long.class, int.class));
+        assertEquals(Number.class, oms.getCommonSupertypeForUnwrappingHint(Integer.class, long.class));
+        assertEquals(Number.class, oms.getCommonSupertypeForUnwrappingHint(long.class, Integer.class));
+        assertEquals(Boolean.class, oms.getCommonSupertypeForUnwrappingHint(boolean.class, Boolean.class));
+        assertEquals(Boolean.class, oms.getCommonSupertypeForUnwrappingHint(Boolean.class, boolean.class));
+        assertEquals(Character.class, oms.getCommonSupertypeForUnwrappingHint(char.class, Character.class));
+        assertEquals(Character.class, oms.getCommonSupertypeForUnwrappingHint(Character.class, char.class));
+        assertEquals(Number.class, oms.getCommonSupertypeForUnwrappingHint(int.class, short.class));
+        assertEquals(Number.class, oms.getCommonSupertypeForUnwrappingHint(short.class, int.class));
     }
 
-    public void testFixedMisc() {
-        assertEquals(Number.class, fixed.getCommonSupertypeForUnwrappingHint(Long.class, Integer.class));
-    }
-    
-    public void testBuggyMisc() {
-        assertEquals(Object.class, buggy.getCommonSupertypeForUnwrappingHint(Long.class, Integer.class));
+    public void testMisc() {
+        assertEquals(Number.class, oms.getCommonSupertypeForUnwrappingHint(Long.class, Integer.class));
+        assertEquals(char.class, oms.getCommonSupertypeForUnwrappingHint(char.class, char.class));
+        assertEquals(Integer.class, oms.getCommonSupertypeForUnwrappingHint(Integer.class, Integer.class));
+        assertEquals(String.class, oms.getCommonSupertypeForUnwrappingHint(String.class, String.class));
     }
     
     static interface I1 { };
@@ -161,8 +105,8 @@ public class CommonSupertypeForUnwrappingHintTest extends TestCase {
     
     private static class DummyOverloadedMethodsSubset extends OverloadedMethodsSubset {
 
-        DummyOverloadedMethodsSubset(boolean bugfixed) {
-            super(bugfixed);
+        DummyOverloadedMethodsSubset() {
+            super();
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc.java
new file mode 100644
index 0000000..bf61205
--- /dev/null
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc.java
@@ -0,0 +1,30 @@
+/*
+ * 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.core.model.impl.beans;
+
+import org.apache.freemarker.core.Configuration;
+
+public class DefaultObjectWrapperDesc extends DefaultObjectWrapperWithSortedMethods {
+
+    public DefaultObjectWrapperDesc() {
+        super(Configuration.VERSION_3_0_0, true);
+    }
+    
+}


[6/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/HeaderParsingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/HeaderParsingTest.java b/src/test/java/org/apache/freemarker/core/ast/HeaderParsingTest.java
index 8e9d194..5cb4e79 100644
--- a/src/test/java/org/apache/freemarker/core/ast/HeaderParsingTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/HeaderParsingTest.java
@@ -28,8 +28,8 @@ import org.junit.Test;
 
 public class HeaderParsingTest extends TemplateTest {
 
-    private final Configuration cfgStripWS = new Configuration(Configuration.VERSION_2_3_21);
-    private final Configuration cfgNoStripWS = new Configuration(Configuration.VERSION_2_3_21);
+    private final Configuration cfgStripWS = new Configuration(Configuration.VERSION_3_0_0);
+    private final Configuration cfgNoStripWS = new Configuration(Configuration.VERSION_3_0_0);
     {
         cfgNoStripWS.setWhitespaceStripping(false);
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportConfigurableLayersTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportConfigurableLayersTest.java b/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportConfigurableLayersTest.java
index 06305be..b194ac8 100644
--- a/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportConfigurableLayersTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportConfigurableLayersTest.java
@@ -24,9 +24,6 @@ import java.io.StringWriter;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
-import org.apache.freemarker.core.ast.Configurable;
-import org.apache.freemarker.core.ast.Environment;
-import org.apache.freemarker.core.ast.TemplateConfiguration;
 import org.apache.freemarker.core.templateresolver.ConditionalTemplateConfigurationFactory;
 import org.apache.freemarker.core.templateresolver.FileNameGlobMatcher;
 import org.apache.freemarker.test.TemplateTest;
@@ -318,7 +315,7 @@ public class IncludeAndImportConfigurableLayersTest extends TemplateTest {
     
     @Override
     protected Configuration createConfiguration() throws Exception {
-        return new Configuration(Configuration.VERSION_2_3_24);
+        return new Configuration(Configuration.VERSION_3_0_0);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportTest.java b/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportTest.java
index 1681f57..dc3e266 100644
--- a/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/IncludeAndImportTest.java
@@ -31,7 +31,6 @@ import java.lang.reflect.Modifier;
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.TemplateNotFoundException;
-import org.apache.freemarker.core.ast.InvalidReferenceException;
 import org.apache.freemarker.core.ast.Environment.LazilyInitializedNamespace;
 import org.apache.freemarker.core.ast.Environment.Namespace;
 import org.apache.freemarker.core.model.WrappingTemplateModel;
@@ -81,20 +80,14 @@ public class IncludeAndImportTest extends TemplateTest {
                 + "<#import 'lib1.ftl' as lib1> ${.main.lib1???c} ${.globals.lib1???c}";
         String expectedOut = "false false true true";
         assertOutput(ftl, expectedOut);
-        // No difference:
-        getConfiguration().setIncompatibleImprovements(Configuration.VERSION_2_3_24);
-        assertOutput(ftl, expectedOut);
     }
     
     @Test
     public void importInMainCreatesGlobalBugfix() throws IOException, TemplateException {
-        // An import in the main namespace should create a global variable, but there's a bug where that doesn't happen
-        // if the imported library was already initialized elsewhere.
+        // An import in the main namespace should create a global variable, even if the imported library was already
+        // initialized elsewhere.
         String ftl = "<#import 'lib3ImportsLib1.ftl' as lib3>${lib1Cnt} ${.main.lib1???c} ${.globals.lib1???c}, "
         + "<#import 'lib1.ftl' as lib1>${lib1Cnt} ${.main.lib1???c} ${.globals.lib1???c}";
-        assertOutput(ftl, "1 false false, 1 true false");
-        // Activate bugfix:
-        getConfiguration().setIncompatibleImprovements(Configuration.VERSION_2_3_24);
         assertOutput(ftl, "1 false false, 1 true true");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/IteratorIssuesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/IteratorIssuesTest.java b/src/test/java/org/apache/freemarker/core/ast/IteratorIssuesTest.java
index 0dd8b01..10b774f 100644
--- a/src/test/java/org/apache/freemarker/core/ast/IteratorIssuesTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/IteratorIssuesTest.java
@@ -38,81 +38,35 @@ public class IteratorIssuesTest extends TemplateTest {
     
     private static final String FTL_LIST_AND_HAS_CONTENT
             = "<#list it as i>${i}${it?hasContent?then('+', '-')}</#list>";
-    private static final String OUT_LIST_AND_HAS_CONTENT_BW_WRONG = "a+b+c+";
     private static final String OUT_LIST_AND_HAS_CONTENT_BW_GOOD = "a+b+c-";
 
     @Test
-    public void testHasContentAndListDOW230() throws Exception {
-        addToDataModel("it", getDOW230().wrap(getAbcIt()));
+    public void testHasContentAndListDOW() throws Exception {
+        addToDataModel("it", getDOW300().wrap(getAbcIt()));
         assertOutput(FTL_HAS_CONTENT_AND_LIST, OUT_HAS_CONTENT_AND_LIST_ABC);
         
-        addToDataModel("it", getDOW230().wrap(getEmptyIt()));
+        addToDataModel("it", getDOW300().wrap(getEmptyIt()));
         assertOutput(FTL_HAS_CONTENT_AND_LIST, OUT_HAS_CONTENT_AND_LIST_EMPTY);
     }
 
     @Test
-    public void testHasContentAndListDOW2323() throws Exception {
-        addToDataModel("it", getDOW2323().wrap(getAbcIt()));
+    public void testHasContentAndListBW() throws Exception {
+        addToDataModel("it", getBW300().wrap(getAbcIt()));
         assertOutput(FTL_HAS_CONTENT_AND_LIST, OUT_HAS_CONTENT_AND_LIST_ABC);
         
-        addToDataModel("it", getDOW2323().wrap(getEmptyIt()));
-        assertOutput(FTL_HAS_CONTENT_AND_LIST, OUT_HAS_CONTENT_AND_LIST_EMPTY);
-    }
-
-    @Test
-    public void testHasContentAndListBW230() throws Exception {
-        addToDataModel("it", getBW230().wrap(getAbcIt()));
-        assertOutput(FTL_HAS_CONTENT_AND_LIST, OUT_HAS_CONTENT_AND_LIST_ABC);
-        
-        addToDataModel("it", getBW230().wrap(getEmptyIt()));
-        assertOutput(FTL_HAS_CONTENT_AND_LIST, "");
-    }
-    
-    @Test
-    public void testHasContentAndListBW2323() throws Exception {
-        addToDataModel("it", getBW2323().wrap(getAbcIt()));
-        assertOutput(FTL_HAS_CONTENT_AND_LIST, OUT_HAS_CONTENT_AND_LIST_ABC);
-        
-        addToDataModel("it", getBW230().wrap(getEmptyIt()));
-        assertOutput(FTL_HAS_CONTENT_AND_LIST, "");
-    }
-    
-    @Test
-    public void testHasContentAndListBW2324() throws Exception {
-        addToDataModel("it", getBW2324().wrap(getAbcIt()));
-        assertOutput(FTL_HAS_CONTENT_AND_LIST, OUT_HAS_CONTENT_AND_LIST_ABC);
-        
-        addToDataModel("it", getBW2324().wrap(getEmptyIt()));
+        addToDataModel("it", getBW300().wrap(getEmptyIt()));
         assertOutput(FTL_HAS_CONTENT_AND_LIST, OUT_HAS_CONTENT_AND_LIST_EMPTY);
     }
     
     @Test
-    public void testListAndHasContentDOW230() throws Exception {
-        addToDataModel("it", getDOW230().wrap(getAbcIt()));
+    public void testListAndHasContentDOW() throws Exception {
+        addToDataModel("it", getDOW300().wrap(getAbcIt()));
         assertErrorContains(FTL_LIST_AND_HAS_CONTENT, "can be listed only once");
     }
 
     @Test
-    public void testListAndHasContentDOW2323() throws Exception {
-        addToDataModel("it", getDOW2323().wrap(getAbcIt()));
-        assertErrorContains(FTL_LIST_AND_HAS_CONTENT, "can be listed only once");
-    }
-
-    @Test
-    public void testListAndHasContentBW230() throws Exception {
-        addToDataModel("it", getBW230().wrap(getAbcIt()));
-        assertOutput(FTL_LIST_AND_HAS_CONTENT, OUT_LIST_AND_HAS_CONTENT_BW_WRONG);
-    }
-
-    @Test
-    public void testListAndHasContentBW2323() throws Exception {
-        addToDataModel("it", getBW2323().wrap(getAbcIt()));
-        assertOutput(FTL_LIST_AND_HAS_CONTENT, OUT_LIST_AND_HAS_CONTENT_BW_WRONG);
-    }
-
-    @Test
-    public void testListAndHasContentBW2324() throws Exception {
-        addToDataModel("it", getBW2324().wrap(getAbcIt()));
+    public void testListAndHasContentBW() throws Exception {
+        addToDataModel("it", getBW300().wrap(getAbcIt()));
         assertOutput(FTL_LIST_AND_HAS_CONTENT, OUT_LIST_AND_HAS_CONTENT_BW_GOOD);
     }
     
@@ -124,24 +78,12 @@ public class IteratorIssuesTest extends TemplateTest {
         return Arrays.asList(new String[] {  }).iterator();
     }
     
-    private DefaultObjectWrapper getDOW230() {
-        return new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_0).build();
-    }
-    
-    private DefaultObjectWrapper getDOW2323() {
-        return new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_23).build();
-    }
-
-    private BeansWrapper getBW230() {
-        return new BeansWrapperBuilder(Configuration.VERSION_2_3_0).build();
-    }
-
-    private BeansWrapper getBW2323() {
-        return new BeansWrapperBuilder(Configuration.VERSION_2_3_23).build();
+    private DefaultObjectWrapper getDOW300() {
+        return new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0).build();
     }
 
-    private BeansWrapper getBW2324() {
-        return new BeansWrapperBuilder(Configuration.VERSION_2_3_24).build();
+    private BeansWrapper getBW300() {
+        return new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
     }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/NumberFormatTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/NumberFormatTest.java b/src/test/java/org/apache/freemarker/core/ast/NumberFormatTest.java
index 3699d83..12da0cd 100644
--- a/src/test/java/org/apache/freemarker/core/ast/NumberFormatTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/NumberFormatTest.java
@@ -18,8 +18,11 @@
  */
 package org.apache.freemarker.core.ast;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
 
 import java.io.IOException;
 import java.math.BigDecimal;
@@ -31,12 +34,6 @@ import java.util.Map;
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.ast.AliasTemplateNumberFormatFactory;
-import org.apache.freemarker.core.ast.Environment;
-import org.apache.freemarker.core.ast.TemplateConfiguration;
-import org.apache.freemarker.core.ast.TemplateNumberFormat;
-import org.apache.freemarker.core.ast.TemplateNumberFormatFactory;
-import org.apache.freemarker.core.ast.UndefinedCustomFormatException;
 import org.apache.freemarker.core.model.TemplateDirectiveBody;
 import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateModel;
@@ -57,7 +54,6 @@ public class NumberFormatTest extends TemplateTest {
     @Before
     public void setup() {
         Configuration cfg = getConfiguration();
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_24);
         cfg.setLocale(Locale.US);
         
         cfg.setCustomNumberFormats(ImmutableMap.of(
@@ -216,22 +212,17 @@ public class NumberFormatTest extends TemplateTest {
     }
     
     @Test
-    public void testIcIAndEscaping() throws Exception {
+    public void testAtPrefix() throws Exception {
         Configuration cfg = getConfiguration();
-        testIcIAndEscapingWhenCustFormsAccepted(cfg);
         
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_23);
-        testIcIAndEscapingWhenCustFormsAccepted(cfg);
-        
-        cfg.setCustomNumberFormats(Collections.<String, TemplateNumberFormatFactory>emptyMap());
         cfg.setNumberFormat("@hex");
-        assertOutput("${10}", "@hex10");
+        assertOutput("${10}", "a");
         cfg.setNumberFormat("'@'0");
         assertOutput("${10}", "@10");
         cfg.setNumberFormat("@@0");
         assertOutput("${10}", "@@10");
         
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_24);
+        cfg.setCustomNumberFormats(Collections.<String, TemplateNumberFormatFactory>emptyMap());
         cfg.setNumberFormat("@hex");
         assertErrorContains("${10}", "custom", "\"hex\"");
         cfg.setNumberFormat("'@'0");
@@ -240,15 +231,6 @@ public class NumberFormatTest extends TemplateTest {
         assertOutput("${10}", "@@10");
     }
 
-    protected void testIcIAndEscapingWhenCustFormsAccepted(Configuration cfg) throws IOException, TemplateException {
-        cfg.setNumberFormat("@hex");
-        assertOutput("${10}", "a");
-        cfg.setNumberFormat("'@'0");
-        assertOutput("${10}", "@10");
-        cfg.setNumberFormat("@@0");
-        assertOutput("${10}", "@@10");
-    }
-
     @Test
     public void testAlieses() throws Exception {
         Configuration cfg = getConfiguration();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java b/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java
index 14d6a33..c041623 100644
--- a/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java
@@ -376,9 +376,9 @@ public class ObjectBuilderSettingsTest {
     @Test
     public void beansWrapperTest() throws Exception {
         BeansWrapper bw = (BeansWrapper) _ObjectBuilderSettingEvaluator.eval(
-                "BeansWrapper(2.3.21, simpleMapWrapper=true, exposeFields=true)",
+                "BeansWrapper(3.0.0, simpleMapWrapper=true, exposeFields=true)",
                 ObjectWrapper.class, false, _SettingEvaluationEnvironment.getCurrent());
-        assertEquals(Configuration.VERSION_2_3_21, bw.getIncompatibleImprovements());
+        assertEquals(Configuration.VERSION_3_0_0, bw.getIncompatibleImprovements());
         assertTrue(bw.isSimpleMapWrapper());
         assertTrue(bw.isExposeFields());
     }
@@ -386,19 +386,20 @@ public class ObjectBuilderSettingsTest {
     @Test
     public void defaultObjectWrapperTest() throws Exception {
         DefaultObjectWrapper bw = (DefaultObjectWrapper) _ObjectBuilderSettingEvaluator.eval(
-                "DefaultObjectWrapper(2.3.21)",
+                "DefaultObjectWrapper(3.0.0)",
                 ObjectWrapper.class, false, _SettingEvaluationEnvironment.getCurrent());
-        assertEquals(Configuration.VERSION_2_3_21, bw.getIncompatibleImprovements());
+        assertEquals(Configuration.VERSION_3_0_0, bw.getIncompatibleImprovements());
         assertFalse(bw.isExposeFields());
     }
 
     @Test
     public void configurationPropertiesTest() throws TemplateException {
-        final Configuration cfg = new Configuration();
+        final Configuration cfg = new Configuration(Configuration.getVersion());
         
         {
             Properties props = new Properties();
-            props.setProperty(Configurable.OBJECT_WRAPPER_KEY, "org.apache.freemarker.core.model.impl.beans.BeansWrapper(2.3.21)");
+            props.setProperty(Configurable.OBJECT_WRAPPER_KEY,
+                    "org.apache.freemarker.core.model.impl.beans.BeansWrapper(3.0.0)");
             props.setProperty(Configurable.ARITHMETIC_ENGINE_KEY,
                     "org.apache.freemarker.core.ast.ObjectBuilderSettingsTest$DummyArithmeticEngine");
             props.setProperty(Configurable.TEMPLATE_EXCEPTION_HANDLER_KEY,
@@ -413,7 +414,8 @@ public class ObjectBuilderSettingsTest {
             cfg.setSettings(props);
             assertEquals(BeansWrapper.class, cfg.getObjectWrapper().getClass());
             assertTrue(((WriteProtectable) cfg.getObjectWrapper()).isWriteProtected());
-            assertEquals(Configuration.VERSION_2_3_21, ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
+            assertEquals(
+                    Configuration.VERSION_3_0_0, ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
             assertEquals(DummyArithmeticEngine.class, cfg.getArithmeticEngine().getClass());
             assertEquals(DummyTemplateExceptionHandler.class, cfg.getTemplateExceptionHandler().getClass());
             assertEquals(DummyCacheStorage.class, cfg.getCacheStorage().getClass());
@@ -438,7 +440,8 @@ public class ObjectBuilderSettingsTest {
             assertTrue(((WriteProtectable) cfg.getObjectWrapper()).isWriteProtected());
             assertEquals(1, ((DummyArithmeticEngine) cfg.getArithmeticEngine()).getX());
             assertEquals(1, ((DummyTemplateExceptionHandler) cfg.getTemplateExceptionHandler()).getX());
-            assertEquals(Configuration.VERSION_2_3_0, ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0,
+                    ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
             assertEquals(500, ((MruCacheStorage) cfg.getCacheStorage()).getSoftSizeLimit());
             assertEquals(TemplateClassResolver.ALLOWS_NOTHING_RESOLVER, cfg.getNewBuiltinClassResolver());
             assertEquals("utf-8", cfg.getDefaultEncoding());
@@ -454,33 +457,41 @@ public class ObjectBuilderSettingsTest {
             assertSame(ArithmeticEngine.BIGDECIMAL_ENGINE, cfg.getArithmeticEngine());
             assertSame(TemplateExceptionHandler.RETHROW_HANDLER, cfg.getTemplateExceptionHandler());
             assertTrue(((WriteProtectable) cfg.getObjectWrapper()).isWriteProtected());
-            assertEquals(Configuration.VERSION_2_3_0, ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0,
+                    ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
         }
 
         {
             Properties props = new Properties();
-            props.setProperty(Configurable.OBJECT_WRAPPER_KEY, "org.apache.freemarker.core.model.impl.beans.BeansWrapper");
+            props.setProperty(
+                    Configurable.OBJECT_WRAPPER_KEY,
+                    "org.apache.freemarker.core.model.impl.beans.BeansWrapper");
             cfg.setSettings(props);
             assertEquals(BeansWrapper.class, cfg.getObjectWrapper().getClass());
             assertFalse(((WriteProtectable) cfg.getObjectWrapper()).isWriteProtected());
-            assertEquals(Configuration.VERSION_2_3_0, ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0,
+                    ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
         }
         
         {
             Properties props = new Properties();
-            props.setProperty(Configurable.OBJECT_WRAPPER_KEY, "DefaultObjectWrapper(2.3.19)");
+            props.setProperty(Configurable.OBJECT_WRAPPER_KEY, "DefaultObjectWrapper(3.0.0)");
             cfg.setSettings(props);
             assertEquals(DefaultObjectWrapper.class, cfg.getObjectWrapper().getClass());
             assertTrue(((WriteProtectable) cfg.getObjectWrapper()).isWriteProtected());
-            assertEquals(Configuration.VERSION_2_3_0, ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
+            assertEquals(
+                    Configuration.VERSION_3_0_0,
+                    ((BeansWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
         }
     }
     
     @Test
-    public void timeZoneTest() throws _ObjectBuilderSettingEvaluationException, ClassNotFoundException, InstantiationException, IllegalAccessException {
+    public void timeZoneTest() throws _ObjectBuilderSettingEvaluationException, ClassNotFoundException,
+    InstantiationException, IllegalAccessException {
         for (String timeZoneId : new String[] { "GMT+01", "GMT", "UTC" }) {
             TestBean8 result = (TestBean8) _ObjectBuilderSettingEvaluator.eval(
-                    "org.apache.freemarker.core.ast.ObjectBuilderSettingsTest$TestBean8(timeZone=TimeZone('" + timeZoneId + "'))",
+                    "org.apache.freemarker.core.ast.ObjectBuilderSettingsTest$TestBean8(timeZone=TimeZone('"
+                    + timeZoneId + "'))",
                     TestBean8.class, false, new _SettingEvaluationEnvironment());
             assertEquals(TimeZone.getTimeZone(timeZoneId), result.getTimeZone());
         }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/OutputFormatTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/OutputFormatTest.java b/src/test/java/org/apache/freemarker/core/ast/OutputFormatTest.java
index 74401ac..18d3ca0 100644
--- a/src/test/java/org/apache/freemarker/core/ast/OutputFormatTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/OutputFormatTest.java
@@ -18,7 +18,10 @@
  */
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.io.StringWriter;
@@ -28,16 +31,6 @@ import java.util.Collections;
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core.ast.HTMLOutputFormat;
-import org.apache.freemarker.core.ast.InvalidReferenceException;
-import org.apache.freemarker.core.ast.OutputFormat;
-import org.apache.freemarker.core.ast.ParseException;
-import org.apache.freemarker.core.ast.PlainTextOutputFormat;
-import org.apache.freemarker.core.ast.RTFOutputFormat;
-import org.apache.freemarker.core.ast.TemplateConfiguration;
-import org.apache.freemarker.core.ast.UndefinedOutputFormat;
-import org.apache.freemarker.core.ast.XMLOutputFormat;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.templateresolver.ConditionalTemplateConfigurationFactory;
 import org.apache.freemarker.core.templateresolver.FileNameGlobMatcher;
@@ -100,7 +93,7 @@ public class OutputFormatTest extends TemplateTest {
         addTemplate("tWithHeader.ftlx", "<#ftl outputFormat='HTML'>" + commonContent);
         
         Configuration cfg = getConfiguration();
-        for (int setupNumber = 1; setupNumber <= 5; setupNumber++) {
+        for (int setupNumber = 1; setupNumber <= 3; setupNumber++) {
             final OutputFormat cfgOutputFormat;
             final OutputFormat ftlhOutputFormat;
             final OutputFormat ftlxOutputFormat;
@@ -131,18 +124,6 @@ public class OutputFormatTest extends TemplateTest {
                 ftlhOutputFormat = HTMLOutputFormat.INSTANCE; // can't be overidden
                 ftlxOutputFormat = XMLOutputFormat.INSTANCE;
                 break;
-            case 4:
-                cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_23);
-                cfgOutputFormat = UndefinedOutputFormat.INSTANCE;
-                ftlhOutputFormat = XMLOutputFormat.INSTANCE; // now gets overidden
-                ftlxOutputFormat = UndefinedOutputFormat.INSTANCE;
-                break;
-            case 5:
-                cfg.setTemplateConfigurations(null);
-                cfgOutputFormat = UndefinedOutputFormat.INSTANCE;
-                ftlhOutputFormat = UndefinedOutputFormat.INSTANCE;
-                ftlxOutputFormat = UndefinedOutputFormat.INSTANCE;
-                break;
             default:
                 throw new AssertionError();
             }
@@ -210,7 +191,7 @@ public class OutputFormatTest extends TemplateTest {
         
         cfg.setTemplateConfigurations(null);
         cfg.unsetOutputFormat();
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_23);  // Extensions has no effect
+        cfg.setRecognizeStandardFileExtensions(false);
         assertErrorContainsForNamed("t.ftlx", UndefinedOutputFormat.INSTANCE.getName());
         cfg.setOutputFormat(HTMLOutputFormat.INSTANCE);
         assertOutputForNamed("t.ftlx", "&#39; &#39; '");
@@ -229,7 +210,6 @@ public class OutputFormatTest extends TemplateTest {
         
         cfg.setTemplateConfigurations(null);
         cfg.unsetOutputFormat();
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_24);
         cfg.setTemplateConfigurations(tcfHTML);
         assertOutputForNamed("t.ftlx", "&apos; &apos; '");  // Can't override it
         cfg.setRecognizeStandardFileExtensions(false);
@@ -261,15 +241,6 @@ public class OutputFormatTest extends TemplateTest {
             t.process(null, out);
             assertEquals("&#39;", out.toString());
         }
-        
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_23);
-        {
-            Template t = new Template("foo.ftlx", commonFTL, cfg);
-            assertSame(UndefinedOutputFormat.INSTANCE, t.getOutputFormat());
-            StringWriter out = new StringWriter();
-            t.process(null, out);
-            assertEquals("'", out.toString());
-        }
     }
     
     @Test
@@ -907,21 +878,19 @@ public class OutputFormatTest extends TemplateTest {
     @Test
     public void testBannedBIsWhenAutoEscaping() throws Exception {
         for (String biName : new String[] { "html", "xhtml", "rtf", "xml" }) {
-            for (Version ici : new Version[] { Configuration.VERSION_2_3_0, Configuration.VERSION_2_3_24 }) {
-                getConfiguration().setIncompatibleImprovements(ici);
-                
-                String commonFTL = "${'x'?" + biName + "}";
-                assertOutput(commonFTL, "x");
-                assertErrorContains("<#ftl outputFormat='HTML'>" + commonFTL,
-                        "?" + biName, "HTML", "double-escaping");
-                assertErrorContains("<#ftl outputFormat='HTML'>${'${\"x\"?" + biName + "}'}",
-                        "?" + biName, "HTML", "double-escaping");
-                assertOutput("<#ftl outputFormat='plainText'>" + commonFTL, "x");
-                assertOutput("<#ftl outputFormat='HTML' autoEsc=false>" + commonFTL, "x");
-                assertOutput("<#ftl outputFormat='HTML'><#noAutoEsc>" + commonFTL + "</#noAutoEsc>", "x");
-                assertOutput("<#ftl outputFormat='HTML'><#outputFormat 'plainText'>" + commonFTL + "</#outputFormat>",
-                        "x");
-            }
+            getConfiguration().setIncompatibleImprovements(Configuration.VERSION_3_0_0);
+            
+            String commonFTL = "${'x'?" + biName + "}";
+            assertOutput(commonFTL, "x");
+            assertErrorContains("<#ftl outputFormat='HTML'>" + commonFTL,
+                    "?" + biName, "HTML", "double-escaping");
+            assertErrorContains("<#ftl outputFormat='HTML'>${'${\"x\"?" + biName + "}'}",
+                    "?" + biName, "HTML", "double-escaping");
+            assertOutput("<#ftl outputFormat='plainText'>" + commonFTL, "x");
+            assertOutput("<#ftl outputFormat='HTML' autoEsc=false>" + commonFTL, "x");
+            assertOutput("<#ftl outputFormat='HTML'><#noAutoEsc>" + commonFTL + "</#noAutoEsc>", "x");
+            assertOutput("<#ftl outputFormat='HTML'><#outputFormat 'plainText'>" + commonFTL + "</#outputFormat>",
+                    "x");
         }
     }
 
@@ -1033,7 +1002,7 @@ public class OutputFormatTest extends TemplateTest {
     
     @Override
     protected Configuration createConfiguration() throws TemplateModelException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_24);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         TemplateConfiguration xmlTC = new TemplateConfiguration();
         xmlTC.setOutputFormat(XMLOutputFormat.INSTANCE);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/ParsingErrorMessagesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/ParsingErrorMessagesTest.java b/src/test/java/org/apache/freemarker/core/ast/ParsingErrorMessagesTest.java
index 916ca6b..a46b768 100644
--- a/src/test/java/org/apache/freemarker/core/ast/ParsingErrorMessagesTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/ParsingErrorMessagesTest.java
@@ -19,19 +19,18 @@
 
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
-import org.apache.freemarker.core.ast.ParseException;
 import org.apache.freemarker.core.util._StringUtil;
 import org.junit.Test;
 
 public class ParsingErrorMessagesTest {
 
-    private Configuration cfg = new Configuration(Configuration.VERSION_2_3_21);
+    private Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
     {
         cfg.setTagSyntax(Configuration.AUTO_DETECT_TAG_SYNTAX);
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/SQLTimeZoneTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/SQLTimeZoneTest.java b/src/test/java/org/apache/freemarker/core/ast/SQLTimeZoneTest.java
index 0b15523..e8525ff 100644
--- a/src/test/java/org/apache/freemarker/core/ast/SQLTimeZoneTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/SQLTimeZoneTest.java
@@ -19,7 +19,8 @@
 
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 
 import java.sql.Time;
 import java.sql.Timestamp;
@@ -337,7 +338,7 @@ public class SQLTimeZoneTest extends TemplateTest {
     
     @Override
     protected Configuration createConfiguration() {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_21);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setLocale(Locale.US);
         cfg.setDateFormat("yyyy-MM-dd");
         cfg.setTimeFormat("HH:mm:ss");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/SpecialVariableTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/SpecialVariableTest.java b/src/test/java/org/apache/freemarker/core/ast/SpecialVariableTest.java
index 828725f..b3fb79c 100644
--- a/src/test/java/org/apache/freemarker/core/ast/SpecialVariableTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/SpecialVariableTest.java
@@ -19,15 +19,11 @@
 
 package org.apache.freemarker.core.ast;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.junit.Assert.assertThat;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core.ast.BuiltinVariable;
-import org.apache.freemarker.core.ast.HTMLOutputFormat;
-import org.apache.freemarker.core.ast.PlainTextOutputFormat;
-import org.apache.freemarker.core.ast.UndefinedOutputFormat;
 import org.apache.freemarker.test.TemplateTest;
 import org.junit.Test;
 
@@ -56,7 +52,7 @@ public class SpecialVariableTest extends TemplateTest {
                 "${.incompatibleImprovements}",
                 getConfiguration().getIncompatibleImprovements().toString());
         
-        getConfiguration().setIncompatibleImprovements(new Version(2, 3, 23));
+        getConfiguration().setIncompatibleImprovements(new Version(3, 0, 0));
         assertOutput(
                 "${.incompatible_improvements}",
                 getConfiguration().getIncompatibleImprovements().toString());

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/StringLiteralInterpolationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/StringLiteralInterpolationTest.java b/src/test/java/org/apache/freemarker/core/ast/StringLiteralInterpolationTest.java
index 00e29f2..37dbc0f 100644
--- a/src/test/java/org/apache/freemarker/core/ast/StringLiteralInterpolationTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/StringLiteralInterpolationTest.java
@@ -23,8 +23,6 @@ import java.util.Collections;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.ast.InvalidReferenceException;
-import org.apache.freemarker.core.ast.RTFOutputFormat;
 import org.apache.freemarker.test.TemplateTest;
 import org.junit.Test;
 
@@ -89,6 +87,8 @@ public class StringLiteralInterpolationTest extends TemplateTest {
         assertOutput("<#escape x as x?html><#assign x = '&'>${x} ${'${x}'}</#escape> ${x}", "&amp; &amp; &");
     }
     
+    // We couldn't test this on 3.0.0, as nothing was fixed there with IcI yet
+    /*-
     @Test
     public void iciInheritanceBugFixed() throws Exception {
         // Broken behavior emulated:
@@ -99,6 +99,7 @@ public class StringLiteralInterpolationTest extends TemplateTest {
         getConfiguration().setIncompatibleImprovements(Configuration.VERSION_2_3_24);
         assertOutput("${'&\\''?html} ${\"${'&\\\\\\''?html}\"}", "&amp;&#39; &amp;&#39;");
     }
+    */
     
     @Test
     public void markup() throws IOException, TemplateException {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/TabSizeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/TabSizeTest.java b/src/test/java/org/apache/freemarker/core/ast/TabSizeTest.java
index b42215c..ea33054 100644
--- a/src/test/java/org/apache/freemarker/core/ast/TabSizeTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/TabSizeTest.java
@@ -18,14 +18,14 @@
  */
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateNotFoundException;
-import org.apache.freemarker.core.ast.ParseException;
 import org.apache.freemarker.core.templateresolver.MalformedTemplateNameException;
 import org.apache.freemarker.test.TemplateTest;
 import org.junit.Test;
@@ -35,7 +35,6 @@ public class TabSizeTest extends TemplateTest {
     @Override
     protected Configuration createConfiguration() throws Exception {
         Configuration cfg = super.createConfiguration();
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_22);
         return cfg;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/TagSyntaxVariationsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/TagSyntaxVariationsTest.java b/src/test/java/org/apache/freemarker/core/ast/TagSyntaxVariationsTest.java
index bb1b1aa..2f0e1d9 100644
--- a/src/test/java/org/apache/freemarker/core/ast/TagSyntaxVariationsTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/TagSyntaxVariationsTest.java
@@ -26,7 +26,6 @@ import java.io.StringWriter;
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.ast.ParseException;
 import org.apache.freemarker.core.util._StringUtil;
 
 import junit.framework.TestCase;
@@ -63,13 +62,7 @@ public class TagSyntaxVariationsTest extends TestCase {
 
     public final void test()
             throws TemplateException, IOException {
-        Configuration cfgBuggy = new Configuration();
-        // Default on 2.3.x: cfgBuggy.setEmulate23ParserBugs(true);
-        // Default on 2.3.x: cfgBuggy.setTagSyntax(Configuration.ANGLE_BRACKET_TAG_SYNTAX);
-        
-        Configuration cfgFixed = new Configuration();
-        cfgFixed.setIncompatibleImprovements(Configuration.VERSION_2_3_19);
-        // Default on 2.3.x: cfgFixed.setTagSyntax(Configuration.ANGLE_BRACKET_TAG_SYNTAX);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
         // Permutations 
         for (int ifOrAssign = 0; ifOrAssign < 2; ifOrAssign++) {
@@ -79,10 +72,7 @@ public class TagSyntaxVariationsTest extends TestCase {
             
             // Permutations 
             for (int angOrSqu = 0; angOrSqu < 2; angOrSqu++) {
-                cfgBuggy.setTagSyntax(angOrSqu == 0
-                        ? Configuration.ANGLE_BRACKET_TAG_SYNTAX
-                        : Configuration.SQUARE_BRACKET_TAG_SYNTAX);
-                cfgFixed.setTagSyntax(angOrSqu == 0
+                cfg.setTagSyntax(angOrSqu == 0
                         ? Configuration.ANGLE_BRACKET_TAG_SYNTAX
                         : Configuration.SQUARE_BRACKET_TAG_SYNTAX);
                 
@@ -92,10 +82,7 @@ public class TagSyntaxVariationsTest extends TestCase {
                 String wrong_xxx = angOrSqu == 0 ? WRONG_ANG : WRONG_SQU;
                 String wrongc_xxx = angOrSqu == 0 ? WRONGC_ANG : WRONGC_SQU;
                 
-                test(cfgBuggy,
-                        dir_xxx + cust_xxx,
-                        dir_out + CUST_OUT);
-                test(cfgFixed,
+                test(cfg,
                         dir_xxx + cust_xxx,
                         dir_out + CUST_OUT);
                 
@@ -103,61 +90,33 @@ public class TagSyntaxVariationsTest extends TestCase {
                 for (int wrongOrWrongc = 0; wrongOrWrongc < 2; wrongOrWrongc++) {
                     String wrongx_xxx = wrongOrWrongc == 0 ? wrong_xxx : wrongc_xxx;
                     
-                    // Bug: initial unknown # tags are treated as static text
-                    test(cfgBuggy,
-                            wrongx_xxx + dir_xxx,
-                            wrongx_xxx + dir_out);
-                    test(cfgFixed,
+                    test(cfg,
                             wrongx_xxx + dir_xxx,
                             null);
     
-                    // Bug: same as above
-                    test(cfgBuggy,
-                            wrongx_xxx + wrongx_xxx + dir_xxx,
-                            wrongx_xxx + wrongx_xxx + dir_out);
-                    
-                    test(cfgBuggy,
-                            dir_xxx + wrongx_xxx,
-                            null);
-                    test(cfgFixed,
+                    test(cfg,
                             dir_xxx + wrongx_xxx,
                             null);
                     
-                    test(cfgBuggy,
-                            hdr_xxx + wrongx_xxx,
-                            null);
-                    test(cfgFixed,
+                    test(cfg,
                             hdr_xxx + wrongx_xxx,
                             null);
                     
-                    test(cfgBuggy,
-                            cust_xxx + wrongx_xxx + dir_xxx,
-                            null);
-                    test(cfgFixed,
+                    test(cfg,
                             cust_xxx + wrongx_xxx + dir_xxx,
                             null);
                 } // for wrongc
             } // for squ
             
-            cfgBuggy.setTagSyntax(Configuration.AUTO_DETECT_TAG_SYNTAX);
-            cfgFixed.setTagSyntax(Configuration.AUTO_DETECT_TAG_SYNTAX);
+            cfg.setTagSyntax(Configuration.AUTO_DETECT_TAG_SYNTAX);
             for (int perm = 0; perm < 4; perm++) {
                 // All 4 permutations
                 String wrong_xxx = (perm & 1) == 0 ? WRONG_ANG : WRONG_SQU;
                 String dir_xxx = (perm & 2) == 0 ? dir_ang : dir_squ;
                 
-                // Bug: Auto-detection ignores unknown # tags
-                test(cfgBuggy,
-                        wrong_xxx + dir_xxx,
-                        wrong_xxx + dir_out);
-                test(cfgFixed,
+                test(cfg,
                         wrong_xxx + dir_xxx,
                         null);
-                
-                // Bug: same as above
-                test(cfgBuggy,
-                        wrong_xxx + wrong_xxx + dir_xxx,
-                        wrong_xxx + wrong_xxx + dir_out);
             } // for perm
     
             // Permutations 
@@ -168,38 +127,23 @@ public class TagSyntaxVariationsTest extends TestCase {
                 String dir_xxx = angOrSquStart == 0 ? dir_ang : dir_squ;
                 String dir_yyy = angOrSquStart != 0 ? dir_ang : dir_squ;
                 
-                test(cfgBuggy,
-                        cust_xxx + wrong_yyy + dir_xxx,
-                        CUST_OUT + wrong_yyy + dir_out);
-                test(cfgFixed,
+                test(cfg,
                         cust_xxx + wrong_yyy + dir_xxx,
                         CUST_OUT + wrong_yyy + dir_out);
                 
-                test(cfgBuggy,
-                        hdr_xxx + wrong_yyy + dir_xxx,
-                        wrong_yyy + dir_out);
-                test(cfgFixed,
+                test(cfg,
                         hdr_xxx + wrong_yyy + dir_xxx,
                         wrong_yyy + dir_out);
                 
-                test(cfgBuggy,
-                        cust_xxx + wrong_yyy + dir_yyy,
-                        CUST_OUT + wrong_yyy + dir_yyy);
-                test(cfgFixed,
+                test(cfg,
                         cust_xxx + wrong_yyy + dir_yyy,
                         CUST_OUT + wrong_yyy + dir_yyy);
                 
-                test(cfgBuggy,
-                        hdr_xxx + wrong_yyy + dir_yyy,
-                        wrong_yyy + dir_yyy);
-                test(cfgFixed,
+                test(cfg,
                         hdr_xxx + wrong_yyy + dir_yyy,
                         wrong_yyy + dir_yyy);
                 
-                test(cfgBuggy,
-                        dir_xxx + wrong_yyy + dir_yyy,
-                        dir_out + wrong_yyy + dir_yyy);
-                test(cfgFixed,
+                test(cfg,
                         dir_xxx + wrong_yyy + dir_yyy,
                         dir_out + wrong_yyy + dir_yyy);
             } // for squStart

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/TemplatGetEncodingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/TemplatGetEncodingTest.java b/src/test/java/org/apache/freemarker/core/ast/TemplatGetEncodingTest.java
index af001c9..e2af001 100644
--- a/src/test/java/org/apache/freemarker/core/ast/TemplatGetEncodingTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/TemplatGetEncodingTest.java
@@ -29,7 +29,6 @@ import java.nio.charset.StandardCharsets;
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateNotFoundException;
-import org.apache.freemarker.core.ast.ParseException;
 import org.apache.freemarker.core.templateresolver.MalformedTemplateNameException;
 import org.apache.freemarker.core.templateresolver.impl.ByteArrayTemplateLoader;
 import org.apache.freemarker.core.templateresolver.impl.StrongCacheStorage;
@@ -39,7 +38,7 @@ public class TemplatGetEncodingTest {
 
     @Test
     public void test() throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         {
             cfg.setDefaultEncoding("ISO-8859-2");
             ByteArrayTemplateLoader tl = new ByteArrayTemplateLoader();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationTest.java b/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationTest.java
index 2e41f21..6e222fc 100644
--- a/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationTest.java
@@ -103,7 +103,7 @@ public class TemplateConfigurationTest {
         }
     }
 
-    private static final Version ICI = Configuration.VERSION_2_3_22;
+    private static final Version ICI = Configuration.VERSION_3_0_0;
 
     private static final Configuration DEFAULT_CFG = new Configuration(ICI);
     static {
@@ -168,7 +168,7 @@ public class TemplateConfigurationTest {
         SETTING_ASSIGNMENTS.put("dateFormat", "yyyy-#DDD");
         SETTING_ASSIGNMENTS.put("dateTimeFormat", "yyyy-#DDD-@HH:mm");
         SETTING_ASSIGNMENTS.put("locale", NON_DEFAULT_LOCALE);
-        SETTING_ASSIGNMENTS.put("logTemplateExceptions", false);
+        SETTING_ASSIGNMENTS.put("logTemplateExceptions", true);
         SETTING_ASSIGNMENTS.put("newBuiltinClassResolver", TemplateClassResolver.ALLOWS_NOTHING_RESOLVER);
         SETTING_ASSIGNMENTS.put("numberFormat", "0.0000");
         SETTING_ASSIGNMENTS.put("objectWrapper", new SimpleObjectWrapper(ICI));
@@ -190,7 +190,7 @@ public class TemplateConfigurationTest {
         SETTING_ASSIGNMENTS.put("strictSyntaxMode", false);
         SETTING_ASSIGNMENTS.put("autoEscapingPolicy", Configuration.DISABLE_AUTO_ESCAPING_POLICY);
         SETTING_ASSIGNMENTS.put("outputFormat", HTMLOutputFormat.INSTANCE);
-        SETTING_ASSIGNMENTS.put("recognizeStandardFileExtensions", true);
+        SETTING_ASSIGNMENTS.put("recognizeStandardFileExtensions", false);
         SETTING_ASSIGNMENTS.put("tabSize", 1);
         SETTING_ASSIGNMENTS.put("lazyImports", Boolean.TRUE);
         SETTING_ASSIGNMENTS.put("lazyAutoImports", Boolean.FALSE);
@@ -489,7 +489,7 @@ public class TemplateConfigurationTest {
     
     @Test
     public void applyOrder() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_25);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         Template t = new Template(null, "", cfg);
         
         {
@@ -552,7 +552,7 @@ public class TemplateConfigurationTest {
     
     @Test
     public void testConfigureCustomAttributes() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setCustomAttribute("k1", "c");
         cfg.setCustomAttribute("k2", "c");
         cfg.setCustomAttribute("k3", "c");
@@ -648,24 +648,26 @@ public class TemplateConfigurationTest {
         
         {
             TemplateConfiguration tc = new TemplateConfiguration();
+            /* Can't test this now, as the only valid value is 3.0.0. [FM3.0.1]
             tc.setParentConfiguration(new Configuration(new Version(2, 3, 0)));
             assertOutputWithoutAndWithTC(tc, "<#foo>", null, "<#foo>");
+            */
             testedProps.add(Configuration.INCOMPATIBLE_IMPROVEMENTS_KEY_CAMEL_CASE);
         }
 
         {
             TemplateConfiguration tc = new TemplateConfiguration();
-            tc.setParentConfiguration(new Configuration(new Version(2, 3, 0)));
-            tc.setRecognizeStandardFileExtensions(true);
-            assertOutputWithoutAndWithTC(tc, "${.outputFormat}",
-                    UndefinedOutputFormat.INSTANCE.getName(), HTMLOutputFormat.INSTANCE.getName());
+            tc.setParentConfiguration(DEFAULT_CFG);
+            tc.setRecognizeStandardFileExtensions(false);
+            assertOutputWithoutAndWithTC(tc, "adhoc.ftlh", "${.outputFormat}",
+                    HTMLOutputFormat.INSTANCE.getName(), UndefinedOutputFormat.INSTANCE.getName());
             testedProps.add(Configuration.RECOGNIZE_STANDARD_FILE_EXTENSIONS_KEY_CAMEL_CASE);
         }
 
         {
             TemplateConfiguration tc = new TemplateConfiguration();
             tc.setLogTemplateExceptions(false);
-            tc.setParentConfiguration(new Configuration(new Version(2, 3, 22)));
+            tc.setParentConfiguration(DEFAULT_CFG);
             tc.setTabSize(3);
             assertOutputWithoutAndWithTC(tc,
                     "<#attempt><@'\\t$\\{1+}'?interpret/><#recover>"
@@ -679,40 +681,6 @@ public class TemplateConfigurationTest {
     }
     
     @Test
-    public void testConfigureParserTooLowIcI() throws Exception {
-        Configuration cfgWithTooLowIcI = new Configuration(Configuration.VERSION_2_3_21);
-        for (PropertyDescriptor propDesc : getTemplateConfigurationSettingPropDescs(true, false)) {
-            TemplateConfiguration tc = new TemplateConfiguration();
-
-            String propName = propDesc.getName();
-            Object value = SETTING_ASSIGNMENTS.get(propName);
-            propDesc.getWriteMethod().invoke(tc, value);
-            
-            boolean shouldFail;
-            if (CONFIGURABLE_PROP_NAMES.contains(propName)) {
-                shouldFail = true;
-            } else if (PARSER_PROP_NAMES.contains(propName)) {
-                shouldFail = false;
-            } else {
-                fail("Uncategorized property: " + propName);
-                return;
-            }
-            
-            try {
-                tc.setParentConfiguration(cfgWithTooLowIcI);
-                if (shouldFail) {
-                    fail("Should fail with property: " + propName);
-                }
-            } catch (IllegalStateException e) {
-                if (!shouldFail) {
-                    throw e;
-                }
-                assertThat(e.getMessage(), containsString("2.3.22"));
-            }
-        }
-    }
-    
-    @Test
     public void testArithmeticEngine() throws TemplateException, IOException {
         TemplateConfiguration tc = new TemplateConfiguration();
         tc.setParentConfiguration(DEFAULT_CFG);
@@ -850,19 +818,29 @@ public class TemplateConfigurationTest {
         
         tc.apply(t);
     }
+
+    private void assertOutputWithoutAndWithTC(
+            TemplateConfiguration tc, String ftl, String expectedDefaultOutput,
+            String expectedConfiguredOutput) throws TemplateException, IOException {
+        assertOutputWithoutAndWithTC(tc, null, ftl, expectedDefaultOutput, expectedConfiguredOutput);
+    }
     
-    private void assertOutputWithoutAndWithTC(TemplateConfiguration tc, String ftl, String expectedDefaultOutput,
+    private void assertOutputWithoutAndWithTC(
+            TemplateConfiguration tc, String templateName, String ftl, String expectedDefaultOutput,
             String expectedConfiguredOutput) throws TemplateException, IOException {
-        assertOutput(null, ftl, expectedDefaultOutput);
-        assertOutput(tc, ftl, expectedConfiguredOutput);
+        if (templateName == null) {
+            templateName = "adhoc.ftl";
+        }
+        assertOutput(null, templateName, ftl, expectedDefaultOutput);
+        assertOutput(tc, templateName, ftl, expectedConfiguredOutput);
     }
 
-    private void assertOutput(TemplateConfiguration tc, String ftl, String expectedConfiguredOutput)
+    private void assertOutput(TemplateConfiguration tc, String templateName, String ftl, String expectedConfiguredOutput)
             throws TemplateException, IOException {
         StringWriter sw = new StringWriter();
         try {
             Configuration cfg = tc != null ? tc.getParentConfiguration() : DEFAULT_CFG;
-            Template t = new Template("adhoc.ftlh", null, new StringReader(ftl), cfg, tc, null);
+            Template t = new Template(templateName, null, new StringReader(ftl), cfg, tc, null);
             if (tc != null) {
                 tc.apply(t);
             }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationWithTemplateResolverTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationWithTemplateResolverTest.java b/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationWithTemplateResolverTest.java
index f6e1df9..0319fab 100644
--- a/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationWithTemplateResolverTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/TemplateConfigurationWithTemplateResolverTest.java
@@ -18,7 +18,8 @@
  */
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 
 import java.io.IOException;
 import java.io.StringWriter;
@@ -28,8 +29,6 @@ import java.util.Locale;
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.ast.CustomAttribute;
-import org.apache.freemarker.core.ast.TemplateConfiguration;
 import org.apache.freemarker.core.templateresolver.ConditionalTemplateConfigurationFactory;
 import org.apache.freemarker.core.templateresolver.FileNameGlobMatcher;
 import org.apache.freemarker.core.templateresolver.FirstMatchTemplateConfigurationFactory;
@@ -112,7 +111,7 @@ public class TemplateConfigurationWithTemplateResolverTest {
 
     @Test
     public void testLocale() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setLocale(Locale.US);
         
         StringTemplateLoader tl = new StringTemplateLoader();
@@ -153,7 +152,7 @@ public class TemplateConfigurationWithTemplateResolverTest {
     @Test
     public void testPlainText() throws Exception {
         Configuration cfg = createCommonEncodingTesterConfig();
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_22);
+        cfg.setIncompatibleImprovements(Configuration.VERSION_3_0_0);
         
         TemplateConfiguration tcDE = new TemplateConfiguration();
         tcDE.setLocale(Locale.GERMANY);
@@ -195,7 +194,7 @@ public class TemplateConfigurationWithTemplateResolverTest {
 
     @Test
     public void testConfigurableSettings() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setLocale(Locale.US);
         
         TemplateConfiguration tcFR = new TemplateConfiguration();
@@ -228,7 +227,7 @@ public class TemplateConfigurationWithTemplateResolverTest {
     
     @Test
     public void testCustomAttributes() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         TemplateConfiguration tc1 = new TemplateConfiguration();
         tc1.setCustomAttribute("a1", "a1tc1");
@@ -297,7 +296,7 @@ public class TemplateConfigurationWithTemplateResolverTest {
     }
 
     private Configuration createCommonEncodingTesterConfig() throws UnsupportedEncodingException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setDefaultEncoding("iso-8859-1");
         cfg.setLocale(Locale.US);
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/TemplateLevelSettings.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/TemplateLevelSettings.java b/src/test/java/org/apache/freemarker/core/ast/TemplateLevelSettings.java
index 7794041..b651f41 100644
--- a/src/test/java/org/apache/freemarker/core/ast/TemplateLevelSettings.java
+++ b/src/test/java/org/apache/freemarker/core/ast/TemplateLevelSettings.java
@@ -19,7 +19,7 @@
 
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 import java.io.StringWriter;
@@ -57,33 +57,26 @@ public class TemplateLevelSettings {
     @Test
     public void test() throws IOException, TemplateException {
         assertOutputs(
-                "M[inc:INC]MM[impM1:M{M}M[impM2:M{IMP}M]M]M[incM:M{M}M]M",
                 "M[inc:M]MM[impM1:M{M}M[impM2:M{M}M]M]M[incM:M{M}M]M",
                 "M,m", "INC,inc", "IMP,imp");
         assertOutputs(
-                "C[inc:INC]CC[impM1:C{C}C[impM2:C{IMP}C]C]C[incM:C{C}C]C",
                 "C[inc:C]CC[impM1:C{C}C[impM2:C{C}C]C]C[incM:C{C}C]C",
                 null, "INC,inc", "IMP,imp");
         assertOutputs(
-                "M[inc:C]MM[impM1:M{M}M[impM2:M{IMP}M]M]M[incM:M{M}M]M",
                 "M[inc:M]MM[impM1:M{M}M[impM2:M{M}M]M]M[incM:M{M}M]M",
                 "M,m", null, "IMP,imp");
         assertOutputs(
-                "M[inc:INC]MM[impM1:M{M}M[impM2:M{C}M]M]M[incM:M{M}M]M",
                 "M[inc:M]MM[impM1:M{M}M[impM2:M{M}M]M]M[incM:M{M}M]M",
                 "M,m", "INC,inc", null);
     }
 
     private void assertOutputs(
-            String legacyOutput, String fixedOutput,
+            String expectedOutput,
             String mainBoolFmt, String incBoolFmt, String impBoolFtm)
             throws IOException, TemplateException {
         assertEquals(
-                legacyOutput,
-                renderWith(Configuration.VERSION_2_3_21, mainBoolFmt, incBoolFmt, impBoolFtm));
-        assertEquals(
-                fixedOutput,
-                renderWith(Configuration.VERSION_2_3_22, mainBoolFmt, incBoolFmt, impBoolFtm));
+                expectedOutput,
+                renderWith(Configuration.VERSION_3_0_0, mainBoolFmt, incBoolFmt, impBoolFtm));
     }
     
     private String renderWith(Version version, String mainBoolFmt, String incBoolFmt, String impBoolFtm)

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java b/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java
index 49b7ca8..d5575aa 100644
--- a/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/TemplateNameSpecialVariablesTest.java
@@ -23,7 +23,6 @@ import java.io.IOException;
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.templateresolver.TemplateLoader;
 import org.apache.freemarker.core.templateresolver.impl.StringTemplateLoader;
 import org.apache.freemarker.core.util._StringUtil;
@@ -33,9 +32,6 @@ import org.junit.Test;
 
 public class TemplateNameSpecialVariablesTest extends TemplateTest {
     
-    private static final Version[] BREAK_POINT_VERSIONS = new Version[] {
-            Configuration.VERSION_2_3_0, Configuration.VERSION_2_3_22, Configuration.VERSION_2_3_23 };
-
     private static TemplateLoader createTemplateLoader(String specVar) {
         StringTemplateLoader tl = new StringTemplateLoader();
         tl.putTemplate("main.ftl",
@@ -84,67 +80,18 @@ public class TemplateNameSpecialVariablesTest extends TemplateTest {
             = "t=${.templateName}, ct=${.currentTemplateName!'-'}, mt=${.mainTemplateName!'-'}";
     
     @Test
-    public void testTemplateName230() throws IOException, TemplateException {
-        getConfiguration().setTemplateLoader(createTemplateLoader(".templateName"));
-        getConfiguration().setIncompatibleImprovements(Configuration.VERSION_2_3_0);
-        assertMainFtlOutput(false);
-    }
-    
-    /** This IcI version was buggy. */
-    @Test
-    public void testTemplateName2322() throws IOException, TemplateException {
-        getConfiguration().setTemplateLoader(createTemplateLoader(".templateName"));
-        getConfiguration().setIncompatibleImprovements(Configuration.VERSION_2_3_22);
-        assertMainFtlOutput(true);
-    }
-    
-    @Test
-    public void testTemplateName2323() throws IOException, TemplateException {
+    public void testTemplateName() throws IOException, TemplateException {
         getConfiguration().setTemplateLoader(createTemplateLoader(".templateName"));
-        getConfiguration().setIncompatibleImprovements(Configuration.VERSION_2_3_23);
         assertMainFtlOutput(false);
     }
 
     @Test
     public void testMainTemplateName() throws IOException, TemplateException {
         getConfiguration().setTemplateLoader(createTemplateLoader(".mainTemplateName"));
-        for (Version ici : BREAK_POINT_VERSIONS) {
-            getConfiguration().setIncompatibleImprovements(ici);
-            assertMainFtlOutput(true);
-        }
+        assertMainFtlOutput(true);
     }
 
-    @Test
-    public void testCurrentTemplateName() throws IOException, TemplateException {
-        getConfiguration().setTemplateLoader(createTemplateLoader(".currentTemplateName"));
-        for (Version ici : BREAK_POINT_VERSIONS) {
-            getConfiguration().setIncompatibleImprovements(ici);
-            assertOutputForNamed("main.ftl",
-                    "In main: main.ftl\n"
-                    + "In imp: imp.ftl\n"
-                    + "In main: main.ftl\n"
-                    + "imp.ftl\n"
-                    + "{main.ftl}\n"
-                    + "In imp call imp:\n"
-                    + "imp.ftl\n"
-                    + "{imp.ftl}\n"
-                    + "After: imp.ftl\n"
-                    + "In main: main.ftl\n"
-                    + "In inc: inc.ftl\n"
-                    + "In inc call imp:\n"
-                    + "imp.ftl\n"
-                    + "{inc.ftl}\n"
-                    + "In main: main.ftl\n"
-                    + "inc.ftl\n"
-                    + "{main.ftl}\n"
-                    + "In inc call imp:\n"
-                    + "imp.ftl\n"
-                    + "{inc.ftl}\n"
-                    + "In main: main.ftl\n");
-        }
-    }
-    
-    protected void assertMainFtlOutput(boolean allMain) throws IOException, TemplateException {
+    private void assertMainFtlOutput(boolean allMain) throws IOException, TemplateException {
         String expected
                 = "In main: main.ftl\n"
                 + "In imp: imp.ftl\n"
@@ -174,6 +121,33 @@ public class TemplateNameSpecialVariablesTest extends TemplateTest {
         assertOutputForNamed("main.ftl", expected);
     }
 
+    @Test
+    public void testCurrentTemplateName() throws IOException, TemplateException {
+        getConfiguration().setTemplateLoader(createTemplateLoader(".currentTemplateName"));
+        assertOutputForNamed("main.ftl",
+                "In main: main.ftl\n"
+                + "In imp: imp.ftl\n"
+                + "In main: main.ftl\n"
+                + "imp.ftl\n"
+                + "{main.ftl}\n"
+                + "In imp call imp:\n"
+                + "imp.ftl\n"
+                + "{imp.ftl}\n"
+                + "After: imp.ftl\n"
+                + "In main: main.ftl\n"
+                + "In inc: inc.ftl\n"
+                + "In inc call imp:\n"
+                + "imp.ftl\n"
+                + "{inc.ftl}\n"
+                + "In main: main.ftl\n"
+                + "inc.ftl\n"
+                + "{main.ftl}\n"
+                + "In inc call imp:\n"
+                + "imp.ftl\n"
+                + "{inc.ftl}\n"
+                + "In main: main.ftl\n");
+    }
+
     @Before
     public void setup() {
         Configuration cfg = getConfiguration();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/TheadInterruptingSupportTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/TheadInterruptingSupportTest.java b/src/test/java/org/apache/freemarker/core/ast/TheadInterruptingSupportTest.java
index d6b8a4e..8b5a8b7 100644
--- a/src/test/java/org/apache/freemarker/core/ast/TheadInterruptingSupportTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/TheadInterruptingSupportTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.util.Map;
@@ -41,7 +41,7 @@ public class TheadInterruptingSupportTest {
     private static final Logger LOG = LoggerFactory.getLogger(TheadInterruptingSupportTest.class);
 
     private static final int TEMPLATE_INTERRUPTION_TIMEOUT = 5000;
-    private final Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+    private final Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
     @Test
     public void test() throws IOException, InterruptedException {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/UnclosedCommentTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/UnclosedCommentTest.java b/src/test/java/org/apache/freemarker/core/ast/UnclosedCommentTest.java
index 4126fc0..afa1de1 100644
--- a/src/test/java/org/apache/freemarker/core/ast/UnclosedCommentTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/UnclosedCommentTest.java
@@ -28,40 +28,17 @@ import org.junit.Test;
 
 public class UnclosedCommentTest extends TemplateTest {
     
-    private static final String UNCLOSED_COMMENT_0 = "foo<#--";
-    private static final String UNCLOSED_COMMENT_1 = "foo<#-- ";
-    private static final String UNCLOSED_COMMENT_2 = "foo<#--bar";
-    private static final String UNCLOSED_COMMENT_3 = "foo\n<#--\n";
-
-    private static final String UNCLOSED_NOPARSE_0 = "foo<#noparse>";
-    private static final String UNCLOSED_NOPARSE_1 = "foo<#noparse> ";
-    private static final String UNCLOSED_NOPARSE_2 = "foo<#noparse>bar";
-    private static final String UNCLOSED_NOPARSE_3 = "foo\n<#noparse>\n";
-    
-    @Test
-    public void testLegacyBehavior() throws IOException, TemplateException {
-        setConfiguration(new Configuration(Configuration.VERSION_2_3_20));
-        assertErrorContains(UNCLOSED_COMMENT_0, "end of file");
-        assertOutput(UNCLOSED_COMMENT_1, "foo");
-        assertOutput(UNCLOSED_COMMENT_2, "foo");
-        assertOutput(UNCLOSED_COMMENT_3, "foo\n");
-        assertErrorContains(UNCLOSED_NOPARSE_0, "end of file");
-        assertOutput(UNCLOSED_NOPARSE_1, "foo");
-        assertOutput(UNCLOSED_NOPARSE_2, "foo");
-        assertOutput(UNCLOSED_NOPARSE_3, "foo\n");
-    }
-
     @Test
-    public void testFixedBehavior() throws IOException, TemplateException {
-        setConfiguration(new Configuration(Configuration.VERSION_2_3_21));
-        assertErrorContains(UNCLOSED_COMMENT_0, "end of file");  // Not too good...
-        assertErrorContains(UNCLOSED_COMMENT_1, "Unclosed", "<#--");
-        assertErrorContains(UNCLOSED_COMMENT_2, "Unclosed", "<#--");
-        assertErrorContains(UNCLOSED_COMMENT_3, "Unclosed", "<#--");
-        assertErrorContains(UNCLOSED_NOPARSE_0, "end of file");  // Not too good...
-        assertErrorContains(UNCLOSED_NOPARSE_1, "Unclosed", "#noparse");
-        assertErrorContains(UNCLOSED_NOPARSE_2, "Unclosed", "#noparse");
-        assertErrorContains(UNCLOSED_NOPARSE_3, "Unclosed", "#noparse");
+    public void test() throws IOException, TemplateException {
+        setConfiguration(new Configuration(Configuration.VERSION_3_0_0));
+        assertErrorContains("foo<#--", "end of file");  // Not too good...
+        assertErrorContains("foo<#-- ", "Unclosed", "<#--");
+        assertErrorContains("foo<#--bar", "Unclosed", "<#--");
+        assertErrorContains("foo\n<#--\n", "Unclosed", "<#--");
+        assertErrorContains("foo<#noparse>", "end of file");  // Not too good...
+        assertErrorContains("foo<#noparse> ", "Unclosed", "#noparse");
+        assertErrorContains("foo<#noparse>bar", "Unclosed", "#noparse");
+        assertErrorContains("foo\n<#noparse>\n", "Unclosed", "#noparse");
     }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/WhitespaceStrippingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/WhitespaceStrippingTest.java b/src/test/java/org/apache/freemarker/core/ast/WhitespaceStrippingTest.java
index 0f587db..f09bf84 100644
--- a/src/test/java/org/apache/freemarker/core/ast/WhitespaceStrippingTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/WhitespaceStrippingTest.java
@@ -28,8 +28,9 @@ import org.junit.Test;
 
 public class WhitespaceStrippingTest extends TemplateTest {
 
-    private final Configuration cfgStripWS = new Configuration(Configuration.VERSION_2_3_21);
-    private final Configuration cfgNoStripWS = new Configuration(Configuration.VERSION_2_3_21);
+    private final Configuration cfgStripWS = new Configuration(Configuration.VERSION_3_0_0);
+    
+    private final Configuration cfgNoStripWS = new Configuration(Configuration.VERSION_3_0_0);
     {
         cfgNoStripWS.setWhitespaceStripping(false);
     }


[8/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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 c69b498..a32f7c8 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
@@ -20,7 +20,6 @@
 package org.apache.freemarker.core.model.impl;
 
 import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapperConfiguration;
 
@@ -35,14 +34,12 @@ import org.apache.freemarker.core.model.impl.beans.BeansWrapperConfiguration;
  */
 public abstract class DefaultObjectWrapperConfiguration extends BeansWrapperConfiguration {
     
-    private boolean useAdaptersForContainers;
-    private boolean forceLegacyNonListCollections;
+    private boolean useAdaptersForContainers = true;
+    private boolean forceLegacyNonListCollections = true; // [FM3] [2.4]: = IcI < _TemplateAPI.VERSION_INT_2_4_0;
     private boolean iterableSupport;
 
     protected DefaultObjectWrapperConfiguration(Version incompatibleImprovements) {
         super(DefaultObjectWrapper.normalizeIncompatibleImprovementsVersion(incompatibleImprovements), true);
-        useAdaptersForContainers = getIncompatibleImprovements().intValue() >= _TemplateAPI.VERSION_INT_2_3_22;
-        forceLegacyNonListCollections = true; // [2.4]: = IcI < _TemplateAPI.VERSION_INT_2_4_0;
     }
 
     /** See {@link DefaultObjectWrapper#getUseAdaptersForContainers()}. */

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/_StaticObjectWrappers.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/_StaticObjectWrappers.java b/src/main/java/org/apache/freemarker/core/model/impl/_StaticObjectWrappers.java
index d891f3b..5f52b10 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/_StaticObjectWrappers.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/_StaticObjectWrappers.java
@@ -34,13 +34,13 @@ public final class _StaticObjectWrappers {
     }
 
     public static final DefaultObjectWrapper DEFAULT_OBJECT_WRAPPER
-            = new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_0).build();
+            = new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0).build();
 
     public static final BeansWrapper BEANS_WRAPPER
-            = new BeansWrapperBuilder(Configuration.VERSION_2_3_0).build();
+            = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
     
     public static final SimpleObjectWrapper SIMPLE_OBJECT_WRAPPER
-            = new SimpleObjectWrapper(Configuration.VERSION_2_3_0);
+            = new SimpleObjectWrapper(Configuration.VERSION_3_0_0);
     {
         SIMPLE_OBJECT_WRAPPER.writeProtect();
     }    

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/ArgumentTypes.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/ArgumentTypes.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/ArgumentTypes.java
index de31367..2bb82a2 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/ArgumentTypes.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/ArgumentTypes.java
@@ -19,13 +19,11 @@
 package org.apache.freemarker.core.model.impl.beans;
 
 import java.lang.reflect.InvocationTargetException;
-import java.math.BigDecimal;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 
-import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.ast.BugException;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
@@ -42,7 +40,7 @@ final class ArgumentTypes {
     private static final int CONVERSION_DIFFICULTY_REFLECTION = 0;
 
     /**
-     * Conversion difficulty: Java reflection API will won't convert it, FreeMarker has to do it.
+     * Conversion difficulty: Medium: Java reflection API won't convert it, FreeMarker has to do it.
      */
     private static final int CONVERSION_DIFFICULTY_FREEMARKER = 1;
     
@@ -56,26 +54,21 @@ final class ArgumentTypes {
      */
     private final Class<?>[] types;
     
-    private final boolean bugfixed;
-    
     /**
      * @param args The actual arguments. A varargs argument should be present exploded, no as an array.
-     * @param bugfixed Introduced in 2.3.21, sets this object to a mode that works well with {@link BeansWrapper}-s
-     *      created with {@link Version} 2.3.21 or higher.
      */
-    ArgumentTypes(Object[] args, boolean bugfixed) {
+    ArgumentTypes(Object[] args) {
         int ln = args.length;
         Class<?>[] typesTmp = new Class[ln];
         for (int i = 0; i < ln; ++i) {
             Object arg = args[i];
             typesTmp[i] = arg == null
-                    ? (bugfixed ? Null.class : Object.class)
+                    ? Null.class
                     : arg.getClass();
         }
         
         // `typesTmp` is used so the array is only modified before it's stored in the final `types` field (see JSR-133)
         types = typesTmp;  
-        this.bugfixed = bugfixed;
     }
     
     @Override
@@ -147,9 +140,6 @@ final class ArgumentTypes {
      * This method assumes that the parameter lists are applicable to this argument lists; if that's not ensured,
      * what the result will be is undefined.
      * 
-     * <p>This method behaves differently in {@code bugfixed}-mode (used when a {@link BeansWrapper} is created with
-     * incompatible improvements set to 2.3.21 or higher). Below we describe the bugfixed behavior only. 
-     *  
      * <p>The decision is made by comparing the preferability of each parameter types of the same position in a loop.
      * At the end, the parameter list with the more preferred parameters will be the preferred one. If both parameter
      * lists has the same amount of preferred parameters, the one that has the first (lower index) preferred parameter
@@ -179,222 +169,197 @@ final class ArgumentTypes {
         final int paramTypes2Len = paramTypes2.length;
         //assert varArg || paramTypes1Len == paramTypes2Len;
         
-        if (bugfixed) {
-            int paramList1WeakWinCnt = 0;
-            int paramList2WeakWinCnt = 0;
-            int paramList1WinCnt = 0;
-            int paramList2WinCnt = 0;
-            int paramList1StrongWinCnt = 0;
-            int paramList2StrongWinCnt = 0;
-            int paramList1VeryStrongWinCnt = 0;
-            int paramList2VeryStrongWinCnt = 0;
-            int firstWinerParamList = 0;
-            for (int i = 0; i < argTypesLen; i++) {
-                final Class<?> paramType1 = getParamType(paramTypes1, paramTypes1Len, i, varArg);
-                final Class<?> paramType2 = getParamType(paramTypes2, paramTypes2Len, i, varArg);
+        int paramList1WeakWinCnt = 0;
+        int paramList2WeakWinCnt = 0;
+        int paramList1WinCnt = 0;
+        int paramList2WinCnt = 0;
+        int paramList1StrongWinCnt = 0;
+        int paramList2StrongWinCnt = 0;
+        int paramList1VeryStrongWinCnt = 0;
+        int paramList2VeryStrongWinCnt = 0;
+        int firstWinerParamList = 0;
+        for (int i = 0; i < argTypesLen; i++) {
+            final Class<?> paramType1 = getParamType(paramTypes1, paramTypes1Len, i, varArg);
+            final Class<?> paramType2 = getParamType(paramTypes2, paramTypes2Len, i, varArg);
+            
+            final int winerParam;  // 1 => paramType1; -1 => paramType2; 0 => draw
+            if (paramType1 == paramType2) {
+                winerParam = 0;
+            } else {
+                final Class<?> argType = types[i];
+                final boolean argIsNum = Number.class.isAssignableFrom(argType);
                 
-                final int winerParam;  // 1 => paramType1; -1 => paramType2; 0 => draw
-                if (paramType1 == paramType2) {
-                    winerParam = 0;
+                final int numConvPrice1;
+                if (argIsNum && _ClassUtil.isNumerical(paramType1)) {
+                    final Class<?> nonPrimParamType1 = paramType1.isPrimitive()
+                            ? _ClassUtil.primitiveClassToBoxingClass(paramType1) : paramType1;
+                    numConvPrice1 = OverloadedNumberUtil.getArgumentConversionPrice(argType, nonPrimParamType1);
                 } else {
-                    final Class<?> argType = types[i];
-                    final boolean argIsNum = Number.class.isAssignableFrom(argType);
-                    
-                    final int numConvPrice1;
-                    if (argIsNum && _ClassUtil.isNumerical(paramType1)) {
-                        final Class<?> nonPrimParamType1 = paramType1.isPrimitive()
-                                ? _ClassUtil.primitiveClassToBoxingClass(paramType1) : paramType1;
-                        numConvPrice1 = OverloadedNumberUtil.getArgumentConversionPrice(argType, nonPrimParamType1);
-                    } else {
-                        numConvPrice1 = Integer.MAX_VALUE;
-                    }
-                    // numConvPrice1 is Integer.MAX_VALUE if either:
-                    // - argType and paramType1 aren't both numerical
-                    // - FM doesn't know some of the numerical types, or the conversion between them is not allowed    
-                    
-                    final int numConvPrice2;
-                    if (argIsNum && _ClassUtil.isNumerical(paramType2)) {
-                        final Class<?> nonPrimParamType2 = paramType2.isPrimitive()
-                                ? _ClassUtil.primitiveClassToBoxingClass(paramType2) : paramType2;
-                        numConvPrice2 = OverloadedNumberUtil.getArgumentConversionPrice(argType, nonPrimParamType2);
-                    } else {
-                        numConvPrice2 = Integer.MAX_VALUE;
-                    }
-                    
-                    if (numConvPrice1 == Integer.MAX_VALUE) {
-                        if (numConvPrice2 == Integer.MAX_VALUE) {  // No numerical conversions anywhere
-                            // List to array conversions (unwrapping sometimes makes a List instead of an array)
-                            if (List.class.isAssignableFrom(argType)
-                                    && (paramType1.isArray() || paramType2.isArray())) {
-                                if (paramType1.isArray()) {
-                                    if (paramType2.isArray()) {  // both paramType1 and paramType2 are arrays
-                                        int r = compareParameterListPreferability_cmpTypeSpecificty(
-                                                paramType1.getComponentType(), paramType2.getComponentType());
-                                        // Because we don't know if the List items are instances of the component
-                                        // type or not, we prefer the safer choice, which is the more generic array:
-                                        if (r > 0) {
-                                            winerParam = 2;
-                                            paramList2StrongWinCnt++;
-                                        } else if (r < 0) {
-                                            winerParam = 1;
-                                            paramList1StrongWinCnt++;
-                                        } else {
-                                            winerParam = 0;
-                                        }
-                                    } else {  // paramType1 is array, paramType2 isn't
-                                        // Avoid List to array conversion if the other way makes any sense:
-                                        if (Collection.class.isAssignableFrom(paramType2)) {
-                                            winerParam = 2;
-                                            paramList2StrongWinCnt++;
-                                        } else {
-                                            winerParam = 1;
-                                            paramList1WeakWinCnt++;
-                                        }
-                                    }
-                                } else {  // paramType2 is array, paramType1 isn't
-                                    // Avoid List to array conversion if the other way makes any sense:
-                                    if (Collection.class.isAssignableFrom(paramType1)) {
+                    numConvPrice1 = Integer.MAX_VALUE;
+                }
+                // numConvPrice1 is Integer.MAX_VALUE if either:
+                // - argType and paramType1 aren't both numerical
+                // - FM doesn't know some of the numerical types, or the conversion between them is not allowed    
+                
+                final int numConvPrice2;
+                if (argIsNum && _ClassUtil.isNumerical(paramType2)) {
+                    final Class<?> nonPrimParamType2 = paramType2.isPrimitive()
+                            ? _ClassUtil.primitiveClassToBoxingClass(paramType2) : paramType2;
+                    numConvPrice2 = OverloadedNumberUtil.getArgumentConversionPrice(argType, nonPrimParamType2);
+                } else {
+                    numConvPrice2 = Integer.MAX_VALUE;
+                }
+                
+                if (numConvPrice1 == Integer.MAX_VALUE) {
+                    if (numConvPrice2 == Integer.MAX_VALUE) {  // No numerical conversions anywhere
+                        // List to array conversions (unwrapping sometimes makes a List instead of an array)
+                        if (List.class.isAssignableFrom(argType)
+                                && (paramType1.isArray() || paramType2.isArray())) {
+                            if (paramType1.isArray()) {
+                                if (paramType2.isArray()) {  // both paramType1 and paramType2 are arrays
+                                    int r = compareParameterListPreferability_cmpTypeSpecificty(
+                                            paramType1.getComponentType(), paramType2.getComponentType());
+                                    // Because we don't know if the List items are instances of the component
+                                    // type or not, we prefer the safer choice, which is the more generic array:
+                                    if (r > 0) {
+                                        winerParam = 2;
+                                        paramList2StrongWinCnt++;
+                                    } else if (r < 0) {
                                         winerParam = 1;
                                         paramList1StrongWinCnt++;
                                     } else {
-                                        winerParam = 2;
-                                        paramList2WeakWinCnt++;
-                                    }
-                                }
-                            } else if (argType.isArray()
-                                    && (List.class.isAssignableFrom(paramType1)
-                                            || List.class.isAssignableFrom(paramType2))) {
-                                // Array to List conversions (unwrapping sometimes makes an array instead of a List)
-                                if (List.class.isAssignableFrom(paramType1)) {
-                                    if (List.class.isAssignableFrom(paramType2)) {
-                                        // Both paramType1 and paramType2 extends List
                                         winerParam = 0;
-                                    } else {
-                                        // Only paramType1 extends List
-                                        winerParam = 2;
-                                        paramList2VeryStrongWinCnt++;
                                     }
-                                } else {
-                                    // Only paramType2 extends List
-                                    winerParam = 1;
-                                    paramList1VeryStrongWinCnt++;
-                                }
-                            } else {  // No list to/from array conversion
-                                final int r = compareParameterListPreferability_cmpTypeSpecificty(
-                                        paramType1, paramType2);
-                                if (r > 0) {
-                                    winerParam = 1;
-                                    if (r > 1) {
-                                        paramList1WinCnt++;
+                                } else {  // paramType1 is array, paramType2 isn't
+                                    // Avoid List to array conversion if the other way makes any sense:
+                                    if (Collection.class.isAssignableFrom(paramType2)) {
+                                        winerParam = 2;
+                                        paramList2StrongWinCnt++;
                                     } else {
+                                        winerParam = 1;
                                         paramList1WeakWinCnt++;
                                     }
-                                } else if (r < 0) {
-                                    winerParam = -1;
-                                    if (r < -1) {
-                                        paramList2WinCnt++;
-                                    } else {
-                                        paramList2WeakWinCnt++;
-                                    }
+                                }
+                            } else {  // paramType2 is array, paramType1 isn't
+                                // Avoid List to array conversion if the other way makes any sense:
+                                if (Collection.class.isAssignableFrom(paramType1)) {
+                                    winerParam = 1;
+                                    paramList1StrongWinCnt++;
                                 } else {
+                                    winerParam = 2;
+                                    paramList2WeakWinCnt++;
+                                }
+                            }
+                        } else if (argType.isArray()
+                                && (List.class.isAssignableFrom(paramType1)
+                                        || List.class.isAssignableFrom(paramType2))) {
+                            // Array to List conversions (unwrapping sometimes makes an array instead of a List)
+                            if (List.class.isAssignableFrom(paramType1)) {
+                                if (List.class.isAssignableFrom(paramType2)) {
+                                    // Both paramType1 and paramType2 extends List
                                     winerParam = 0;
+                                } else {
+                                    // Only paramType1 extends List
+                                    winerParam = 2;
+                                    paramList2VeryStrongWinCnt++;
                                 }
+                            } else {
+                                // Only paramType2 extends List
+                                winerParam = 1;
+                                paramList1VeryStrongWinCnt++;
                             }
-                        } else {  // No num. conv. of param1, num. conv. of param2
-                            winerParam = -1;
-                            paramList2WinCnt++;
-                        }
-                    } else if (numConvPrice2 == Integer.MAX_VALUE) {  // Num. conv. of param1, not of param2
-                        winerParam = 1;
-                        paramList1WinCnt++;
-                    } else {  // Num. conv. of both param1 and param2
-                        if (numConvPrice1 != numConvPrice2) {
-                            if (numConvPrice1 < numConvPrice2) {
+                        } else {  // No list to/from array conversion
+                            final int r = compareParameterListPreferability_cmpTypeSpecificty(
+                                    paramType1, paramType2);
+                            if (r > 0) {
                                 winerParam = 1;
-                                if (numConvPrice1 < OverloadedNumberUtil.BIG_MANTISSA_LOSS_PRICE
-                                        && numConvPrice2 > OverloadedNumberUtil.BIG_MANTISSA_LOSS_PRICE) {
-                                    paramList1StrongWinCnt++;
-                                } else {
+                                if (r > 1) {
                                     paramList1WinCnt++;
+                                } else {
+                                    paramList1WeakWinCnt++;
                                 }
-                            } else {
+                            } else if (r < 0) {
                                 winerParam = -1;
-                                if (numConvPrice2 < OverloadedNumberUtil.BIG_MANTISSA_LOSS_PRICE
-                                        && numConvPrice1 > OverloadedNumberUtil.BIG_MANTISSA_LOSS_PRICE) {
-                                    paramList2StrongWinCnt++;
-                                } else {
+                                if (r < -1) {
                                     paramList2WinCnt++;
+                                } else {
+                                    paramList2WeakWinCnt++;
                                 }
+                            } else {
+                                winerParam = 0;
                             }
-                        } else {
-                            winerParam = (paramType1.isPrimitive() ? 1 : 0) - (paramType2.isPrimitive() ? 1 : 0);
-                            if (winerParam == 1) paramList1WeakWinCnt++;
-                            else if (winerParam == -1) paramList2WeakWinCnt++;
                         }
+                    } else {  // No num. conv. of param1, num. conv. of param2
+                        winerParam = -1;
+                        paramList2WinCnt++;
                     }
-                }  // when paramType1 != paramType2
-                
-                if (firstWinerParamList == 0 && winerParam != 0) {
-                    firstWinerParamList = winerParam; 
-                }
-            }  // for each parameter types
-            
-            if (paramList1VeryStrongWinCnt != paramList2VeryStrongWinCnt) {
-                return paramList1VeryStrongWinCnt - paramList2VeryStrongWinCnt;
-            } else if (paramList1StrongWinCnt != paramList2StrongWinCnt) {
-                return paramList1StrongWinCnt - paramList2StrongWinCnt;
-            } else if (paramList1WinCnt != paramList2WinCnt) {
-                return paramList1WinCnt - paramList2WinCnt;
-            } else if (paramList1WeakWinCnt != paramList2WeakWinCnt) {
-                return paramList1WeakWinCnt - paramList2WeakWinCnt;
-            } else if (firstWinerParamList != 0) {  // paramList1WinCnt == paramList2WinCnt
-                return firstWinerParamList;
-            } else { // still undecided
-                if (varArg) {
-                    if (paramTypes1Len == paramTypes2Len) {
-                        // If we had a 0-length varargs array in both methods, we also compare the types at the
-                        // index of the varargs parameter, like if we had a single varargs argument. However, this
-                        // time we don't have an argument type, so we can only decide based on type specificity:
-                        if (argTypesLen == paramTypes1Len - 1) {
-                            Class<?> paramType1 = getParamType(paramTypes1, paramTypes1Len, argTypesLen, true);
-                            Class<?> paramType2 = getParamType(paramTypes2, paramTypes2Len, argTypesLen, true);
-                            if (_ClassUtil.isNumerical(paramType1) && _ClassUtil.isNumerical(paramType2)) {
-                                int r = OverloadedNumberUtil.compareNumberTypeSpecificity(paramType1, paramType2);
-                                if (r != 0) return r;
-                                // falls through
+                } else if (numConvPrice2 == Integer.MAX_VALUE) {  // Num. conv. of param1, not of param2
+                    winerParam = 1;
+                    paramList1WinCnt++;
+                } else {  // Num. conv. of both param1 and param2
+                    if (numConvPrice1 != numConvPrice2) {
+                        if (numConvPrice1 < numConvPrice2) {
+                            winerParam = 1;
+                            if (numConvPrice1 < OverloadedNumberUtil.BIG_MANTISSA_LOSS_PRICE
+                                    && numConvPrice2 > OverloadedNumberUtil.BIG_MANTISSA_LOSS_PRICE) {
+                                paramList1StrongWinCnt++;
+                            } else {
+                                paramList1WinCnt++;
                             }
-                            return compareParameterListPreferability_cmpTypeSpecificty(paramType1, paramType2);
                         } else {
-                            return 0;
+                            winerParam = -1;
+                            if (numConvPrice2 < OverloadedNumberUtil.BIG_MANTISSA_LOSS_PRICE
+                                    && numConvPrice1 > OverloadedNumberUtil.BIG_MANTISSA_LOSS_PRICE) {
+                                paramList2StrongWinCnt++;
+                            } else {
+                                paramList2WinCnt++;
+                            }
                         }
                     } else {
-                        // The method with more fixed parameters wins:
-                        return paramTypes1Len - paramTypes2Len;
+                        winerParam = (paramType1.isPrimitive() ? 1 : 0) - (paramType2.isPrimitive() ? 1 : 0);
+                        if (winerParam == 1) paramList1WeakWinCnt++;
+                        else if (winerParam == -1) paramList2WeakWinCnt++;
                     }
-                } else {
-                    return 0;
                 }
+            }  // when paramType1 != paramType2
+            
+            if (firstWinerParamList == 0 && winerParam != 0) {
+                firstWinerParamList = winerParam; 
             }
-        } else { // non-bugfixed (backward-compatible) mode
-            boolean paramTypes1HasAMoreSpecific = false;
-            boolean paramTypes2HasAMoreSpecific = false;
-            for (int i = 0; i < paramTypes1Len; ++i) {
-                Class<?> paramType1 = getParamType(paramTypes1, paramTypes1Len, i, varArg);
-                Class<?> paramType2 = getParamType(paramTypes2, paramTypes2Len, i, varArg);
-                if (paramType1 != paramType2) {
-                    paramTypes1HasAMoreSpecific = 
-                        paramTypes1HasAMoreSpecific
-                        || _MethodUtil.isMoreOrSameSpecificParameterType(paramType1, paramType2, false, 0) != 0;
-                    paramTypes2HasAMoreSpecific = 
-                        paramTypes2HasAMoreSpecific
-                        || _MethodUtil.isMoreOrSameSpecificParameterType(paramType2, paramType1, false, 0) != 0;
+        }  // for each parameter types
+        
+        if (paramList1VeryStrongWinCnt != paramList2VeryStrongWinCnt) {
+            return paramList1VeryStrongWinCnt - paramList2VeryStrongWinCnt;
+        } else if (paramList1StrongWinCnt != paramList2StrongWinCnt) {
+            return paramList1StrongWinCnt - paramList2StrongWinCnt;
+        } else if (paramList1WinCnt != paramList2WinCnt) {
+            return paramList1WinCnt - paramList2WinCnt;
+        } else if (paramList1WeakWinCnt != paramList2WeakWinCnt) {
+            return paramList1WeakWinCnt - paramList2WeakWinCnt;
+        } else if (firstWinerParamList != 0) {  // paramList1WinCnt == paramList2WinCnt
+            return firstWinerParamList;
+        } else { // still undecided
+            if (varArg) {
+                if (paramTypes1Len == paramTypes2Len) {
+                    // If we had a 0-length varargs array in both methods, we also compare the types at the
+                    // index of the varargs parameter, like if we had a single varargs argument. However, this
+                    // time we don't have an argument type, so we can only decide based on type specificity:
+                    if (argTypesLen == paramTypes1Len - 1) {
+                        Class<?> paramType1 = getParamType(paramTypes1, paramTypes1Len, argTypesLen, true);
+                        Class<?> paramType2 = getParamType(paramTypes2, paramTypes2Len, argTypesLen, true);
+                        if (_ClassUtil.isNumerical(paramType1) && _ClassUtil.isNumerical(paramType2)) {
+                            int r = OverloadedNumberUtil.compareNumberTypeSpecificity(paramType1, paramType2);
+                            if (r != 0) return r;
+                            // falls through
+                        }
+                        return compareParameterListPreferability_cmpTypeSpecificty(paramType1, paramType2);
+                    } else {
+                        return 0;
+                    }
+                } else {
+                    // The method with more oms parameters wins:
+                    return paramTypes1Len - paramTypes2Len;
                 }
-            }
-            
-            if (paramTypes1HasAMoreSpecific) {
-                return paramTypes2HasAMoreSpecific ? 0 : 1;
-            } else if (paramTypes2HasAMoreSpecific) {
-                return -1;
             } else {
                 return 0;
             }
@@ -533,7 +498,7 @@ final class ArgumentTypes {
         // Check for identity or widening reference conversion
         if (formal.isAssignableFrom(actual) && actual != CharacterOrString.class) {
             return CONVERSION_DIFFICULTY_REFLECTION;
-        } else if (bugfixed) {
+        } else {
             final Class<?> formalNP;
             if (formal.isPrimitive()) {
                 if (actual == Null.class) {
@@ -569,59 +534,6 @@ final class ArgumentTypes {
             } else {
                 return CONVERSION_DIFFICULTY_IMPOSSIBLE;
             }
-        } else { // if !bugfixed
-            // This non-bugfixed (backward-compatible, pre-2.3.21) branch:
-            // - Doesn't convert *to* non-primitive numerical types (unless the argument is a BigDecimal).
-            //   (This is like in Java language, which also doesn't coerce to non-primitive numerical types.) 
-            // - Doesn't support BigInteger conversions
-            // - Doesn't support NumberWithFallbackType-s and CharacterOrString-s. Those are only produced in bugfixed
-            //   mode anyway.
-            // - Doesn't support conversion between array and List
-            if (formal.isPrimitive()) {
-                // Check for boxing with widening primitive conversion. Note that 
-                // actual parameters are never primitives.
-                // It doesn't do the same with boxing types... that was a bug.
-                if (formal == Boolean.TYPE) {
-                    return actual == Boolean.class
-                            ? CONVERSION_DIFFICULTY_REFLECTION : CONVERSION_DIFFICULTY_IMPOSSIBLE;
-                } else if (formal == Double.TYPE && 
-                        (actual == Double.class || actual == Float.class || 
-                         actual == Long.class || actual == Integer.class || 
-                         actual == Short.class || actual == Byte.class)) {
-                     return CONVERSION_DIFFICULTY_REFLECTION;
-                } else if (formal == Integer.TYPE && 
-                        (actual == Integer.class || actual == Short.class || 
-                         actual == Byte.class)) {
-                     return CONVERSION_DIFFICULTY_REFLECTION;
-                } else if (formal == Long.TYPE && 
-                        (actual == Long.class || actual == Integer.class || 
-                         actual == Short.class || actual == Byte.class)) {
-                     return CONVERSION_DIFFICULTY_REFLECTION;
-                } else if (formal == Float.TYPE && 
-                        (actual == Float.class || actual == Long.class || 
-                         actual == Integer.class || actual == Short.class || 
-                         actual == Byte.class)) {
-                     return CONVERSION_DIFFICULTY_REFLECTION;
-                } else if (formal == Character.TYPE) {
-                    return actual == Character.class
-                            ? CONVERSION_DIFFICULTY_REFLECTION : CONVERSION_DIFFICULTY_IMPOSSIBLE;
-                } else if (formal == Byte.TYPE && actual == Byte.class) {
-                    return CONVERSION_DIFFICULTY_REFLECTION;
-                } else if (formal == Short.TYPE &&
-                   (actual == Short.class || actual == Byte.class)) {
-                    return CONVERSION_DIFFICULTY_REFLECTION;
-                } else if (BigDecimal.class.isAssignableFrom(actual) && _ClassUtil.isNumerical(formal)) {
-                    // Special case for BigDecimals as we deem BigDecimal to be
-                    // convertible to any numeric type - either object or primitive.
-                    // This can actually cause us trouble as this is a narrowing 
-                    // conversion, not widening. 
-                    return CONVERSION_DIFFICULTY_REFLECTION;
-                } else {
-                    return CONVERSION_DIFFICULTY_IMPOSSIBLE;
-                }
-            } else {
-                return CONVERSION_DIFFICULTY_IMPOSSIBLE;
-            }
         }
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/BeanModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeanModel.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeanModel.java
index 9ef62d0..d800b0c 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeanModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeanModel.java
@@ -285,8 +285,9 @@ implements
     }
 
     /**
-     * Tells whether the model is empty. It is empty if either the wrapped 
-     * object is null, or it's a Boolean with false value.
+     * Tells whether the model is considered to be empty.
+     * It is empty if the wrapped object is a 0 length {@link String}, or an empty {@link Collection} or and empty
+     * {@link Map}, or an {@link Iterator} that has no more items, or a {@link Boolean#FALSE}, or {@code null}. 
      */
     @Override
     public boolean isEmpty() {
@@ -296,12 +297,13 @@ implements
         if (object instanceof Collection) {
             return ((Collection<?>) object).isEmpty();
         }
-        if (object instanceof Iterator && wrapper.is2324Bugfixed()) {
+        if (object instanceof Iterator) {
             return !((Iterator<?>) object).hasNext();
         }
         if (object instanceof Map) {
             return ((Map<?,?>) object).isEmpty();
         }
+        // [FM3] Why's FALSE empty? 
         return object == null || Boolean.FALSE.equals(object);
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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 26e8ef9..3d1f841 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
@@ -49,6 +49,7 @@ import org.apache.freemarker.core.ast._TemplateModelException;
 import org.apache.freemarker.core.model.AdapterTemplateModel;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.ObjectWrapperAndUnwrapper;
+import org.apache.freemarker.core.model.RichObjectWrapper;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateCollectionModel;
 import org.apache.freemarker.core.model.TemplateDateModel;
@@ -63,10 +64,9 @@ import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.WrapperTemplateModel;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
 import org.apache.freemarker.core.model.impl.SimpleObjectWrapper;
-import org.apache.freemarker.core.util._ClassUtil;
-import org.apache.freemarker.core.model.RichObjectWrapper;
 import org.apache.freemarker.core.util.UndeclaredThrowableException;
 import org.apache.freemarker.core.util.WriteProtectable;
+import org.apache.freemarker.core.util._ClassUtil;
 import org.slf4j.Logger;
 
 /**
@@ -227,11 +227,11 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
      *     </li>
      *     <li>
      *       <p>2.3.21 (or higher):
-     *       Several glitches were fixed in <em>overloaded</em> method selection. This usually just gets
+     *       Several glitches were oms in <em>overloaded</em> method selection. This usually just gets
      *       rid of errors (like ambiguity exceptions and numerical precision loses due to bad overloaded method
      *       choices), still, as in some cases the method chosen can be a different one now (that was the point of
      *       the reworking after all), it can mean a change in the behavior of the application. The most important
-     *       change is that the treatment of {@code null} arguments were fixed, as earlier they were only seen
+     *       change is that the treatment of {@code null} arguments were oms, as earlier they were only seen
      *       applicable to parameters of type {@code Object}. Now {@code null}-s are seen to be applicable to any
      *       non-primitive parameters, and among those the one with the most specific type will be preferred (just
      *       like in Java), which is hence never the one with the {@code Object} parameter type. For more details
@@ -354,7 +354,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
         staticModels = new StaticModels(BeansWrapper.this);
         enumModels = createEnumModels(BeansWrapper.this);
         modelCache = new BeansModelCache(BeansWrapper.this);
-        setUseCache(bwConf.getUseModelCache());
+        setUseModelCache(bwConf.getUseModelCache());
 
         finalizeConstruction(writeProtected);
     }
@@ -492,7 +492,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
      * (Technical note: {@link Map}-s will be wrapped into {@link SimpleMapModel} in this case.)
      * 
      * <p>*: For historical reasons, FreeMarker 2.3.X doesn't support non-string keys with the {@code []} operator,
-     *       hence the workarounds. This will be likely fixed in FreeMarker 2.4.0. Also note that the method- and
+     *       hence the workarounds. This will be likely oms in FreeMarker 2.4.0. Also note that the method- and
      *       the "field"-namespaces aren't separate in FreeMarker, hence {@code myMap.get} can return the {@code get}
      *       method.
      */
@@ -747,7 +747,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
      * the same object will likely return the same model (although there is
      * no guarantee as the cache items can be cleared any time).
      */
-    public void setUseCache(boolean useCache) {
+    public void setUseModelCache(boolean useCache) {
         checkModifiable();
         modelCache.setUseCache(useCache);
     }
@@ -755,7 +755,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
     /**
      * @since 2.3.21
      */
-    public boolean getUseCache() {
+    public boolean getUseModelCache() {
         return modelCache.getUseCache();
     }
     
@@ -784,39 +784,13 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
         return incompatibleImprovements;
     }
     
-    boolean is2321Bugfixed() {
-        return is2321Bugfixed(getIncompatibleImprovements());
-    }
-
-    static boolean is2321Bugfixed(Version version) {
-        return version.intValue() >= _TemplateAPI.VERSION_INT_2_3_21;
-    }
-
-    boolean is2324Bugfixed() {
-        return is2324Bugfixed(getIncompatibleImprovements());
-    }
-
-    static boolean is2324Bugfixed(Version version) {
-        return version.intValue() >= _TemplateAPI.VERSION_INT_2_3_24;
-    }
-
-    private static boolean is300Bugfixed(Version incompatibleImprovements) {
-        return incompatibleImprovements.intValue() >= Configuration.VERSION_3_0_0.intValue();
-    }
-    
     /** 
      * Returns the lowest version number that is equivalent with the parameter version.
      * @since 2.3.21
      */
     protected static Version normalizeIncompatibleImprovementsVersion(Version incompatibleImprovements) {
         _TemplateAPI.checkVersionNotNullAndSupported(incompatibleImprovements);
-        if (incompatibleImprovements.intValue() < _TemplateAPI.VERSION_INT_2_3_0) {
-            throw new IllegalArgumentException("Version must be at least 2.3.0.");
-        }
-        return is300Bugfixed(incompatibleImprovements) ? Configuration.VERSION_3_0_0 
-                : is2324Bugfixed(incompatibleImprovements) ? Configuration.VERSION_2_3_24
-                : is2321Bugfixed(incompatibleImprovements) ? Configuration.VERSION_2_3_21
-                : Configuration.VERSION_2_3_0;
+        return Configuration.VERSION_3_0_0;
     }
 
     /**
@@ -986,13 +960,12 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
     
     /**
      * @param typeFlags
-     *            Used when unwrapping for overloaded methods and so the {@code targetClass} is possibly too generic.
-     *            Must be 0 when unwrapping parameter values for non-overloaded methods, also if
-     *            {@link #is2321Bugfixed()} is {@code false}.
+     *            Used when unwrapping for overloaded methods and so the {@code targetClass} is possibly too generic
+     *            (as it's the most specific common superclass). Must be 0 when unwrapping parameter values for
+     *            non-overloaded methods.
      * @return {@link ObjectWrapperAndUnwrapper#CANT_UNWRAP_TO_TARGET_CLASS} or the unwrapped object.
      */
-    Object tryUnwrapTo(TemplateModel model, Class<?> targetClass, int typeFlags) 
-    throws TemplateModelException {
+    Object tryUnwrapTo(TemplateModel model, Class<?> targetClass, int typeFlags) throws TemplateModelException {
         Object res = tryUnwrapTo(model, targetClass, typeFlags, null);
         if ((typeFlags & TypeFlags.WIDENED_NUMERICAL_UNWRAPPING_HINT) != 0
                 && res instanceof Number) {
@@ -1012,9 +985,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
             return null;
         }
         
-        final boolean is2321Bugfixed = is2321Bugfixed();
-        
-        if (is2321Bugfixed && targetClass.isPrimitive()) {
+        if (targetClass.isPrimitive()) {
             targetClass = _ClassUtil.primitiveClassToBoxingClass(targetClass);
         }
         
@@ -1030,7 +1001,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
             
             // Attempt numeric conversion: 
             if (targetClass != Object.class && (wrapped instanceof Number && _ClassUtil.isNumerical(targetClass))) {
-                Number number = forceUnwrappedNumberToType((Number) wrapped, targetClass, is2321Bugfixed);
+                Number number = forceUnwrappedNumberToType((Number) wrapped, targetClass);
                 if (number != null) return number;
             }
         }
@@ -1043,7 +1014,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
             
             // Attempt numeric conversion: 
             if (targetClass != Object.class && (wrapped instanceof Number && _ClassUtil.isNumerical(targetClass))) {
-                Number number = forceUnwrappedNumberToType((Number) wrapped, targetClass, is2321Bugfixed);
+                Number number = forceUnwrappedNumberToType((Number) wrapped, targetClass);
                 if (number != null) {
                     return number;
                 }
@@ -1069,7 +1040,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
             if (_ClassUtil.isNumerical(targetClass)) {
                 if (model instanceof TemplateNumberModel) {
                     Number number = forceUnwrappedNumberToType(
-                            ((TemplateNumberModel) model).getAsNumber(), targetClass, is2321Bugfixed);
+                            ((TemplateNumberModel) model).getAsNumber(), targetClass);
                     if (number != null) {
                         return number;
                     }
@@ -1204,9 +1175,6 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
                 return new SetAdapter((TemplateCollectionModel) model, this);
             }
             
-            // In 2.3.21 bugfixed mode only, List-s are convertible to arrays on invocation time. Only overloaded
-            // methods need this. As itf will be 0 in non-bugfixed mode and for non-overloaded method calls, it's
-            // enough to check if the TypeFlags.ACCEPTS_ARRAY bit is 1:
             if ((itf & TypeFlags.ACCEPTS_ARRAY) != 0
                     && model instanceof TemplateSequenceModel) {
                 return new SequenceAdapter((TemplateSequenceModel) model, this);
@@ -1306,7 +1274,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
                         isComponentTypeExamined = true;
                     }
                     if (isComponentTypeNumerical && listItem instanceof Number) {
-                        listItem = forceUnwrappedNumberToType((Number) listItem, componentType, true);
+                        listItem = forceUnwrappedNumberToType((Number) listItem, componentType);
                     } else if (componentType == String.class && listItem instanceof Character) {
                         listItem = String.valueOf(((Character) listItem).charValue());
                     } else if ((componentType == Character.class || componentType == char.class)
@@ -1362,7 +1330,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
      * @param n Non-{@code null}
      * @return {@code null} if the conversion has failed.
      */
-    static Number forceUnwrappedNumberToType(final Number n, final Class<?> targetType, final boolean bugfixed) {
+    static Number forceUnwrappedNumberToType(final Number n, final Class<?> targetType) {
         // We try to order the conditions by decreasing probability.
         if (targetType == n.getClass()) {
             return n;
@@ -1392,7 +1360,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
         } else if (targetType == BigInteger.class) {
             if (n instanceof BigInteger) {
                 return n;
-            } else if (bugfixed) {
+            } else {
                 if (n instanceof OverloadedNumberUtil.IntegerBigDecimal) {
                     return ((OverloadedNumberUtil.IntegerBigDecimal) n).bigIntegerValue();
                 } else if (n instanceof BigDecimal) {
@@ -1400,9 +1368,6 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
                 } else {
                     return BigInteger.valueOf(n.longValue()); 
                 }
-            } else {
-                // This is wrong, because something like "123.4" will cause NumberFormatException instead of flooring.
-                return new BigInteger(n.toString());
             }
         } else {
             final Number oriN = n instanceof OverloadedNumberUtil.NumberWithFallbackType

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBuilder.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBuilder.java
index ffd403e..2c0dcc0 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBuilder.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperBuilder.java
@@ -96,7 +96,7 @@ import org.apache.freemarker.core.model.impl.DefaultObjectWrapperBuilder;
  *         these caches aren't unused.
  *       </li>
  *       <li><p>
- *         Instance model cache: By default off (see {@link BeansWrapper#setUseCache(boolean)}). Caches the
+ *         Instance model cache: By default off (see {@link BeansWrapper#setUseModelCache(boolean)}). Caches the
  *         {@link TemplateModel}-s for all Java objects that were accessed from templates.
  *       </li>
  *     </ul>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java
index 7a504f8..327cbc5 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java
@@ -183,7 +183,7 @@ public abstract class BeansWrapperConfiguration implements Cloneable {
         return useModelCache;
     }
 
-    /** See {@link BeansWrapper#setUseCache(boolean)} (it means the same). */
+    /** See {@link BeansWrapper#setUseModelCache(boolean)} (it means the same). */
     public void setUseModelCache(boolean useModelCache) {
         this.useModelCache = useModelCache;
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospector.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospector.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospector.java
index 279fe31..2b33fb4 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospector.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospector.java
@@ -128,7 +128,6 @@ class ClassIntrospector {
     final boolean exposeFields;
     final MethodAppearanceFineTuner methodAppearanceFineTuner;
     final MethodSorter methodSorter;
-    final boolean bugfixed;
 
     /** See {@link #getHasSharedInstanceRestrictons()} */
     final private boolean hasSharedInstanceRestrictons;
@@ -177,7 +176,6 @@ class ClassIntrospector {
         exposeFields = builder.getExposeFields();
         methodAppearanceFineTuner = builder.getMethodAppearanceFineTuner();
         methodSorter = builder.getMethodSorter();
-        bugfixed = builder.isBugfixed();
 
         this.sharedLock = sharedLock;
 
@@ -345,7 +343,7 @@ class ClassIntrospector {
                             Object previous = introspData.get(methodKey);
                             if (previous instanceof Method) {
                                 // Overloaded method - replace Method with a OverloadedMethods
-                                OverloadedMethods overloadedMethods = new OverloadedMethods(bugfixed);
+                                OverloadedMethods overloadedMethods = new OverloadedMethods();
                                 overloadedMethods.addMethod((Method) previous);
                                 overloadedMethods.addMethod(method);
                                 introspData.put(methodKey, overloadedMethods);
@@ -433,7 +431,7 @@ class ClassIntrospector {
                 Constructor<?> ctor = ctors[0];
                 introspData.put(CONSTRUCTORS_KEY, new SimpleMethod(ctor, ctor.getParameterTypes()));
             } else if (ctors.length > 1) {
-                OverloadedMethods overloadedCtors = new OverloadedMethods(bugfixed);
+                OverloadedMethods overloadedCtors = new OverloadedMethods();
                 for (Constructor<?> ctor : ctors) {
                     overloadedCtors.addConstructor(ctor);
                 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java
index e1e6984..8716a3b 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java
@@ -27,10 +27,9 @@ import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.freemarker.core.Version;
+import org.apache.freemarker.core.util._NullArgumentException;
 
 final class ClassIntrospectorBuilder implements Cloneable {
-    
-    private final boolean bugfixed;
 
     private static final Map/*<PropertyAssignments, Reference<ClassIntrospector>>*/ INSTANCE_CACHE = new HashMap();
     private static final ReferenceQueue INSTANCE_CACHE_REF_QUEUE = new ReferenceQueue(); 
@@ -47,7 +46,6 @@ final class ClassIntrospectorBuilder implements Cloneable {
     // - If you add a new field, review all methods in this class, also the ClassIntrospector constructor
     
     ClassIntrospectorBuilder(ClassIntrospector ci) {
-        bugfixed = ci.bugfixed;
         exposureLevel = ci.exposureLevel;
         exposeFields = ci.exposeFields;
         methodAppearanceFineTuner = ci.methodAppearanceFineTuner;
@@ -57,8 +55,9 @@ final class ClassIntrospectorBuilder implements Cloneable {
     ClassIntrospectorBuilder(Version incompatibleImprovements) {
         // Warning: incompatibleImprovements must not affect this object at versions increments where there's no
         // change in the BeansWrapper.normalizeIncompatibleImprovements results. That is, this class may don't react
-        // to some version changes that affects BeansWrapper, but not the other way around. 
-        bugfixed = BeansWrapper.is2321Bugfixed(incompatibleImprovements);
+        // to some version changes that affects BeansWrapper, but not the other way around.
+        _NullArgumentException.check(incompatibleImprovements);
+        // Currently nothing depends on incompatibleImprovements
     }
     
     @Override
@@ -74,7 +73,6 @@ final class ClassIntrospectorBuilder implements Cloneable {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + (bugfixed ? 1231 : 1237);
         result = prime * result + (exposeFields ? 1231 : 1237);
         result = prime * result + exposureLevel;
         result = prime * result + System.identityHashCode(methodAppearanceFineTuner);
@@ -89,7 +87,6 @@ final class ClassIntrospectorBuilder implements Cloneable {
         if (getClass() != obj.getClass()) return false;
         ClassIntrospectorBuilder other = (ClassIntrospectorBuilder) obj;
         
-        if (bugfixed != other.bugfixed) return false;
         if (exposeFields != other.exposeFields) return false;
         if (exposureLevel != other.exposureLevel) return false;
         if (methodAppearanceFineTuner != other.methodAppearanceFineTuner) return false;
@@ -191,9 +188,5 @@ final class ClassIntrospectorBuilder implements Cloneable {
             return new ClassIntrospector(this, new Object(), true, false);
         }
     }
-
-    public boolean isBugfixed() {
-        return bugfixed;
-    }
     
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedFixArgsMethods.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedFixArgsMethods.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedFixArgsMethods.java
index 672a69a..a1de28b 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedFixArgsMethods.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedFixArgsMethods.java
@@ -31,8 +31,8 @@ import org.apache.freemarker.core.model.TemplateModelException;
  */
 class OverloadedFixArgsMethods extends OverloadedMethodsSubset {
     
-    OverloadedFixArgsMethods(boolean bugfixed) {
-        super(bugfixed);
+    OverloadedFixArgsMethods() {
+        super();
     }
 
     @Override
@@ -84,15 +84,11 @@ class OverloadedFixArgsMethods extends OverloadedMethodsSubset {
         MaybeEmptyCallableMemberDescriptor maybeEmtpyMemberDesc = getMemberDescriptorForArgs(pojoArgs, false);
         if (maybeEmtpyMemberDesc instanceof CallableMemberDescriptor) {
             CallableMemberDescriptor memberDesc = (CallableMemberDescriptor) maybeEmtpyMemberDesc;
-            if (bugfixed) {
-                if (typeFlags != null) {
-                    // Note that overloaded method selection has already accounted for overflow errors when the method
-                    // was selected. So this forced conversion shouldn't cause such corruption. Except, conversion from
-                    // BigDecimal is allowed to overflow for backward-compatibility.
-                    forceNumberArgumentsToParameterTypes(pojoArgs, memberDesc.getParamTypes(), typeFlags);
-                }
-            } else {
-                BeansWrapper.coerceBigDecimals(memberDesc.getParamTypes(), pojoArgs);
+            if (typeFlags != null) {
+                // Note that overloaded method selection has already accounted for overflow errors when the method
+                // was selected. So this forced conversion shouldn't cause such corruption. Except, conversion from
+                // BigDecimal is allowed to overflow for backward-compatibility.
+                forceNumberArgumentsToParameterTypes(pojoArgs, memberDesc.getParamTypes(), typeFlags);
             }
             return new MemberAndArguments(memberDesc, pojoArgs);
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethods.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethods.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethods.java
index 3ceebe1..978e9d6 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethods.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethods.java
@@ -46,11 +46,9 @@ final class OverloadedMethods {
 
     private final OverloadedMethodsSubset fixArgMethods;
     private OverloadedMethodsSubset varargMethods;
-    private final boolean bugfixed;
     
-    OverloadedMethods(boolean bugfixed) {
-        this.bugfixed = bugfixed;
-        fixArgMethods = new OverloadedFixArgsMethods(bugfixed);
+    OverloadedMethods() {
+        fixArgMethods = new OverloadedFixArgsMethods();
     }
     
     void addMethod(Method method) {
@@ -64,11 +62,11 @@ final class OverloadedMethods {
     }
     
     private void addCallableMemberDescriptor(ReflectionCallableMemberDescriptor memberDesc) {
-        // Note: "varargs" methods are always callable as fixed args, with a sequence (array) as the last parameter.
+        // Note: "varargs" methods are always callable as oms args, with a sequence (array) as the last parameter.
         fixArgMethods.addCallableMemberDescriptor(memberDesc);
         if (memberDesc.isVarargs()) {
             if (varargMethods == null) {
-                varargMethods = new OverloadedVarArgsMethods(bugfixed);
+                varargMethods = new OverloadedVarArgsMethods();
             }
             varargMethods.addCallableMemberDescriptor(memberDesc);
         }
@@ -76,7 +74,7 @@ final class OverloadedMethods {
     
     MemberAndArguments getMemberAndArguments(List/*<TemplateModel>*/ tmArgs, BeansWrapper unwrapper) 
     throws TemplateModelException {
-        // Try to find a fixed args match:
+        // Try to find a oms args match:
         MaybeEmptyMemberAndArguments fixArgsRes = fixArgMethods.getMemberAndArguments(tmArgs, unwrapper);
         if (fixArgsRes instanceof MemberAndArguments) {
             return (MemberAndArguments) fixArgsRes;
@@ -100,10 +98,6 @@ final class OverloadedMethods {
                         tmArgs),
                 "\nThe matching overload was searched among these members:\n",
                 memberListToString());
-        if (!bugfixed) {
-            edb.tip("You seem to use BeansWrapper with incompatibleImprovements set below 2.3.21. If you think this "
-                    + "error is unfounded, enabling 2.3.21 fixes may helps. See version history for more.");
-        }
         addMarkupBITipAfterNoNoMarchIfApplicable(edb, tmArgs);
         throw new _TemplateModelException(edb);
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethodsSubset.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethodsSubset.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethodsSubset.java
index 3960d3c..8f41200 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethodsSubset.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedMethodsSubset.java
@@ -60,17 +60,14 @@ abstract class OverloadedMethodsSubset {
     private int[/*number of args*/][/*arg index*/] typeFlagsByParamCount;
     
     // TODO: This can cause memory-leak when classes are re-loaded. However, first the genericClassIntrospectionCache
-    // and such need to be fixed in this regard. 
+    // and such need to be oms in this regard. 
     private final Map/*<ArgumentTypes, MaybeEmptyCallableMemberDescriptor>*/ argTypesToMemberDescCache
             = new ConcurrentHashMap(6, 0.75f, 1);
     
     private final List/*<ReflectionCallableMemberDescriptor>*/ memberDescs = new LinkedList();
     
-    /** Enables 2.3.21 {@link BeansWrapper} incompatibleImprovements */
-    protected final boolean bugfixed;
-    
-    OverloadedMethodsSubset(boolean bugfixed) {
-        this.bugfixed = bugfixed;
+    OverloadedMethodsSubset() {
+        //
     }
     
     void addCallableMemberDescriptor(ReflectionCallableMemberDescriptor memberDesc) {
@@ -111,23 +108,19 @@ abstract class OverloadedMethodsSubset {
         }
 
         int[] typeFlagsByParamIdx = ALL_ZEROS_ARRAY;
-        if (bugfixed) {
-            // Fill typeFlagsByParamCount (if necessary)
-            for (int paramIdx = 0; paramIdx < paramCount; paramIdx++) {
-                final int typeFlags = TypeFlags.classToTypeFlags(prepedParamTypes[paramIdx]);
-                if (typeFlags != 0) {
-                    if (typeFlagsByParamIdx == ALL_ZEROS_ARRAY) {
-                        typeFlagsByParamIdx = new int[paramCount];
-                    }
-                    typeFlagsByParamIdx[paramIdx] = typeFlags;
+        // Fill typeFlagsByParamCount (if necessary)
+        for (int paramIdx = 0; paramIdx < paramCount; paramIdx++) {
+            final int typeFlags = TypeFlags.classToTypeFlags(prepedParamTypes[paramIdx]);
+            if (typeFlags != 0) {
+                if (typeFlagsByParamIdx == ALL_ZEROS_ARRAY) {
+                    typeFlagsByParamIdx = new int[paramCount];
                 }
+                typeFlagsByParamIdx[paramIdx] = typeFlags;
             }
-            mergeInTypesFlags(paramCount, typeFlagsByParamIdx);
         }
+        mergeInTypesFlags(paramCount, typeFlagsByParamIdx);
         
-        afterWideningUnwrappingHints(
-                bugfixed ? prepedParamTypes : unwrappingHintsByParamCount[paramCount],
-                typeFlagsByParamIdx);
+        afterWideningUnwrappingHints(prepedParamTypes, typeFlagsByParamIdx);
     }
     
     Class[][] getUnwrappingHintsByParamCount() {
@@ -137,7 +130,7 @@ abstract class OverloadedMethodsSubset {
     @SuppressFBWarnings(value="JLM_JSR166_UTILCONCURRENT_MONITORENTER",
             justification="Locks for member descriptor creation only")
     final MaybeEmptyCallableMemberDescriptor getMemberDescriptorForArgs(Object[] args, boolean varArg) {
-        ArgumentTypes argTypes = new ArgumentTypes(args, bugfixed);
+        ArgumentTypes argTypes = new ArgumentTypes(args);
         MaybeEmptyCallableMemberDescriptor memberDesc
                 = (MaybeEmptyCallableMemberDescriptor) argTypesToMemberDescCache.get(argTypes);
         if (memberDesc == null) {
@@ -180,54 +173,41 @@ abstract class OverloadedMethodsSubset {
         // This also means that the hint for (Integer, Integer) will be Integer, not just Number. This is consistent
         // with how non-overloaded method hints work.
         
-        if (bugfixed) {
-            // c1 primitive class to boxing class:
-            final boolean c1WasPrim; 
-            if (c1.isPrimitive()) {
-                c1 = _ClassUtil.primitiveClassToBoxingClass(c1);
-                c1WasPrim = true;
-            } else {
-                c1WasPrim = false;
-            }
-            
-            // c2 primitive class to boxing class:
-            final boolean c2WasPrim; 
-            if (c2.isPrimitive()) {
-                c2 = _ClassUtil.primitiveClassToBoxingClass(c2);
-                c2WasPrim = true;
-            } else {
-                c2WasPrim = false;
-            }
-    
-            if (c1 == c2) {
-                // If it was like int and Integer, boolean and Boolean, etc., we return the boxing type (as that's the
-                // less specific, because it allows null.)
-                // (If it was two equivalent primitives, we don't get here, because of the 1st line of the method.) 
-                return c1;
-            } else if (Number.class.isAssignableFrom(c1) && Number.class.isAssignableFrom(c2)) {
-                // We don't want the unwrapper to convert to a numerical super-type [*] as it's not yet known what the
-                // actual number type of the chosen method will be. We will postpone the actual numerical conversion
-                // until that, especially as some conversions (like fixed point to floating point) can be lossy.
-                // * Numerical super-type: Like long > int > short > byte.  
-                return Number.class;
-            } else if (c1WasPrim || c2WasPrim) {
-                // At this point these all stand:
-                // - At least one of them was primitive
-                // - No more than one of them was numerical
-                // - They don't have the same wrapper (boxing) class
-                return Object.class;
-            }
-            // Falls through
-        } else {  // old buggy behavior
-            if (c2.isPrimitive()) {
-                if (c2 == Byte.TYPE) c2 = Byte.class;
-                else if (c2 == Short.TYPE) c2 = Short.class;
-                else if (c2 == Character.TYPE) c2 = Character.class;
-                else if (c2 == Integer.TYPE) c2 = Integer.class;
-                else if (c2 == Float.TYPE) c2 = Float.class;
-                else if (c2 == Long.TYPE) c2 = Long.class;
-                else if (c2 == Double.TYPE) c2 = Double.class;
-            }
+        // c1 primitive class to boxing class:
+        final boolean c1WasPrim; 
+        if (c1.isPrimitive()) {
+            c1 = _ClassUtil.primitiveClassToBoxingClass(c1);
+            c1WasPrim = true;
+        } else {
+            c1WasPrim = false;
+        }
+        
+        // c2 primitive class to boxing class:
+        final boolean c2WasPrim; 
+        if (c2.isPrimitive()) {
+            c2 = _ClassUtil.primitiveClassToBoxingClass(c2);
+            c2WasPrim = true;
+        } else {
+            c2WasPrim = false;
+        }
+
+        if (c1 == c2) {
+            // If it was like int and Integer, boolean and Boolean, etc., we return the boxing type (as that's the
+            // less specific, because it allows null.)
+            // (If it was two equivalent primitives, we don't get here, because of the 1st line of the method.) 
+            return c1;
+        } else if (Number.class.isAssignableFrom(c1) && Number.class.isAssignableFrom(c2)) {
+            // We don't want the unwrapper to convert to a numerical super-type [*] as it's not yet known what the
+            // actual number type of the chosen method will be. We will postpone the actual numerical conversion
+            // until that, especially as some conversions (like oms point to floating point) can be lossy.
+            // * Numerical super-type: Like long > int > short > byte.  
+            return Number.class;
+        } else if (c1WasPrim || c2WasPrim) {
+            // At this point these all stand:
+            // - At least one of them was primitive
+            // - No more than one of them was numerical
+            // - They don't have the same wrapper (boxing) class
+            return Object.class;
         }
         
         // We never get to this point if buxfixed is true and any of these stands:
@@ -243,7 +223,7 @@ abstract class OverloadedMethodsSubset {
         }
         
         // Gather maximally specific elements. Yes, there can be more than one 
-        // thank to interfaces. I.e., if you call this method for String.class 
+        // because of interfaces. I.e., if you call this method for String.class 
         // and Number.class, you'll have Comparable, Serializable, and Object as 
         // maximal elements. 
         List max = new ArrayList();
@@ -270,35 +250,31 @@ abstract class OverloadedMethodsSubset {
         }
         
         if (max.size() > 1) {  // we have an ambiguity
-            if (bugfixed) {
-                // Find the non-interface class
-                for (Iterator it = max.iterator(); it.hasNext(); ) {
-                    Class maxCl = (Class) it.next();
-                    if (!maxCl.isInterface()) {
-                        if (maxCl != Object.class) {  // This actually shouldn't ever happen, but to be sure...
-                            // If it's not Object, we use it as the most specific
-                            return maxCl;
-                        } else {
-                            // Otherwise remove Object, and we will try with the interfaces 
-                            it.remove();
-                        }
+            // Find the non-interface class
+            for (Iterator it = max.iterator(); it.hasNext(); ) {
+                Class maxCl = (Class) it.next();
+                if (!maxCl.isInterface()) {
+                    if (maxCl != Object.class) {  // This actually shouldn't ever happen, but to be sure...
+                        // If it's not Object, we use it as the most specific
+                        return maxCl;
+                    } else {
+                        // Otherwise remove Object, and we will try with the interfaces 
+                        it.remove();
                     }
                 }
-                
-                // At this point we only have interfaces left.
-                // Try removing interfaces about which we know that they are useless as unwrapping hints:
-                max.remove(Cloneable.class);
-                if (max.size() > 1) {  // Still have an ambiguity...
-                    max.remove(Serializable.class);
-                    if (max.size() > 1) {  // Still had an ambiguity...
-                        max.remove(Comparable.class);
-                        if (max.size() > 1) {
-                            return Object.class; // Still had an ambiguity... no luck.
-                        }
+            }
+            
+            // At this point we only have interfaces left.
+            // Try removing interfaces about which we know that they are useless as unwrapping hints:
+            max.remove(Cloneable.class);
+            if (max.size() > 1) {  // Still have an ambiguity...
+                max.remove(Serializable.class);
+                if (max.size() > 1) {  // Still had an ambiguity...
+                    max.remove(Comparable.class);
+                    if (max.size() > 1) {
+                        return Object.class; // Still had an ambiguity... no luck.
                     }
                 }
-            } else {
-                return Object.class;
             }
         }
         
@@ -318,7 +294,6 @@ abstract class OverloadedMethodsSubset {
 
     /**
      * Updates the content of the {@link #typeFlagsByParamCount} field with the parameter type flags of a method.
-     * Don't call this when {@link #bugfixed} is {@code false}! 
      * 
      * @param dstParamCount The parameter count for which we want to merge in the type flags 
      * @param srcTypeFlagsByParamIdx If shorter than {@code dstParamCount}, its last item will be repeated until
@@ -415,8 +390,7 @@ abstract class OverloadedMethodsSubset {
                 // If arg isn't a number, we can't do any conversions anyway, regardless of the param type.
                 if (arg instanceof Number) {
                     final Class targetType = paramTypes[paramTypeIdx];
-                    final Number convertedArg = BeansWrapper.forceUnwrappedNumberToType(
-                            (Number) arg, targetType, bugfixed);
+                    final Number convertedArg = BeansWrapper.forceUnwrappedNumberToType((Number) arg, targetType);
                     if (convertedArg != null) {
                         args[argIdx] = convertedArg;
                     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedVarArgsMethods.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedVarArgsMethods.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedVarArgsMethods.java
index e5453a0..f4fa207 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedVarArgsMethods.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedVarArgsMethods.java
@@ -33,8 +33,8 @@ import org.apache.freemarker.core.model.TemplateModelException;
  */
 class OverloadedVarArgsMethods extends OverloadedMethodsSubset {
 
-    OverloadedVarArgsMethods(boolean bugfixed) {
-        super(bugfixed);
+    OverloadedVarArgsMethods() {
+        super();
     }
     
     /**
@@ -133,9 +133,7 @@ class OverloadedVarArgsMethods extends OverloadedMethodsSubset {
             }
         }
         
-        if (bugfixed) {
-            mergeInTypesFlags(paramCountOfWidened, wideningTypeFlags);
-        }
+        mergeInTypesFlags(paramCountOfWidened, wideningTypeFlags);
     }
     
     @Override
@@ -191,15 +189,11 @@ class OverloadedVarArgsMethods extends OverloadedMethodsSubset {
             } else {
                 return EmptyMemberAndArguments.noCompatibleOverload(((Integer) argsOrErrorIdx).intValue());
             }
-            if (bugfixed) {
-                if (typesFlags != null) {
-                    // Note that overloaded method selection has already accounted for overflow errors when the method
-                    // was selected. So this forced conversion shouldn't cause such corruption. Except, conversion from
-                    // BigDecimal is allowed to overflow for backward-compatibility.
-                    forceNumberArgumentsToParameterTypes(pojoArgsWithArray, memberDesc.getParamTypes(), typesFlags);
-                }
-            } else {
-                BeansWrapper.coerceBigDecimals(memberDesc.getParamTypes(), pojoArgsWithArray);
+            if (typesFlags != null) {
+                // Note that overloaded method selection has already accounted for overflow errors when the method
+                // was selected. So this forced conversion shouldn't cause such corruption. Except, conversion from
+                // BigDecimal is allowed to overflow for backward-compatibility.
+                forceNumberArgumentsToParameterTypes(pojoArgsWithArray, memberDesc.getParamTypes(), typesFlags);
             }
             return new MemberAndArguments(memberDesc, pojoArgsWithArray);
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/StaticModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/StaticModel.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/StaticModel.java
index 024e454..a302d8b 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/StaticModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/StaticModel.java
@@ -142,7 +142,7 @@ final class StaticModel implements TemplateHashModelEx {
                     String name = method.getName();
                     Object obj = map.get(name);
                     if (obj instanceof Method) {
-                        OverloadedMethods overloadedMethods = new OverloadedMethods(wrapper.is2321Bugfixed());
+                        OverloadedMethods overloadedMethods = new OverloadedMethods();
                         overloadedMethods.addMethod((Method) obj);
                         overloadedMethods.addMethod(method);
                         map.put(name, overloadedMethods);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/_BeansAPI.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/_BeansAPI.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/_BeansAPI.java
index a8c6680..9bc4880 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/_BeansAPI.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/_BeansAPI.java
@@ -60,7 +60,7 @@ public class _BeansAPI {
             throws NoSuchMethodException {
         if (args == null) args = _CollectionUtil.EMPTY_OBJECT_ARRAY;
         
-        final ArgumentTypes argTypes = new ArgumentTypes(args, true);
+        final ArgumentTypes argTypes = new ArgumentTypes(args);
         final List<ReflectionCallableMemberDescriptor> fixedArgMemberDescs
                 = new ArrayList<>();
         final List<ReflectionCallableMemberDescriptor> varArgsMemberDescs

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/impl/beans/_MethodUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/_MethodUtil.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/_MethodUtil.java
index 98b8dec..1dd995c 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/_MethodUtil.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/_MethodUtil.java
@@ -63,6 +63,7 @@ public final class _MethodUtil {
      *               But unlike in Java, primitive numerical types are {@code instanceof} {@link Number} here.</li>
      *         </ul> 
      */
+    // TODO Seems that we don't use the full functionality of this anymore, so we could simplify this. See usages.
     public static int isMoreOrSameSpecificParameterType(final Class specific, final Class generic, boolean bugfixed,
             int ifHigherThan) {
         if (ifHigherThan >= 4) return 0;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateNameFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateNameFormat.java b/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateNameFormat.java
index c3fda79..9f366f1 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateNameFormat.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateNameFormat.java
@@ -64,7 +64,7 @@ import org.apache.freemarker.core.util._StringUtil;
  * {@code foo//bar///baaz.ftl} is normalized to {@code foo/bar/baaz.ftl}. (In general, 0 long step names aren't
  * possible anymore.)</li>
  * 
- * <li>The {@code ".."} bugs of the legacy normalizer are fixed: {@code ".."} steps has removed the preceding
+ * <li>The {@code ".."} bugs of the legacy normalizer are oms: {@code ".."} steps has removed the preceding
  * {@code "."} or {@code "*"} or scheme steps, not treating them specially as they should be. Now these work as
  * expected. Examples: {@code "a/./../c"} has become to {@code "a/c"}, now it will be {@code "c"}; {@code "a/b/*}
  * {@code /../c"} has become to {@code "a/b/c"}, now it will be {@code "a/*}{@code /c"}; {@code "scheme://.."} has

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java b/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
index 3763d35..97e02cb 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
@@ -35,7 +35,6 @@ import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateNotFoundException;
 import org.apache.freemarker.core._CoreLogs;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.ast.BugException;
 import org.apache.freemarker.core.ast.MarkReleaserTemplateSpecifiedEncodingHandler;
 import org.apache.freemarker.core.ast.TemplateConfiguration;
@@ -99,30 +98,6 @@ public class DefaultTemplateResolver extends TemplateResolver {
     private boolean localizedLookup = true;
 
     private Configuration config;
-
-    /**
-     * Same as {@link #DefaultTemplateResolver(TemplateLoader, CacheStorage, Configuration)} with a new {@link SoftCacheStorage}
-     * as the 2nd parameter.
-     * 
-     * @since 2.3.21
-     */
-    public DefaultTemplateResolver(TemplateLoader templateLoader, Configuration config) {
-        this(templateLoader, _TemplateAPI.createDefaultCacheStorage(Configuration.VERSION_2_3_0), config);
-    }
-    
-    /**
-     * Same as
-     * {@link #DefaultTemplateResolver(TemplateLoader, CacheStorage, TemplateLookupStrategy, TemplateNameFormat, Configuration)}
-     * with {@link DefaultTemplateLookupStrategy#INSTANCE} and {@link DefaultTemplateNameFormatFM2#INSTANCE}.
-     * 
-     * @since 2.3.21
-     */
-    public DefaultTemplateResolver(TemplateLoader templateLoader, CacheStorage cacheStorage, Configuration config) {
-        this(templateLoader, cacheStorage,
-                _TemplateAPI.getDefaultTemplateLookupStrategy(Configuration.VERSION_2_3_0),
-                _TemplateAPI.getDefaultTemplateNameFormat(Configuration.VERSION_2_3_0),
-                config);
-    }
     
     /**
      * Same as
@@ -255,16 +230,7 @@ public class DefaultTemplateResolver extends TemplateResolver {
         _NullArgumentException.check("locale", locale);
         _NullArgumentException.check("encoding", encoding);
         
-        try {
-            name = templateNameFormat.normalizeRootBasedName(name);
-        } catch (MalformedTemplateNameException e) {
-            // If we don't have to emulate backward compatible behavior, then just rethrow it: 
-            if (templateNameFormat != DefaultTemplateNameFormatFM2.INSTANCE
-                    || config.getIncompatibleImprovements().intValue() >= _TemplateAPI.VERSION_INT_2_4_0) {
-                throw e;
-            }
-            return new GetTemplateResult(null, e);
-        }
+        name = templateNameFormat.normalizeRootBasedName(name);
         
         if (templateLoader == null) {
             return new GetTemplateResult(name, "The TemplateLoader (and TemplateLoader2) was null.");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/servlet/InitParamParser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/servlet/InitParamParser.java b/src/main/java/org/apache/freemarker/servlet/InitParamParser.java
index ee2b78d..2bfcba3 100644
--- a/src/main/java/org/apache/freemarker/servlet/InitParamParser.java
+++ b/src/main/java/org/apache/freemarker/servlet/InitParamParser.java
@@ -28,7 +28,6 @@ import java.util.regex.Pattern;
 import javax.servlet.ServletContext;
 
 import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.ast._ObjectBuilderSettingEvaluator;
 import org.apache.freemarker.core.ast._SettingEvaluationEnvironment;
 import org.apache.freemarker.core.templateresolver.TemplateLoader;
@@ -80,10 +79,9 @@ final class InitParamParser {
         } else if (pureTemplatePath.startsWith(TEMPLATE_PATH_PREFIX_FILE)) {
             String filePath = pureTemplatePath.substring(TEMPLATE_PATH_PREFIX_FILE.length());
             templateLoader = new FileTemplateLoader(new File(filePath));
-        } else if (pureTemplatePath.startsWith("[")
-                && cfg.getIncompatibleImprovements().intValue() >= _TemplateAPI.VERSION_INT_2_3_22) {
+        } else if (pureTemplatePath.startsWith("[")) {
             if (!pureTemplatePath.endsWith("]")) {
-                // B.C. constraint: Can't throw any checked exceptions.
+                // B.C. constraint: Can't throw any checked exceptions. [FM3] Fix it?
                 throw new TemplatePathParsingException("Failed to parse template path; closing \"]\" is missing.");
             }
             String commaSepItems = pureTemplatePath.substring(1, pureTemplatePath.length() - 1).trim();
@@ -94,9 +92,9 @@ final class InitParamParser {
                 templateLoaders[i] = createTemplateLoader(pathItem, cfg, classLoaderClass, srvCtx);
             }
             templateLoader = new MultiTemplateLoader(templateLoaders);
-        } else if (pureTemplatePath.startsWith("{")
-                && cfg.getIncompatibleImprovements().intValue() >= _TemplateAPI.VERSION_INT_2_3_22) {
-            throw new TemplatePathParsingException("Template paths starting with \"{\" are reseved for future purposes");
+        } else if (pureTemplatePath.startsWith("{")) {
+            throw new TemplatePathParsingException(
+                    "Template paths starting with \"{\" are reseved for future purposes");
         } else {
             templateLoader = new WebAppTemplateLoader(srvCtx, pureTemplatePath);
         }



[9/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.

Posted by dd...@apache.org.
Removed support for incompatibleImprovements below 3.0.0.


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

Branch: refs/heads/3
Commit: 8ba7883e52c4fc842f9fd0b09ec1fcc8ffafb30f
Parents: 410fd0d
Author: ddekany <dd...@apache.org>
Authored: Sat Feb 18 01:43:39 2017 +0100
Committer: ddekany <dd...@apache.org>
Committed: Mon Feb 20 11:11:34 2017 +0100

----------------------------------------------------------------------
 .../apache/freemarker/core/Configuration.java   | 359 +---------------
 .../org/apache/freemarker/core/Template.java    |   9 +-
 .../apache/freemarker/core/_TemplateAPI.java    |  30 +-
 .../ast/APINotSupportedTemplateException.java   |   5 -
 .../org/apache/freemarker/core/ast/BuiltIn.java |   6 -
 .../freemarker/core/ast/BuiltInsForDates.java   |   6 +-
 .../core/ast/BuiltInsForMultipleTypes.java      |  43 +-
 .../core/ast/BuiltInsForStringsEncoding.java    |  22 +-
 .../freemarker/core/ast/BuiltinVariable.java    |   9 +-
 .../freemarker/core/ast/Configurable.java       |  26 +-
 .../freemarker/core/ast/DynamicKeyName.java     |  10 +-
 .../apache/freemarker/core/ast/Environment.java |  43 +-
 .../apache/freemarker/core/ast/HashLiteral.java |  39 +-
 .../freemarker/core/ast/ICIChainMember.java     |  41 --
 .../apache/freemarker/core/ast/Interpret.java   |   2 +-
 .../NonListableRightUnboundedRangeModel.java    |  40 --
 .../org/apache/freemarker/core/ast/Range.java   |   5 +-
 .../core/ast/TemplateConfiguration.java         |   7 -
 .../core/ast/_SettingEvaluationEnvironment.java |   2 +-
 .../core/model/TemplateHashModelEx2.java        |   2 +-
 .../core/model/impl/DefaultObjectWrapper.java   |  10 +-
 .../impl/DefaultObjectWrapperConfiguration.java |   7 +-
 .../core/model/impl/_StaticObjectWrappers.java  |   6 +-
 .../core/model/impl/beans/ArgumentTypes.java    | 416 ++++++++-----------
 .../core/model/impl/beans/BeanModel.java        |   8 +-
 .../core/model/impl/beans/BeansWrapper.java     |  75 +---
 .../model/impl/beans/BeansWrapperBuilder.java   |   2 +-
 .../impl/beans/BeansWrapperConfiguration.java   |   2 +-
 .../model/impl/beans/ClassIntrospector.java     |   6 +-
 .../impl/beans/ClassIntrospectorBuilder.java    |  15 +-
 .../impl/beans/OverloadedFixArgsMethods.java    |  18 +-
 .../model/impl/beans/OverloadedMethods.java     |  16 +-
 .../impl/beans/OverloadedMethodsSubset.java     | 168 ++++----
 .../impl/beans/OverloadedVarArgsMethods.java    |  22 +-
 .../core/model/impl/beans/StaticModel.java      |   2 +-
 .../core/model/impl/beans/_BeansAPI.java        |   2 +-
 .../core/model/impl/beans/_MethodUtil.java      |   1 +
 .../impl/DefaultTemplateNameFormat.java         |   2 +-
 .../impl/DefaultTemplateResolver.java           |  36 +-
 .../freemarker/servlet/InitParamParser.java     |  12 +-
 .../servlet/jsp/FreeMarkerPageContext.java      |   8 +-
 src/main/javacc/FTL.jj                          | 129 +++---
 src/manual/en_US/FM3-CHANGE-LOG.txt             |   6 +-
 .../freemarker/core/ConfigurationTest.java      | 237 ++++-------
 .../freemarker/core/CustomAttributeTest.java    |  20 +-
 .../apache/freemarker/core/ExceptionTest.java   |   6 +-
 .../apache/freemarker/core/GetSourceTest.java   |   5 +-
 .../core/MistakenlyPublicImportAPIsTest.java    |  10 +-
 .../core/MistakenlyPublicMacroAPIsTest.java     |   7 +-
 .../freemarker/core/SimpleObjetWrapperTest.java |  40 +-
 .../core/TemplateConstructorsTest.java          |  11 +-
 .../core/TemplateLanguageVersionTest.java       |  17 +-
 .../core/TemplateLookupStrategyTest.java        |  19 +-
 .../core/TemplateNotFoundMessageTest.java       |  19 +-
 .../core/ast/ASTBasedErrorMessagesTest.java     |   5 -
 .../apache/freemarker/core/ast/ASTPrinter.java  |   3 +-
 .../freemarker/core/ast/BreakPlacementTest.java |   6 +-
 .../freemarker/core/ast/CanonicalFormTest.java  |   3 +-
 .../freemarker/core/ast/ConfigurableTest.java   |  11 +-
 .../freemarker/core/ast/DateFormatTest.java     |  39 +-
 .../core/ast/DirectiveCallPlaceTest.java        |   6 +-
 .../core/ast/EncodingOverrideTest.java          |   4 +-
 .../core/ast/EnvironmentCustomStateTest.java    |   6 +-
 .../ast/EnvironmentGetTemplateVariantsTest.java | 114 +++--
 .../freemarker/core/ast/HeaderParsingTest.java  |   4 +-
 .../IncludeAndImportConfigurableLayersTest.java |   5 +-
 .../core/ast/IncludeAndImportTest.java          |  11 +-
 .../freemarker/core/ast/IteratorIssuesTest.java |  86 +---
 .../freemarker/core/ast/NumberFormatTest.java   |  34 +-
 .../core/ast/ObjectBuilderSettingsTest.java     |  41 +-
 .../freemarker/core/ast/OutputFormatTest.java   |  71 +---
 .../core/ast/ParsingErrorMessagesTest.java      |   5 +-
 .../freemarker/core/ast/SQLTimeZoneTest.java    |   5 +-
 .../core/ast/SpecialVariableTest.java           |  10 +-
 .../ast/StringLiteralInterpolationTest.java     |   5 +-
 .../apache/freemarker/core/ast/TabSizeTest.java |   5 +-
 .../core/ast/TagSyntaxVariationsTest.java       |  84 +---
 .../core/ast/TemplatGetEncodingTest.java        |   3 +-
 .../core/ast/TemplateConfigurationTest.java     |  76 ++--
 ...teConfigurationWithTemplateResolverTest.java |  15 +-
 .../core/ast/TemplateLevelSettings.java         |  15 +-
 .../ast/TemplateNameSpecialVariablesTest.java   |  86 ++--
 .../core/ast/TheadInterruptingSupportTest.java  |   4 +-
 .../core/ast/UnclosedCommentTest.java           |  43 +-
 .../core/ast/WhitespaceStrippingTest.java       |   5 +-
 .../model/impl/DefaultObjectWrapperTest.java    | 416 +++++--------------
 .../impl/beans/BeansAPINewInstanceTest.java     |   9 +-
 .../model/impl/beans/BeansWrapperBasics.java    |  15 +-
 .../core/model/impl/beans/BeansWrapperDesc.java |  30 ++
 .../impl/beans/BeansWrapperDesc2003020.java     |  30 --
 .../impl/beans/BeansWrapperDesc2003021.java     |  30 --
 .../core/model/impl/beans/BeansWrapperInc.java  |  30 ++
 .../impl/beans/BeansWrapperInc2003020.java      |  30 --
 .../impl/beans/BeansWrapperInc2003021.java      |  30 --
 .../impl/beans/BeansWrapperSingletonsTest.java  | 174 +++-----
 .../CommonSupertypeForUnwrappingHintTest.java   | 112 ++---
 .../impl/beans/DefaultObjectWrapperDesc.java    |  30 ++
 .../beans/DefaultObjectWrapperDesc2003020.java  |  30 --
 .../beans/DefaultObjectWrapperDesc2003021.java  |  30 --
 .../beans/DefaultObjectWrapperDesc2003022.java  |  30 --
 .../impl/beans/DefaultObjectWrapperInc.java     |  30 ++
 .../beans/DefaultObjectWrapperInc2003020.java   |  30 --
 .../beans/DefaultObjectWrapperInc2003021.java   |  30 --
 .../beans/DefaultObjectWrapperInc2003022.java   |  30 --
 .../core/model/impl/beans/EnumModelsTest.java   |  11 +-
 .../model/impl/beans/ErrorMessagesTest.java     | 126 +++---
 .../core/model/impl/beans/IsApplicableTest.java |  22 +-
 .../impl/beans/MiscNumericalOperationsTest.java |  78 ++--
 .../core/model/impl/beans/ModelCacheTest.java   |  17 +-
 .../beans/ParameterListPreferabilityTest.java   |   8 +-
 .../core/model/impl/beans/StaticModelsTest.java |  13 +-
 .../core/model/impl/beans/TypeFlagsTest.java    |  10 +-
 .../DefaultTemplateResolverTest.java            |  34 +-
 .../FileTemplateLoaderTest.java                 |  10 +-
 .../TemplateConfigurationFactoryTest.java       |  10 +-
 .../TemplateNameFormatTest.java                 |   8 +-
 .../manualtest/GettingStartedExample.java       |   2 +-
 .../servlet/FreemarkerServletTest.java          |   3 +-
 .../servlet/jsp/RealServletContainertTest.java  |  62 ++-
 .../freemarker/servlet/jsp/TLDParsingTest.java  |  11 +-
 .../apache/freemarker/test/TemplateTest.java    |   2 +-
 .../freemarker/test/servlet/WebAppTestCase.java |   6 +-
 .../org/apache/freemarker/test/servlet/web.xml  | 101 -----
 .../test/templatesuite/TemplateTestCase.java    |  11 +-
 .../test/templatesuite/TemplateTestSuite.java   |   6 +-
 .../test/templatesuite/models/Listables.java    |  13 +-
 .../SimpleMapAndCollectionObjectWrapper.java    |  41 ++
 .../core/SimpleObjectWrapperTest.java           |  32 +-
 .../basic/WEB-INF/expected/attributes-2.3.0.txt |  68 ---
 .../expected/attributes-2.3.22-future.txt       |  73 ----
 .../expected/attributes-modernModels.txt        |  73 ++++
 .../servlet/jsp/webapps/basic/WEB-INF/web.xml   |  38 +-
 .../servlet/jsp/webapps/config/WEB-INF/web.xml  |   6 +-
 .../jsp/webapps/multipleLoaders/WEB-INF/web.xml |   2 +-
 .../jsp/webapps/tldDiscovery/WEB-INF/web.xml    |   4 +-
 .../org/apache/freemarker/test/servlet/web.xml  | 101 +++++
 .../expected/encoding-builtins-ici-2.3.20.txt   |  44 --
 .../expected/encoding-builtins.txt              |   4 +-
 .../expected/listhashliteral-ici-2.3.20.txt     |  39 --
 .../expected/listhashliteral-ici-2.3.21.txt     |  36 --
 .../templatesuite/expected/listhashliteral.txt  |  36 ++
 .../expected/type-builtins-ici-2.3.21.txt       |  33 --
 .../expected/type-builtins-ici-2.3.24.txt       |  33 --
 .../templatesuite/expected/type-builtins.txt    |   4 +-
 .../templates/dateformat-iso-bi-common.ftl      | 159 -------
 .../templates/dateformat-iso-bi-ici-2.3.21.ftl  |  23 -
 .../templates/dateformat-iso-bi.ftl             | 146 ++++++-
 .../templatesuite/templates/hashliteral.ftl     |  15 +-
 .../templatesuite/templates/number-format.ftl   |  20 +-
 .../overloaded-methods-2-bwici-2.3.20.ftl       | 285 -------------
 .../overloaded-methods-2-bwici-2.3.21.ftl       | 349 ----------------
 .../templates/overloaded-methods-2-common.ftl   |  89 ----
 .../overloaded-methods-2-desc-bwici-2.3.20.ftl  |  43 --
 .../overloaded-methods-2-inc-bwici-2.3.20.ftl   |  47 ---
 .../templates/overloaded-methods-23bc.ftl       |  69 ---
 .../templates/overloaded-methods.ftl            | 413 ++++++++++++++++++
 .../templates/range-ici-2.3.20.ftl              |  37 --
 .../templates/range-ici-2.3.21.ftl              |  50 ---
 .../test/templatesuite/templates/range.ftl      |  50 +++
 .../templates/string-builtins-ici-2.3.19.ftl    |  22 -
 .../templates/string-builtins-ici-2.3.20.ftl    |  21 -
 .../templates/string-builtins1.ftl              |   2 +-
 .../freemarker/test/templatesuite/testcases.xml | 147 +++----
 163 files changed, 2302 insertions(+), 4938 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/Configuration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/Configuration.java b/src/main/java/org/apache/freemarker/core/Configuration.java
index 73350b6..9538532 100644
--- a/src/main/java/org/apache/freemarker/core/Configuration.java
+++ b/src/main/java/org/apache/freemarker/core/Configuration.java
@@ -22,8 +22,6 @@ package org.apache.freemarker.core;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URLConnection;
-import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.Collection;
 import java.util.Collections;
@@ -67,24 +65,13 @@ import org.apache.freemarker.core.ast._DelayedJQuote;
 import org.apache.freemarker.core.ast._MiscTemplateException;
 import org.apache.freemarker.core.ast._ObjectBuilderSettingEvaluator;
 import org.apache.freemarker.core.ast._SettingEvaluationEnvironment;
-import org.apache.freemarker.core.util._UnmodifiableCompositeSet;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateHashModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateModelIterator;
 import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.TemplateSequenceModel;
-import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapperBuilder;
-import org.apache.freemarker.core.model.impl.SimpleCollection;
-import org.apache.freemarker.core.model.impl.SimpleDate;
-import org.apache.freemarker.core.model.impl.SimpleHash;
-import org.apache.freemarker.core.model.impl.SimpleObjectWrapper;
-import org.apache.freemarker.core.model.impl.SimpleSequence;
-import org.apache.freemarker.core.model.impl._StaticObjectWrappers;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
 import org.apache.freemarker.core.templateresolver.CacheStorage;
 import org.apache.freemarker.core.templateresolver.GetTemplateResult;
 import org.apache.freemarker.core.templateresolver.MalformedTemplateNameException;
@@ -102,18 +89,17 @@ import org.apache.freemarker.core.templateresolver.impl.FileTemplateLoader;
 import org.apache.freemarker.core.templateresolver.impl.MruCacheStorage;
 import org.apache.freemarker.core.templateresolver.impl.MultiTemplateLoader;
 import org.apache.freemarker.core.templateresolver.impl.SoftCacheStorage;
-import org.apache.freemarker.core.templateresolver.impl.URLTemplateLoader;
 import org.apache.freemarker.core.util.CaptureOutput;
-import org.apache.freemarker.core.util._ClassUtil;
-import org.apache.freemarker.core.model.Constants;
 import org.apache.freemarker.core.util.HtmlEscape;
 import org.apache.freemarker.core.util.NormalizeNewlines;
-import org.apache.freemarker.core.util._NullArgumentException;
-import org.apache.freemarker.core.util._SecurityUtil;
 import org.apache.freemarker.core.util.StandardCompress;
-import org.apache.freemarker.core.util._StringUtil;
 import org.apache.freemarker.core.util.XmlEscape;
+import org.apache.freemarker.core.util._ClassUtil;
+import org.apache.freemarker.core.util._NullArgumentException;
+import org.apache.freemarker.core.util._SecurityUtil;
 import org.apache.freemarker.core.util._SortedArraySet;
+import org.apache.freemarker.core.util._StringUtil;
+import org.apache.freemarker.core.util._UnmodifiableCompositeSet;
 
 /**
  * <b>The main entry point into the FreeMarker API</b>; encapsulates the configuration settings of FreeMarker,
@@ -396,38 +382,11 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
     /** Enable auto-escaping if the {@link OutputFormat} supports it. */
     public static final int ENABLE_IF_SUPPORTED_AUTO_ESCAPING_POLICY = 22;
     
-    /** FreeMarker version 2.3.0 (an {@link #Configuration(Version) incompatible improvements break-point}) */
-    public static final Version VERSION_2_3_0 = new Version(2, 3, 0);
-    
-    /** FreeMarker version 2.3.19 (an {@link #Configuration(Version) incompatible improvements break-point}) */
-    public static final Version VERSION_2_3_19 = new Version(2, 3, 19);
-    
-    /** FreeMarker version 2.3.20 (an {@link #Configuration(Version) incompatible improvements break-point}) */
-    public static final Version VERSION_2_3_20 = new Version(2, 3, 20);
-    
-    /** FreeMarker version 2.3.21 (an {@link #Configuration(Version) incompatible improvements break-point}) */
-    public static final Version VERSION_2_3_21 = new Version(2, 3, 21);
-
-    /** FreeMarker version 2.3.22 (an {@link #Configuration(Version) incompatible improvements break-point}) */
-    public static final Version VERSION_2_3_22 = new Version(2, 3, 22);
-
-    /** FreeMarker version 2.3.23 (an {@link #Configuration(Version) incompatible improvements break-point}) */
-    public static final Version VERSION_2_3_23 = new Version(2, 3, 23);
-
-    /** FreeMarker version 2.3.24 (an {@link #Configuration(Version) incompatible improvements break-point}) */
-    public static final Version VERSION_2_3_24 = new Version(2, 3, 24);
-
-    /** FreeMarker version 2.3.25 (an {@link #Configuration(Version) incompatible improvements break-point}) */
-    public static final Version VERSION_2_3_25 = new Version(2, 3, 25);
-
-    /** FreeMarker version 2.3.26 (an {@link #Configuration(Version) incompatible improvements break-point}) */
-    public static final Version VERSION_2_3_26 = new Version(2, 3, 26);
-    
     /** FreeMarker version 3.0.0 (an {@link #Configuration(Version) incompatible improvements break-point}) */
     public static final Version VERSION_3_0_0 = new Version(3, 0, 0);
     
-    /** The default of {@link #getIncompatibleImprovements()}, currently {@link #VERSION_2_3_0}. */
-    public static final Version DEFAULT_INCOMPATIBLE_IMPROVEMENTS = Configuration.VERSION_2_3_0;
+    /** The default of {@link #getIncompatibleImprovements()}, currently {@link #VERSION_3_0_0}. */
+    public static final Version DEFAULT_INCOMPATIBLE_IMPROVEMENTS = Configuration.VERSION_3_0_0;
     /** @deprecated Use {@link #DEFAULT_INCOMPATIBLE_IMPROVEMENTS} instead. */
     @Deprecated
     public static final String DEFAULT_INCOMPATIBLE_ENHANCEMENTS = DEFAULT_INCOMPATIBLE_IMPROVEMENTS.toString();
@@ -477,24 +436,6 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
         }
     }
     
-    private static final String FM_24_DETECTION_CLASS_NAME = "org.apache.freemarker.core.ast._2_4_OrLaterMarker";
-    private static final boolean FM_24_DETECTED;
-    static {
-        boolean fm24detected;
-        try {
-            Class.forName(FM_24_DETECTION_CLASS_NAME);
-            fm24detected = true;
-        } catch (ClassNotFoundException e) {
-            fm24detected = false;
-        } catch (LinkageError e) {
-            fm24detected = true;
-        } catch (Throwable e) {
-            // Unexpected. We assume that there's no clash.
-            fm24detected = false;
-        }
-        FM_24_DETECTED = fm24detected;
-    }
-    
     private final static Object defaultConfigLock = new Object();
 
     private static volatile Configuration defaultConfig;
@@ -574,274 +515,19 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
      * <p>Currently the effects of this setting are:
      * <ul>
      *   <li><p>
-     *     2.3.0: This is the lowest supported value, the version used in older projects. This is the default in the
-     *     FreeMarker 2.3.x series.
-     *   </li>
-     *   <li><p>
-     *     2.3.19 (or higher): Bug fix: Wrong {@code #} tags were printed as static text instead of
-     *     causing parsing error when there was no correct {@code #} or {@code @} tag earlier in the
-     *     same template.
-     *   </li>
-     *   <li><p>
-     *     2.3.20 (or higher): {@code ?html} will escape apostrophe-quotes just like {@code ?xhtml} does. Utilizing
-     *     this is highly recommended, because otherwise if interpolations are used inside attribute values that use
-     *     apostrophe-quotation (<tt>&lt;foo bar='${val}'&gt;</tt>) instead of plain quotation mark
-     *     (<tt>&lt;foo bar="${val}"&gt;</tt>), they might produce HTML/XML that's not well-formed. Note that
-     *     {@code ?html} didn't do this because long ago there was no cross-browser way of doing this, but it's not a
-     *     concern anymore.
-     *   </li>
-     *   <li><p>
-     *     2.3.21 (or higher):
-     *     <ul>
-     *       <li><p>
-     *         The <em>default</em> of the {@code object_wrapper} setting ({@link #getObjectWrapper()}) changes from
-     *         {@code ObjectWrapper.DEFAULT_WRAPPER} to another almost identical {@link DefaultObjectWrapper} singleton,
-     *         returned by {@link DefaultObjectWrapperBuilder#build()}. The new default object wrapper's
-     *         "incompatible improvements" version is set to the same as of the {@link Configuration}.
-     *         See {@link BeansWrapper#BeansWrapper(Version)} for further details. Furthermore, the new default
-     *         object wrapper doesn't allow changing its settings; setter methods throw {@link IllegalStateException}).
-     *         (If anything tries to call setters on the old default in your application, that's a dangerous bug that
-     *         won't remain hidden now. As the old default is a singleton too, potentially shared by independently
-     *         developed components, most of them expects the out-of-the-box behavior from it (and the others are
-     *         necessarily buggy). Also, then concurrency glitches can occur (and even pollute the class introspection
-     *         templateResolver) because the singleton is modified after publishing to other threads.)
-     *         Furthermore the new default object wrapper shares class introspection templateResolver with other
-     *         {@link BeansWrapper}-s created with {@link BeansWrapperBuilder}, which has an impact as
-     *         {@link BeansWrapper#clearClassIntrospecitonCache()} will be disallowed; see more about it there.
-     *       </li>
-     *       <li><p>
-     *          The {@code ?iso_...} built-ins won't show the time zone offset for {@link java.sql.Time} values anymore,
-     *          because most databases store time values that aren't in any time zone, but just store hour, minute,
-     *          second, and decimal second field values. If you still want to show the offset (like for PostgreSQL
-     *          "time with time zone" columns you should), you can force showing the time zone offset by using
-     *          {@code myTime?string.iso_fz} (and its other variants).
-     *       </li>
-     *       <li><p>{@code ?is_enumerable} correctly returns {@code false} for Java methods get from Java objects that
-     *         are wrapped with {@link BeansWrapper} and its subclasses, like {@link DefaultObjectWrapper}. Although
-     *         method values implement {@link TemplateSequenceModel} (because of a historical design quirk in
-     *         {@link BeansWrapper}), trying to {@code #list} them will cause error, hence they aren't enumerable.
-     *       </li>
-     *       <li><p>
-     *          {@code ?c} will return {@code "INF"}, {@code "-INF"} and {@code "NaN"} for positive/negative infinity
-     *          and IEEE floating point Not-a-Number, respectively. These are the XML Schema compatible representations
-     *          of these special values. Earlier it has returned what {@link DecimalFormat} did with US locale, none of
-     *          which was understood by any (common) computer language.
-     *       </li>
-     *       <li><p>
-     *          FTL hash literals that repeat keys now only have the key once with {@code ?keys}, and only has the last
-     *          value associated to that key with {@code ?values}. This is consistent with the behavior of
-     *          {@code hash[key]} and how maps work in Java.       
-     *       </li>
-     *       <li><p>In most cases (where FreeMarker is able to do that), for {@link TemplateLoader}-s that use
-     *         {@link URLConnection}, {@code URLConnection#setUseCaches(boolean)} will called with {@code false},
-     *         so that only FreeMarker will do caching, not the URL scheme's handler.
-     *         See {@link URLTemplateLoader#setURLConnectionUsesCaches(Boolean)} for more details.
-     *       </li>
-     *       <li><p>
-     *         The default of the {@code template_loader} setting ({@link Configuration#getTemplateLoader()}) changes
-     *         to {@code null}, which means that FreeMarker will not find any templates. Earlier
-     *         the default was a {@link FileTemplateLoader} that used the current directory as the root. This was
-     *         dangerous and fragile as you usually don't have good control over what the current directory will be.
-     *         Luckily, the old default almost never looked for the templates at the right place
-     *         anyway, so pretty much all applications had to set the {@code template_loader} setting, so it's unlikely
-     *         that changing the default breaks your application.
-     *       </li>
-     *       <li><p>
-     *          Right-unlimited ranges become readable (like listable), so {@code <#list 1.. as i>...</#list>} works.
-     *          Earlier they were only usable for slicing (like {@code hits[10..]}).
-     *       </li>
-     *       <li><p>
-     *          Empty ranges return {@link Constants#EMPTY_SEQUENCE} instead of an empty {@link SimpleSequence}. This
-     *          is in theory backward compatible, as the API only promises to give something that implements
-     *          {@link TemplateSequenceModel}.
-     *       </li>
-     *       <li><p>
-     *          Unclosed comments ({@code <#-- ...}) and {@code #noparse}-s won't be silently closed at the end of
-     *          template anymore, but cause a parsing error instead.
-     *       </li>
-     *     </ul>
-     *   </li>
-     *   <li><p>
-     *     2.3.22 (or higher):
-     *     <ul>
-     *       <li><p>
-     *          {@link DefaultObjectWrapper} has some substantial changes with {@code incompatibleImprovements} 2.3.22;
-     *          check them out at {@link DefaultObjectWrapper#DefaultObjectWrapper(Version)}. It's important to know
-     *          that if you set the {@code object_wrapper} setting (to an other value than {@code "default"}), rather
-     *          than leaving it on its default value, the {@code object_wrapper} won't inherit the
-     *          {@code incompatibleImprovements} of the {@link Configuration}. In that case, if you want the 2.3.22
-     *          improvements of {@link DefaultObjectWrapper}, you have to set it in the {@link DefaultObjectWrapper}
-     *          object itself too! (Note that it's OK to use a {@link DefaultObjectWrapper} with a different
-     *          {@code incompatibleImprovements} version number than that of the {@link Configuration}, if that's
-     *          really what you want.)
-     *       </li>
-     *       <li><p>
-     *          In templates, {@code .template_name} will <em>always</em> return the main (top level) template's name.
-     *          It won't be affected by {@code #include} and {@code #nested} anymore. This is unintended, a bug with
-     *          {@code incompatible_improvement} 2.3.22 (a consequence of the lower level fixing described in the next
-     *          point). The old behavior of {@code .template_name} is restored if you set
-     *          {@code incompatible_improvement} to 2.3.23 (while {@link Configurable#getParent()}) of
-     *          {@link Environment} keeps the changed behavior shown in the next point). 
-     *       </li>
-     *       <li><p>
-     *          {@code #include} and {@code #nested} doesn't change the parent {@link Template} (see
-     *          {@link Configurable#getParent()}) of the {@link Environment} anymore to the {@link Template} that's
-     *          included or whose namespace {@code #nested} "returns" to. Thus, the parent of {@link Environment} will
-     *          be now always the main {@link Template}. (The main {@link Template} is the {@link Template} whose
-     *          {@code process} or {@code createProcessingEnvironment} method was called to initiate the output
-     *          generation.) Note that apart from the effect on FTL's {@code .template_name} (see
-     *          previous point), this should only matter if you have set settings directly on {@link Template} objects,
-     *          and almost nobody does that. Also note that macro calls have never changed the {@link Environment}
-     *          parent to the {@link Template} that contains the macro definition, so this mechanism was always broken.
-     *          As now we consistently never change the parent, the behavior when calling macros didn't change.
-     *       </li>
-     *       <li><p>
-     *          When using {@code org.apache.freemarker.servlet.FreemarkerServlet}:
-     *          <ul>
-     *             <li>
-     *               <p>When using custom JSP tag libraries: Fixes bug where some kind of
-     *               values, when put into the JSP <em>page</em> scope (via {@code #global} or via the JSP
-     *               {@code PageContext} API) and later read back with the JSP {@code PageContext} API (typically in a
-     *               custom JSP tag), might come back as FreeMarker {@link TemplateModel} objects instead of as objects
-     *               with a standard Java type. Other Servlet scopes aren't affected. It's highly unlikely that
-     *               something expects the presence of this bug. The affected values are of the FTL types listed below,
-     *               and to trigger the bug, they either had to be created directly in the template (like as an FTL
-     *               literal or with {@code ?date}/{@code time}/{@code datetime}), or you had to use
-     *               {@link DefaultObjectWrapper} or {@link SimpleObjectWrapper} (or a subclass of them):
-     *               
-     *               <ul>
-     *                 <li>FTL date/time/date-time values may came back as {@link SimpleDate}-s, now they come back as
-     *                 {@link java.util.Date java.util.Date}-s instead.</li>
-     *             
-     *                 <li>FTL sequence values may came back as {@link SimpleSequence}-s, now they come back as
-     *                 {@link java.util.List}-s as expected. This at least stands assuming that the
-     *                 {@link Configuration#setSetting(String, String) object_wrapper} configuration setting is a
-     *                 subclass of {@link BeansWrapper} (such as {@link DefaultObjectWrapper}, which is the default),
-     *                 but that's practically always the case in applications that use FreeMarker's JSP extension
-     *                 (otherwise it can still work, but it depends on the quality and capabilities of the
-     *                 {@link ObjectWrapper} implementation).</li>
-     *             
-     *                 <li>FTL hash values may came back as {@link SimpleHash}-es, now they come back as
-     *                 {@link java.util.Map}-s as expected (again, assuming that the object wrapper is a subclass of
-     *                 {@link BeansWrapper}, like preferably {@link DefaultObjectWrapper}, which is also the default).
-     *                 </li>
-     *             
-     *                 <li>FTL collection values may came back as {@link SimpleCollection}-s, now they come back as
-     *                 {@link java.util.Collection}-s as expected (again, assuming that the object wrapper is a subclass
-     *                 of {@link BeansWrapper}, like preferably {@link DefaultObjectWrapper}).</li>
-     *               </ul>
-     *             </li>
-     *             <li><p>
-     *               Initial {@code "["} in the {@code TemplatePath} init-param
-     *               has special meaning; it's used for specifying multiple comma separated locations, like in
-     *               {@code <param-value>[ WEB-INF/templates, classpath:com/example/myapp/templates ]</param-value>}
-     *             </li>
-     *             <li><p>
-     *               Initial <tt>"{"</tt> in the {@code TemplatePath} init-param is reserved for future purposes, and
-     *               thus will throw exception.
-     *             </li>
-     *          </ul>
-     *       </li>
-     *     </ul>
-     *   </li>
-     *   <li><p>
-     *     2.3.23 (or higher):
-     *     <ul>
-     *       <li><p>
-     *          Fixed a loophole in the implementation of the long existing parse-time rule that says that
-     *          {@code #break}, in the FTL source code itself, must occur nested inside a breakable directive, such as
-     *          {@code #list} or {@code #switch}. This check could be circumvented with {@code #macro} or
-     *          {@code #function}, like this:
-     *          {@code <#list 1..1 as x><#macro callMeLater><#break></#macro></#list><@callMeLater />}.
-     *          After activating this fix, this will be a parse time error.
-     *       </li>
-     *       <li><p>
-     *          If you have used {@code incompatible_improvements} 2.3.22 earlier, know that there the behavior of the
-     *          {@code .template_name} special variable used in templates was accidentally altered, but now it's
-     *          restored to be backward compatible with 2.3.0. (Ironically, the restored legacy behavior itself is
-     *          broken when it comes to macro invocations, we just keep it for backward compatibility. If you need fixed
-     *          behavior, use {@code .current_template_name} or {@code .main_template_name} instead.)
-     *       </li>
-     *     </ul>
-     *   </li>
-     *   <li><p>
-     *     2.3.24 (or higher):
-     *     <ul>
-     *       <li><p>
-     *          The default of the
-     *          {@link #setRecognizeStandardFileExtensions(boolean) recognize_standard_file_extensions}
-     *          setting changes to {@code true}, which means that templates whose name ends with {@code ".ftlh"} or
-     *          {@code ".ftlx"} will automatically get {@link HTMLOutputFormat#INSTANCE} or
-     *          {@link XMLOutputFormat#INSTANCE} output format respectively, in both cases with
-     *          {@link #ENABLE_IF_DEFAULT_AUTO_ESCAPING_POLICY} {@link #setAutoEscapingPolicy(int) auto_escaping_policy}.
-     *          These "file" extensions aren't case sensitive.
-     *       </li>
-     *       <li><p>
-     *          In number format and date format strings (like in the {@code number_format} setting, or in templates in
-     *          {@code n?string("0.##")}), an initial {@code '@'} has special meaning; they refer to a custom format
-     *          with the name given after the {@code @} (see: {@link #setCustomNumberFormats(Map)},
-     *          {@link #setCustomDateFormats(Map)}, {@link #setNumberFormat(String)}, and {@link #setDateTimeFormat}).
-     *          If the custom format doesn't exist, that will be an error. To have a literal {@code @} as the first
-     *          character in the output, it has to be written as {@code @@}. Again, all this only applies to the very
-     *          first character of the format string, so {@code @} characters elsewhere must not be doubled. Also, if
-     *          there are any custom formats defined, initial {@code '@'} will have the new meaning regardless of
-     *          the value of the {@code incompatible_improvements} setting. So you don't need to set the
-     *          {@code incompatible_improvements} only to use custom formats. 
-     *       </li>
-     *       <li><p>
-     *          Expressions inside interpolations that were inside <em>string literal expressions</em>
-     *          (not <code>${...}</code>-s in general), like in <code>&lt;#assign s="Hello ${name}!"&gt;</code>, has
-     *          always used {@code incompatbileImprovement}-s 0 (2.3.0 in effect). Now it's fixed.
-     *       </li>
-     *       <li><p>
-     *          {@link DefaultObjectWrapper} has some minor changes with {@code incompatibleImprovements} 2.3.24;
-     *          check them out at {@link DefaultObjectWrapper#DefaultObjectWrapper(Version)}. It's important to know
-     *          that if you set the {@code object_wrapper} setting (to an other value than {@code "default"}), rather
-     *          than leaving it on its default value, the {@code object_wrapper} won't inherit the
-     *          {@code incompatibleImprovements} of the {@link Configuration}. In that case, if you want the 2.3.24
-     *          improvements of {@link DefaultObjectWrapper}, you have to set it in the {@link DefaultObjectWrapper}
-     *          object itself too! (Note that it's OK to use a {@link DefaultObjectWrapper} with a different
-     *          {@code incompatibleImprovements} version number than that of the {@link Configuration}, if that's
-     *          really what you want.)
-     *       </li>
-     *       <li><p>
-     *          Fixed bug: The {@code #import} directive meant to copy the library variable into a global variable if
-     *          it's executed in the main namespace, but that haven't happened when the imported template was already
-     *          imported earlier in another namespace. 
-     *       </li>
-     *       <li><p>
-     *          {@code ?is_sequence} doesn't return {@code true} for Java methods wrapped by {@link BeansWrapper} and
-     *          its subclasses (most notably {@link DefaultObjectWrapper}) anymore, as they only implement the
-     *          {@code [index]} operator, but not {@code ?size}, which causes {@code <#list ...>} to fail among others.
-     *          (They shouldn't implement either, but this is historical heritage.)
-     *     </ul>
-     *   </li>
-     *   <li><p>
-     *     2.3.25 (or higher):
-     *     <ul>
-     *       <li><p>
-     *          When calling {@link Configurable#setAutoIncludes(List)} on a {@link Configuration}, it filters out
-     *          duplicates from the list, similarly as repeatedly calling {@link Configurable#addAutoInclude(String)}
-     *          would, hence avoiding repeated inclusions. Calling {@link Configurable#setAutoIncludes(List)} on other
-     *          {@link Configurable}-s always do this filtering regardless of the incompatible improvements setting. 
-     *     </ul>
+     *     3.0.0: This is the lowest supported value in FreeMarker 3.
      *   </li>
      * </ul>
      * 
      * @throws IllegalArgumentException
      *             If {@code incompatibleImmprovements} refers to a version that wasn't released yet when the currently
-     *             used FreeMarker version was released, or is less than 2.3.0, or is {@code null}.
+     *             used FreeMarker version was released, or is less than 3.0.0, or is {@code null}.
      * 
      * @since 2.3.21
      */
     public Configuration(Version incompatibleImprovements) {
         super(incompatibleImprovements);
         
-        // We postpone this until here (rather that doing this in static initializer) for two reason:
-        // - Class initialization errors are often not reported very well
-        // - This way we avoid the error if FM isn't actually used
-        checkFreeMarkerVersionClash();
-        
         _NullArgumentException.check("incompatibleImprovements", incompatibleImprovements);
         this.incompatibleImprovements = incompatibleImprovements;
         
@@ -849,14 +535,6 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
         loadBuiltInSharedVariables();
     }
 
-    private static void checkFreeMarkerVersionClash() {
-        if (FM_24_DETECTED) {
-            throw new RuntimeException("Clashing FreeMarker versions (" + VERSION + " and some post-2.3.x) detected: "
-                    + "found post-2.3.x class " + FM_24_DETECTION_CLASS_NAME + ". You probably have two different "
-                    + "freemarker.jar-s in the classpath.");
-        }
-    }
-    
     private void createTemplateResolver() {
         templateResolver = new DefaultTemplateResolver(
                 null,
@@ -926,10 +604,6 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
         return getDefaultTemplateExceptionHandler(getIncompatibleImprovements());
     }
     
-    private boolean getDefaultLogTemplateExceptions() {
-        return getDefaultLogTemplateExceptions(getIncompatibleImprovements());
-    }
-    
     private ObjectWrapper getDefaultObjectWrapper() {
         return getDefaultObjectWrapper(getIncompatibleImprovements());
     }
@@ -938,11 +612,6 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
     final static TemplateExceptionHandler getDefaultTemplateExceptionHandler(Version incompatibleImprovements) {
         return TemplateExceptionHandler.DEBUG_HANDLER;
     }
-
-    // Package visible as Configurable needs this to initialize the field defaults.
-    final static boolean getDefaultLogTemplateExceptions(Version incompatibleImprovements) {
-        return true;
-    }
     
     @Override
     public Object clone() {
@@ -1608,7 +1277,7 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
      */
     public void unsetLogTemplateExceptions() {
         if (logTemplateExceptionsExplicitlySet) {
-            setLogTemplateExceptions(getDefaultLogTemplateExceptions());
+            setLogTemplateExceptions(false);
             logTemplateExceptionsExplicitlySet = false;
         }
     }
@@ -2098,7 +1767,7 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
     @Override
     public boolean getRecognizeStandardFileExtensions() {
         return recognizeStandardFileExtensions == null
-                ? incompatibleImprovements.intValue() >= _TemplateAPI.VERSION_INT_2_3_24
+                ? true
                 : recognizeStandardFileExtensions.booleanValue();
     }
 
@@ -3128,11 +2797,7 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
      * @since 2.3.21
      */
     public static ObjectWrapper getDefaultObjectWrapper(Version incompatibleImprovements) {
-        if (incompatibleImprovements.intValue() < _TemplateAPI.VERSION_INT_2_3_21) {
-            return _StaticObjectWrappers.DEFAULT_OBJECT_WRAPPER;
-        } else {
-            return new DefaultObjectWrapperBuilder(incompatibleImprovements).build();
-        }
+        return new DefaultObjectWrapperBuilder(incompatibleImprovements).build();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/Template.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/Template.java b/src/main/java/org/apache/freemarker/core/Template.java
index 9c97c5c..1f7c83a 100644
--- a/src/main/java/org/apache/freemarker/core/Template.java
+++ b/src/main/java/org/apache/freemarker/core/Template.java
@@ -369,14 +369,7 @@ public class Template extends Configurable {
 
     private static Version normalizeTemplateLanguageVersion(Version incompatibleImprovements) {
         _TemplateAPI.checkVersionNotNullAndSupported(incompatibleImprovements);
-        int v = incompatibleImprovements.intValue();
-        if (v < _TemplateAPI.VERSION_INT_2_3_19) {
-            return Configuration.VERSION_2_3_0;
-        } else if (v > _TemplateAPI.VERSION_INT_2_3_21) {
-            return Configuration.VERSION_2_3_21;
-        } else { // if 2.3.19 or 2.3.20 or 2.3.21
-            return incompatibleImprovements;
-        }
+        return Configuration.VERSION_3_0_0;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/_TemplateAPI.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/_TemplateAPI.java b/src/main/java/org/apache/freemarker/core/_TemplateAPI.java
index bf3ffb0..8eefbd6 100644
--- a/src/main/java/org/apache/freemarker/core/_TemplateAPI.java
+++ b/src/main/java/org/apache/freemarker/core/_TemplateAPI.java
@@ -25,8 +25,6 @@ import org.apache.freemarker.core.ast.Expression;
 import org.apache.freemarker.core.ast.OutputFormat;
 import org.apache.freemarker.core.ast.TemplateObject;
 import org.apache.freemarker.core.templateresolver.CacheStorage;
-import org.apache.freemarker.core.templateresolver.TemplateLookupStrategy;
-import org.apache.freemarker.core.templateresolver.TemplateNameFormat;
 import org.apache.freemarker.core.util._NullArgumentException;
 
 /**
@@ -36,16 +34,7 @@ import org.apache.freemarker.core.util._NullArgumentException;
  */ 
 public class _TemplateAPI {
     
-    public static final int VERSION_INT_2_3_0 = Configuration.VERSION_2_3_0.intValue();
-    public static final int VERSION_INT_2_3_19 = Configuration.VERSION_2_3_19.intValue();
-    public static final int VERSION_INT_2_3_20 = Configuration.VERSION_2_3_20.intValue();
-    public static final int VERSION_INT_2_3_21 = Configuration.VERSION_2_3_21.intValue();
-    public static final int VERSION_INT_2_3_22 = Configuration.VERSION_2_3_22.intValue();
-    public static final int VERSION_INT_2_3_23 = Configuration.VERSION_2_3_23.intValue();
-    public static final int VERSION_INT_2_3_24 = Configuration.VERSION_2_3_24.intValue();
-    public static final int VERSION_INT_2_3_25 = Configuration.VERSION_2_3_25.intValue();
-    public static final int VERSION_INT_2_3_26 = Configuration.VERSION_2_3_26.intValue();
-    public static final int VERSION_INT_2_4_0 = Version.intValueFor(2, 4, 0);
+    public static final int VERSION_INT_3_0_0 = Configuration.VERSION_3_0_0.intValue();
     
     public static void checkVersionNotNullAndSupported(Version incompatibleImprovements) {
         _NullArgumentException.check("incompatibleImprovements", incompatibleImprovements);
@@ -55,8 +44,9 @@ public class _TemplateAPI {
                     + incompatibleImprovements + ", but the installed FreeMarker version is only "
                     + Configuration.getVersion() + ". You may need to upgrade FreeMarker in your project.");
         }
-        if (iciV < VERSION_INT_2_3_0) {
-            throw new IllegalArgumentException("\"incompatibleImprovements\" must be at least 2.3.0.");
+        if (iciV < VERSION_INT_3_0_0) {
+            throw new IllegalArgumentException("\"incompatibleImprovements\" must be at least 3.0.0, but was "
+                    + incompatibleImprovements);
         }
     }
     
@@ -73,22 +63,10 @@ public class _TemplateAPI {
         return Configuration.getDefaultTemplateExceptionHandler(incompatibleImprovements);
     }
 
-    public static boolean getDefaultLogTemplateExceptions(Version incompatibleImprovements) {
-        return Configuration.getDefaultLogTemplateExceptions(incompatibleImprovements);
-    }
-
     public static CacheStorage createDefaultCacheStorage(Version incompatibleImprovements) {
         return Configuration.createDefaultCacheStorage(incompatibleImprovements);
     }
     
-    public static TemplateLookupStrategy getDefaultTemplateLookupStrategy(Version incompatibleImprovements) {
-        return Configuration.getDefaultTemplateLookupStrategy(incompatibleImprovements);
-    }
-    
-    public static TemplateNameFormat getDefaultTemplateNameFormat(Version incompatibleImprovements) {
-        return Configuration.getDefaultTemplateNameFormat(incompatibleImprovements);
-    }
-    
     /**
      * [2.4] getSettingNames() becomes to public; remove this.
      */

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/APINotSupportedTemplateException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/APINotSupportedTemplateException.java b/src/main/java/org/apache/freemarker/core/ast/APINotSupportedTemplateException.java
index a34ee92..e232839 100644
--- a/src/main/java/org/apache/freemarker/core/ast/APINotSupportedTemplateException.java
+++ b/src/main/java/org/apache/freemarker/core/ast/APINotSupportedTemplateException.java
@@ -20,7 +20,6 @@
 package org.apache.freemarker.core.ast;
 
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
@@ -56,10 +55,6 @@ class APINotSupportedTemplateException extends TemplateException {
                     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.");
-                    if (dow.getIncompatibleImprovements().intValue() < _TemplateAPI.VERSION_INT_2_3_22) {
-                        desc.tip("Setting DefaultObjectWrapper's \"incompatibleImprovements\" to 2.3.22 or higher will "
-                                + "change the default value of \"useAdaptersForContainers\" to true.");
-                    }
                 } else if (tm instanceof SimpleSequence && dow.getForceLegacyNonListCollections()) {
                     desc.tip("In the FreeMarker configuration, \"",
                             Configurable.OBJECT_WRAPPER_KEY,

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/BuiltIn.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/BuiltIn.java b/src/main/java/org/apache/freemarker/core/ast/BuiltIn.java
index c48ebca..5d25b3f 100644
--- a/src/main/java/org/apache/freemarker/core/ast/BuiltIn.java
+++ b/src/main/java/org/apache/freemarker/core/ast/BuiltIn.java
@@ -22,7 +22,6 @@ package org.apache.freemarker.core.ast;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
@@ -361,11 +360,6 @@ abstract class BuiltIn extends Expression implements Cloneable {
             throw new ParseException(buf.toString(), null, keyTk);
         }
         
-        while (bi instanceof ICIChainMember
-                && incompatibleImprovements < ((ICIChainMember) bi).getMinimumICIVersion()) {
-            bi = (BuiltIn) ((ICIChainMember) bi).getPreviousICIChainMember();
-        }
-        
         try {
             bi = (BuiltIn) bi.clone();
         } catch (CloneNotSupportedException e) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/BuiltInsForDates.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/BuiltInsForDates.java b/src/main/java/org/apache/freemarker/core/ast/BuiltInsForDates.java
index 5dfd86f..ee84a99 100644
--- a/src/main/java/org/apache/freemarker/core/ast/BuiltInsForDates.java
+++ b/src/main/java/org/apache/freemarker/core/ast/BuiltInsForDates.java
@@ -24,7 +24,6 @@ import java.util.List;
 import java.util.TimeZone;
 
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.model.AdapterTemplateModel;
 import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateMethodModelEx;
@@ -33,8 +32,8 @@ import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.model.impl.SimpleDate;
 import org.apache.freemarker.core.model.impl.SimpleScalar;
-import org.apache.freemarker.core.util._DateUtil;
 import org.apache.freemarker.core.util.UnrecognizedTimeZoneException;
+import org.apache.freemarker.core.util._DateUtil;
 
 /**
  * A holder for built-ins that operate exclusively on date left-hand values.
@@ -205,8 +204,7 @@ class BuiltInsForDates {
                 return showOffset.booleanValue();
             } else {
                 // java.sql.Time values meant to carry calendar field values only, so we don't show offset for them.
-                return !(date instanceof java.sql.Time
-                        && _TemplateAPI.getTemplateLanguageVersionAsInt(this) >= _TemplateAPI.VERSION_INT_2_3_21);
+                return !(date instanceof java.sql.Time);
             }
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/BuiltInsForMultipleTypes.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/BuiltInsForMultipleTypes.java b/src/main/java/org/apache/freemarker/core/ast/BuiltInsForMultipleTypes.java
index 422ae38..e31a97b 100644
--- a/src/main/java/org/apache/freemarker/core/ast/BuiltInsForMultipleTypes.java
+++ b/src/main/java/org/apache/freemarker/core/ast/BuiltInsForMultipleTypes.java
@@ -23,7 +23,6 @@ import java.util.Date;
 import java.util.List;
 
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateCollectionModel;
 import org.apache.freemarker.core.model.TemplateCollectionModelEx;
@@ -51,25 +50,8 @@ import org.apache.freemarker.core.model.impl.beans.SimpleMethodModel;
  */
 class BuiltInsForMultipleTypes {
 
-    static class cBI extends AbstractCBI implements ICIChainMember {
+    static class cBI extends AbstractCBI {
         
-        static class BIBeforeICE2d3d21 extends AbstractCBI {
-
-            @Override
-            protected TemplateModel formatNumber(Environment env, TemplateModel model) throws TemplateModelException {
-                Number num = EvalUtil.modelToNumber((TemplateNumberModel) model, target);
-                if (num instanceof Integer || num instanceof Long) {
-                    // Accelerate these fairly common cases
-                    return new SimpleScalar(num.toString());
-                } else {
-                    return new SimpleScalar(env.getCNumberFormat().format(num));
-                }
-            }
-            
-        }
-        
-        private final BIBeforeICE2d3d21 prevICIObj = new BIBeforeICE2d3d21();
-
         @Override
         TemplateModel _eval(Environment env) throws TemplateException {
             TemplateModel model = target.eval(env);
@@ -120,16 +102,6 @@ class BuiltInsForMultipleTypes {
         
             return new SimpleScalar(env.getCNumberFormat().format(num));
         }
-
-        @Override
-        public int getMinimumICIVersion() {
-            return _TemplateAPI.VERSION_INT_2_3_21;
-        }
-        
-        @Override
-        public Object getPreviousICIChainMember() {
-            return prevICIObj;
-        }
         
     }
 
@@ -351,9 +323,7 @@ class BuiltInsForMultipleTypes {
             TemplateModel tm = target.eval(env);
             target.assertNonNull(tm, env);
             return (tm instanceof TemplateSequenceModel || tm instanceof TemplateCollectionModel)
-                    && (_TemplateAPI.getTemplateLanguageVersionAsInt(this) < _TemplateAPI.VERSION_INT_2_3_21
-                        // These implement TemplateSequenceModel, yet they can't be #list-ed:
-                        || !(tm instanceof SimpleMethodModel || tm instanceof OverloadedMethodsModel))
+                    && !(tm instanceof SimpleMethodModel || tm instanceof OverloadedMethodsModel)
                     ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE;
         }
     }
@@ -441,12 +411,9 @@ class BuiltInsForMultipleTypes {
         TemplateModel _eval(Environment env) throws TemplateException {
             TemplateModel tm = target.eval(env);
             target.assertNonNull(tm, env);
-            return (tm instanceof TemplateSequenceModel
-                        && (
-                            !(tm instanceof OverloadedMethodsModel || tm instanceof SimpleMethodModel)
-                            || !env.isIcI2324OrLater())
-                        )
-                        ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE;
+            return tm instanceof TemplateSequenceModel
+                    && !(tm instanceof OverloadedMethodsModel || tm instanceof SimpleMethodModel) // [FM3] Until BW fixed
+                    ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/BuiltInsForStringsEncoding.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/BuiltInsForStringsEncoding.java b/src/main/java/org/apache/freemarker/core/ast/BuiltInsForStringsEncoding.java
index f273732..d11739f 100644
--- a/src/main/java/org/apache/freemarker/core/ast/BuiltInsForStringsEncoding.java
+++ b/src/main/java/org/apache/freemarker/core/ast/BuiltInsForStringsEncoding.java
@@ -22,7 +22,6 @@ package org.apache.freemarker.core.ast;
 import java.io.UnsupportedEncodingException;
 import java.util.List;
 
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.model.TemplateMethodModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
@@ -32,31 +31,12 @@ import org.apache.freemarker.core.util._StringUtil;
 
 class BuiltInsForStringsEncoding {
 
-    static class htmlBI extends BuiltInForLegacyEscaping implements ICIChainMember {
-        
-        static class BIBeforeICI2d3d20 extends BuiltInForLegacyEscaping {
-            @Override
-            TemplateModel calculateResult(String s, Environment env) {
-                return new SimpleScalar(_StringUtil.XMLEncNA(s));
-            }
-        }
-        
-        private final BIBeforeICI2d3d20 prevICIObj = new BIBeforeICI2d3d20();
+    static class htmlBI extends BuiltInForLegacyEscaping {
         
         @Override
         TemplateModel calculateResult(String s, Environment env) {
             return new SimpleScalar(_StringUtil.XHTMLEnc(s));
         }
-    
-        @Override
-        public int getMinimumICIVersion() {
-            return _TemplateAPI.VERSION_INT_2_3_20;
-        }
-    
-        @Override
-        public Object getPreviousICIChainMember() {
-            return prevICIObj;
-        }
         
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java b/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java
index 4781b05..dc29e7d 100644
--- a/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java
+++ b/src/main/java/org/apache/freemarker/core/ast/BuiltinVariable.java
@@ -24,9 +24,6 @@ import java.util.Date;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core._TemplateAPI;
-import org.apache.freemarker.core.ast.FMParserTokenManager;
-import org.apache.freemarker.core.ast.Token;
 import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateModel;
@@ -205,11 +202,9 @@ final class BuiltinVariable extends Expression {
         }
         if (name == TEMPLATE_NAME || name == TEMPLATE_NAME_CC) {
             // The behavior of env.getTemplate() was changed with IcI 2.3.22, but there was an unintended side effect
-            // of changing the behavior of .template_name, which was fixed with IcI 2.3.23. IcI 2.3.22 deliberately
+            // of changing the behavior of .template_name, which was oms with IcI 2.3.23. IcI 2.3.22 deliberately
             // remains broken.
-            return (env.getConfiguration().getIncompatibleImprovements().intValue() >= _TemplateAPI.VERSION_INT_2_3_23)
-                    ? new SimpleScalar(env.getTemplate230().getName())
-                    : new SimpleScalar(env.getTemplate().getName());
+            return (new SimpleScalar(env.getTemplate230().getName()));
         }
         if (name == MAIN_TEMPLATE_NAME || name == MAIN_TEMPLATE_NAME_CC) {
             return SimpleScalar.newInstanceOrNull(env.getMainTemplate().getName());

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/Configurable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Configurable.java b/src/main/java/org/apache/freemarker/core/ast/Configurable.java
index 48b04a7..3873f57 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Configurable.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Configurable.java
@@ -87,7 +87,6 @@ public class Configurable {
     
     private static final String NULL = "null";
     private static final String DEFAULT = "default";
-    private static final String DEFAULT_2_3_0 = "default_2_3_0";
     private static final String JVM_DEFAULT = "JVM default";
     
     /** Legacy, snake case ({@code like_this}) variation of the setting name. @since 2.3.23 */
@@ -426,8 +425,7 @@ public class Configurable {
         apiBuiltinEnabled = Boolean.FALSE;
         properties.setProperty(API_BUILTIN_ENABLED_KEY, apiBuiltinEnabled.toString());
         
-        logTemplateExceptions = Boolean.valueOf(
-                _TemplateAPI.getDefaultLogTemplateExceptions(incompatibleImprovements));
+        logTemplateExceptions = Boolean.FALSE;
         properties.setProperty(LOG_TEMPLATE_EXCEPTIONS_KEY, logTemplateExceptions.toString());
         
         // outputEncoding and urlEscapingCharset defaults to null,
@@ -613,7 +611,7 @@ public class Configurable {
      *   {@link java.sql.Date java.sql.Date} and {@link java.sql.Time java.sql.Time}, and then if, for example,
      *   {@code time_zone} is GMT+00:00, the
      *   values from the earlier examples will be shown as 2014-07-11 (one day off) and 09:57:00 (2 hours off). While
-     *   those are the time zone correct renderings, those values probably was meant to shown "as is".
+     *   those are the time zone correct renderings, those values are probably meant to be shown "as is".
      *   
      *   <li>You may wonder why this setting isn't simply "SQL time zone", since the time zone related behavior of JDBC
      *   applies to {@link java.sql.Timestamp java.sql.Timestamp} too. FreeMarker assumes that you have set up your
@@ -1763,23 +1761,12 @@ public class Configurable {
      * @see #setAutoIncludes(List)
      */
     public void addAutoInclude(String templateName) {
-        addAutoInclude(templateName, false);
-    }
-
-    /**
-     * @param keepDuplicate
-     *            Used for emulating legacy glitch, where duplicates weren't removed if the inclusion was added via
-     *            {@link #setAutoIncludes(List)}.
-     */
-    private void addAutoInclude(String templateName, boolean keepDuplicate) {
         // "synchronized" is removed from the API as it's not safe to set anything after publishing the Configuration
         synchronized (this) {
             if (autoIncludes == null) {
                 initAutoIncludesList();
             } else {
-                if (!keepDuplicate) {
-                    autoIncludes.remove(templateName);
-                }
+                autoIncludes.remove(templateName);
             }
             autoIncludes.add(templateName);
         }
@@ -1806,8 +1793,7 @@ public class Configurable {
                 if (!(templateName instanceof String)) {
                     throw new IllegalArgumentException("List items must be String-s.");
                 }
-                addAutoInclude((String) templateName, this instanceof Configuration && ((Configuration) this)
-                        .getIncompatibleImprovements().intValue() < _TemplateAPI.VERSION_INT_2_3_25);
+                addAutoInclude((String) templateName);
             }
         }
     }
@@ -2334,10 +2320,8 @@ public class Configurable {
                     if (this instanceof Configuration) {
                         ((Configuration) this).unsetObjectWrapper();
                     } else {
-                        setObjectWrapper(Configuration.getDefaultObjectWrapper(Configuration.VERSION_2_3_0));
+                        setObjectWrapper(Configuration.getDefaultObjectWrapper(Configuration.VERSION_3_0_0));
                     }
-                } else if (DEFAULT_2_3_0.equalsIgnoreCase(value)) {
-                    setObjectWrapper(Configuration.getDefaultObjectWrapper(Configuration.VERSION_2_3_0));
                 } else if ("simple".equalsIgnoreCase(value)) {
                     setObjectWrapper(_StaticObjectWrappers.SIMPLE_OBJECT_WRAPPER);
                 } else if ("beans".equalsIgnoreCase(value)) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/DynamicKeyName.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/DynamicKeyName.java b/src/main/java/org/apache/freemarker/core/ast/DynamicKeyName.java
index af2dc3e..38f4ee3 100644
--- a/src/main/java/org/apache/freemarker/core/ast/DynamicKeyName.java
+++ b/src/main/java/org/apache/freemarker/core/ast/DynamicKeyName.java
@@ -20,10 +20,9 @@
 package org.apache.freemarker.core.ast;
 
 import java.util.ArrayList;
-import java.util.Collections;
 
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core._TemplateAPI;
+import org.apache.freemarker.core.model.Constants;
 import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateNumberModel;
@@ -31,7 +30,6 @@ import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.impl.SimpleScalar;
 import org.apache.freemarker.core.model.impl.SimpleSequence;
-import org.apache.freemarker.core.model.Constants;
 
 /**
  * {@code target[keyExpression]}, where, in FM 2.3, {@code keyExpression} can be string, a number or a range,
@@ -244,11 +242,7 @@ final class DynamicKeyName extends Expression {
     }
 
     private TemplateModel emptyResult(boolean seq) {
-        return seq
-                ? (_TemplateAPI.getTemplateLanguageVersionAsInt(this) < _TemplateAPI.VERSION_INT_2_3_21
-                        ? new SimpleSequence(Collections.EMPTY_LIST, null)
-                        : Constants.EMPTY_SEQUENCE)
-                : TemplateScalarModel.EMPTY_STRING;
+        return seq ? Constants.EMPTY_SEQUENCE : TemplateScalarModel.EMPTY_STRING;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/Environment.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Environment.java b/src/main/java/org/apache/freemarker/core/ast/Environment.java
index b133475..277a7a5 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Environment.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Environment.java
@@ -45,7 +45,6 @@ import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.TemplateExceptionHandler;
 import org.apache.freemarker.core._CoreLogs;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateCollectionModel;
 import org.apache.freemarker.core.model.TemplateDateModel;
@@ -166,7 +165,7 @@ public final class Environment extends Configurable {
     private final Namespace mainNamespace;
     private Namespace currentNamespace, globalNamespace;
     private HashMap<String, Namespace> loadedLibs;
-    private Configurable legacyParent;
+    private Configurable legacyParent; // [FM3] Get rid of this
 
     private boolean inAttemptBlock;
     private Throwable lastThrowable;
@@ -560,13 +559,8 @@ public final class Environment extends Configurable {
             currentNamespace = invokingMacroContext.nestedContentNamespace;
 
             final Configurable prevParent;
-            final boolean parentReplacementOn = isBeforeIcI2322();
             prevParent = getParent();
-            if (parentReplacementOn) {
-                setParent(currentNamespace.getTemplate());
-            } else {
-                legacyParent = currentNamespace.getTemplate();
-            }
+            legacyParent = currentNamespace.getTemplate();
 
             localContextStack = invokingMacroContext.prevLocalContextStack;
             if (invokingMacroContext.nestedContentParameterNames != null) {
@@ -580,11 +574,7 @@ public final class Environment extends Configurable {
                 }
                 currentMacroContext = invokingMacroContext;
                 currentNamespace = getMacroNamespace(invokingMacroContext.getMacro());
-                if (parentReplacementOn) {
-                    setParent(prevParent);
-                } else {
-                    legacyParent = prevParent;
-                }
+                legacyParent = prevParent;
                 localContextStack = prevLocalContextStack;
             }
         }
@@ -1265,7 +1255,6 @@ public final class Environment extends Configurable {
         int formatStringLen = formatString.length();
         if (formatStringLen > 1
                 && formatString.charAt(0) == '@'
-                && (isIcI2324OrLater() || hasCustomFormats())
                 && Character.isLetter(formatString.charAt(1))) {
             final String name;
             final String params;
@@ -1771,7 +1760,6 @@ public final class Environment extends Configurable {
             formatParams = formatString; // for speed, we don't remove the prefix
         } else if (firstChar == '@'
                 && formatStringLen > 1
-                && (isIcI2324OrLater() || hasCustomFormats())
                 && Character.isLetter(formatString.charAt(1))) {
             final String name;
             {
@@ -2508,23 +2496,14 @@ public final class Environment extends Configurable {
     public void include(Template includedTemplate)
             throws TemplateException, IOException {
         final Template prevTemplate;
-        final boolean parentReplacementOn = isBeforeIcI2322();
         prevTemplate = getTemplate();
-        if (parentReplacementOn) {
-            setParent(includedTemplate);
-        } else {
-            legacyParent = includedTemplate;
-        }
+        legacyParent = includedTemplate;
 
         importMacros(includedTemplate);
         try {
             visit(includedTemplate.getRootTreeNode());
         } finally {
-            if (parentReplacementOn) {
-                setParent(prevTemplate);
-            } else {
-                legacyParent = prevTemplate;
-            }
+            legacyParent = prevTemplate;
         }
     }
 
@@ -2615,7 +2594,7 @@ public final class Environment extends Configurable {
             lazyImport = false;
             // As we have an already normalized name, we use it. 2.3.x note: We should use the template.sourceName as
             // namespace key, but historically we use the looked up name (template.name); check what lazy import does if
-            // that will be fixed, as that can't do the template lookup, yet the keys must be the same.
+            // that will be oms, as that can't do the template lookup, yet the keys must be the same.
             templateName = loadedTemplate.getName();
         } else {
             lazyImport = true;
@@ -2633,7 +2612,7 @@ public final class Environment extends Configurable {
         if (existingNamespace != null) {
             if (targetNsVarName != null) {
                 setVariable(targetNsVarName, existingNamespace);
-                if (isIcI2324OrLater() && currentNamespace == mainNamespace) {
+                if (currentNamespace == mainNamespace) {
                     globalNamespace.put(targetNsVarName, existingNamespace);
                 }
             }
@@ -3019,14 +2998,6 @@ public final class Environment extends Configurable {
         }
     };
 
-    private boolean isBeforeIcI2322() {
-        return configuration.getIncompatibleImprovements().intValue() < _TemplateAPI.VERSION_INT_2_3_22;
-    }
-
-    boolean isIcI2324OrLater() {
-        return configuration.getIncompatibleImprovements().intValue() >= _TemplateAPI.VERSION_INT_2_3_24;
-    }
-
     /**
      * See {@link #setFastInvalidReferenceExceptions(boolean)}.
      */

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/HashLiteral.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/HashLiteral.java b/src/main/java/org/apache/freemarker/core/ast/HashLiteral.java
index fc36547..1b8bf3a 100644
--- a/src/main/java/org/apache/freemarker/core/ast/HashLiteral.java
+++ b/src/main/java/org/apache/freemarker/core/ast/HashLiteral.java
@@ -25,7 +25,6 @@ import java.util.LinkedHashMap;
 import java.util.ListIterator;
 
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.model.TemplateCollectionModel;
 import org.apache.freemarker.core.model.TemplateHashModelEx2;
 import org.apache.freemarker.core.model.TemplateModel;
@@ -111,34 +110,14 @@ final class HashLiteral extends Expression {
         private TemplateCollectionModel keyCollection, valueCollection; // ordered lists of keys and values
 
         SequenceHash(Environment env) throws TemplateException {
-            if (_TemplateAPI.getTemplateLanguageVersionAsInt(HashLiteral.this) >= _TemplateAPI.VERSION_INT_2_3_21) {
-                map = new LinkedHashMap();
-                for (int i = 0; i < size; i++) {
-                    Expression keyExp = (Expression) keys.get(i);
-                    Expression valExp = (Expression) values.get(i);
-                    String key = keyExp.evalAndCoerceToPlainText(env);
-                    TemplateModel value = valExp.eval(env);
-                    valExp.assertNonNull(value, env);
-                    map.put(key, value);
-                }
-            } else {
-                // Legacy hash literal, where repeated keys were kept when doing ?values or ?keys, yet overwritten when
-                // doing hash[key].
-                map = new HashMap();
-                ArrayList keyList = new ArrayList(size);
-                ArrayList valueList = new ArrayList(size);
-                for (int i = 0; i < size; i++) {
-                    Expression keyExp = (Expression) keys.get(i);
-                    Expression valExp = (Expression) values.get(i);
-                    String key = keyExp.evalAndCoerceToPlainText(env);
-                    TemplateModel value = valExp.eval(env);
-                    valExp.assertNonNull(value, env);
-                    map.put(key, value);
-                    keyList.add(key);
-                    valueList.add(value);
-                }
-                keyCollection = new CollectionAndSequence(new SimpleSequence(keyList));
-                valueCollection = new CollectionAndSequence(new SimpleSequence(valueList));
+            map = new LinkedHashMap();
+            for (int i = 0; i < size; i++) {
+                Expression keyExp = (Expression) keys.get(i);
+                Expression valExp = (Expression) values.get(i);
+                String key = keyExp.evalAndCoerceToPlainText(env);
+                TemplateModel value = valExp.eval(env);
+                valExp.assertNonNull(value, env);
+                map.put(key, value);
             }
         }
 
@@ -150,7 +129,6 @@ final class HashLiteral extends Expression {
         @Override
         public TemplateCollectionModel keys() {
             if (keyCollection == null) {
-                // This can only happen when IcI >= 2.3.21, an the map is a LinkedHashMap.
                 keyCollection = new CollectionAndSequence(new SimpleSequence(map.keySet()));
             }
             return keyCollection;
@@ -159,7 +137,6 @@ final class HashLiteral extends Expression {
         @Override
         public TemplateCollectionModel values() {
             if (valueCollection == null) {
-                // This can only happen when IcI >= 2.3.21, an the map is a LinkedHashMap.
                 valueCollection = new CollectionAndSequence(new SimpleSequence(map.values()));
             }
             return valueCollection;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/ICIChainMember.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/ICIChainMember.java b/src/main/java/org/apache/freemarker/core/ast/ICIChainMember.java
deleted file mode 100644
index 34a1a10..0000000
--- a/src/main/java/org/apache/freemarker/core/ast/ICIChainMember.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.core.ast;
-
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.Version;
-
-/**
- * An object that has another older version that's used below a certain
- * {@link Configuration#setIncompatibleImprovements(Version) InCompatible Improvements} version.  
- */
-interface ICIChainMember {
-
-    /**
-     * The minimum ICE version after which this object can be used.
-     */
-    int getMinimumICIVersion();
-
-    /**
-     * The closest object used for ICE lower than {@link #getMinimumICIVersion()}.
-     */
-    Object getPreviousICIChainMember();
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/Interpret.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Interpret.java b/src/main/java/org/apache/freemarker/core/ast/Interpret.java
index 140ccea..8c4274c 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Interpret.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Interpret.java
@@ -79,7 +79,7 @@ class Interpret extends OutputFormatBoundBuiltIn {
                     env);
         }
         String templateSource = sourceExpr.evalAndCoerceToPlainText(env);
-        Template parentTemplate = env.getTemplate();
+        Template parentTemplate = env.getCurrentTemplate();
         
         final Template interpretedTemplate;
         try {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/NonListableRightUnboundedRangeModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/NonListableRightUnboundedRangeModel.java b/src/main/java/org/apache/freemarker/core/ast/NonListableRightUnboundedRangeModel.java
deleted file mode 100644
index 14c8d9e..0000000
--- a/src/main/java/org/apache/freemarker/core/ast/NonListableRightUnboundedRangeModel.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.core.ast;
-
-import org.apache.freemarker.core.model.TemplateModelException;
-
-/**
- * This exists for backward compatibly, and is used before Incompatible Improvements 2.3.21 only.
- * 
- * @since 2.3.21
- */
-final class NonListableRightUnboundedRangeModel extends RightUnboundedRangeModel {
-
-    NonListableRightUnboundedRangeModel(int begin) {
-        super(begin);
-    }
-
-    @Override
-    public int size() throws TemplateModelException {
-        return 0;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/Range.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Range.java b/src/main/java/org/apache/freemarker/core/ast/Range.java
index 949fd53..8cd01cf 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Range.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Range.java
@@ -20,7 +20,6 @@
 package org.apache.freemarker.core.ast;
 
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.model.TemplateModel;
 
 /**
@@ -56,9 +55,7 @@ final class Range extends Expression {
                     begin, endType != END_SIZE_LIMITED ? lhoValue : begin + lhoValue,
                     endType == END_INCLUSIVE, endType == END_SIZE_LIMITED); 
         } else {
-            return _TemplateAPI.getTemplateLanguageVersionAsInt(this) >= _TemplateAPI.VERSION_INT_2_3_21
-                    ? new ListableRightUnboundedRangeModel(begin)
-                    : new NonListableRightUnboundedRangeModel(begin);
+            return new ListableRightUnboundedRangeModel(begin);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java b/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
index b5695fd..4e6b886 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
@@ -113,13 +113,6 @@ public final class TemplateConfiguration extends Configurable implements ParserC
             return;
         }
         
-        if (((Configuration) cfg).getIncompatibleImprovements().intValue() < _TemplateAPI.VERSION_INT_2_3_22
-                && hasAnyConfigurableSet()) {
-            throw new IllegalStateException(
-                    "This TemplateConfiguration can't be associated to a Configuration that has "
-                    + "incompatibleImprovements less than 2.3.22, because it changes non-parser settings.");
-        }
-        
         super.setParent(cfg);
         parentConfigurationSet = true;
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/ast/_SettingEvaluationEnvironment.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/_SettingEvaluationEnvironment.java b/src/main/java/org/apache/freemarker/core/ast/_SettingEvaluationEnvironment.java
index 0b4e917..1f61224 100644
--- a/src/main/java/org/apache/freemarker/core/ast/_SettingEvaluationEnvironment.java
+++ b/src/main/java/org/apache/freemarker/core/ast/_SettingEvaluationEnvironment.java
@@ -54,7 +54,7 @@ public class _SettingEvaluationEnvironment {
 
     public BeansWrapper getObjectWrapper() {
         if (objectWrapper == null) {
-            objectWrapper = new BeansWrapper(Configuration.VERSION_2_3_21);
+            objectWrapper = new BeansWrapper(Configuration.VERSION_3_0_0);
         }
         return objectWrapper;
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx2.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx2.java b/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx2.java
index 9dae9df..bbbd3c0 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx2.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateHashModelEx2.java
@@ -55,7 +55,7 @@ public interface TemplateHashModelEx2 extends TemplateHashModelEx {
     }
     
     /**
-     * Iterates over the key-value pairs in a hash. This is very similar to an {@link Iterator}, but has a fixed item
+     * Iterates over the key-value pairs in a hash. This is very similar to an {@link Iterator}, but has a oms item
      * type, can throw {@link TemplateModelException}-s, and has no {@code remove()} method. 
      *
      * @since 2.3.25

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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 ba474c9..2da53de 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
@@ -29,7 +29,6 @@ import java.util.Set;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.model.ObjectWrapper;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateCollectionModel;
@@ -252,8 +251,7 @@ public class DefaultObjectWrapper extends org.apache.freemarker.core.model.impl.
 
     /**
      * 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 when the
-     * {@code incompatible_improvements} of this instance was set to {@link Configuration#VERSION_2_3_22} or higher. To
+     * 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>
@@ -340,11 +338,7 @@ public class DefaultObjectWrapper extends org.apache.freemarker.core.model.impl.
      * @since 2.3.22
      */
     protected static Version normalizeIncompatibleImprovementsVersion(Version incompatibleImprovements) {
-        _TemplateAPI.checkVersionNotNullAndSupported(incompatibleImprovements);
-        Version bwIcI = BeansWrapper.normalizeIncompatibleImprovementsVersion(incompatibleImprovements);
-        return incompatibleImprovements.intValue() < _TemplateAPI.VERSION_INT_2_3_22
-                || bwIcI.intValue() >= _TemplateAPI.VERSION_INT_2_3_22
-                ? bwIcI : Configuration.VERSION_2_3_22;
+        return BeansWrapper.normalizeIncompatibleImprovementsVersion(incompatibleImprovements);
     }
 
     /**



[7/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java b/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
index cb15e50..441c11c 100644
--- a/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
+++ b/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
@@ -45,7 +45,6 @@ import javax.servlet.jsp.JspWriter;
 import javax.servlet.jsp.PageContext;
 import javax.servlet.jsp.tagext.BodyContent;
 
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.ast.Environment;
 import org.apache.freemarker.core.model.AdapterTemplateModel;
 import org.apache.freemarker.core.model.ObjectWrapper;
@@ -195,9 +194,9 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
             case PAGE_SCOPE: {
                 try {
                     final TemplateModel tm = environment.getGlobalNamespace().get(name);
-                    if (incompatibleImprovements >= _TemplateAPI.VERSION_INT_2_3_22 && unwrapper != null) {
+                    if (unwrapper != null) {
                         return unwrapper.unwrap(tm);
-                    } else { // Legacy behavior branch
+                    } else { // [FM3] Such unwrapping logic rather belongs to some core util
                         if (tm instanceof AdapterTemplateModel) {
                             return ((AdapterTemplateModel) tm).getAdaptedObject(OBJECT_CLASS);
                         }
@@ -213,8 +212,7 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
                         if (tm instanceof TemplateBooleanModel) {
                             return Boolean.valueOf(((TemplateBooleanModel) tm).getAsBoolean());
                         }
-                        if (incompatibleImprovements >= _TemplateAPI.VERSION_INT_2_3_22
-                                && tm instanceof TemplateDateModel) {
+                        if (tm instanceof TemplateDateModel) {
                             return ((TemplateDateModel) tm).getAsDate();
                         }
                         return tm;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/main/javacc/FTL.jj
----------------------------------------------------------------------
diff --git a/src/main/javacc/FTL.jj b/src/main/javacc/FTL.jj
index 19e60ad..5679fbc 100644
--- a/src/main/javacc/FTL.jj
+++ b/src/main/javacc/FTL.jj
@@ -187,10 +187,6 @@ public class FMParser {
         
         this.outputFormat = outputFormat;
         recalculateAutoEscapingField();                                
-        if (incompatibleImprovements < _TemplateAPI.VERSION_INT_2_3_24) {
-            // Emulate bug, where the string literal parser haven't inherited the IcI:
-            incompatibleImprovements = _TemplateAPI.VERSION_INT_2_3_0;
-        }
     }
 
     void tearDownStringLiteralMode(FMParserTokenManager parentTokenSource) {
@@ -931,70 +927,66 @@ TOKEN:
      */
     <UNKNOWN_DIRECTIVE : ("[#" | "[/#" | "<#" | "</#") (["a"-"z", "A"-"Z", "_"])+>
     {
-        if (!directiveSyntaxEstablished && incompatibleImprovements < _TemplateAPI.VERSION_INT_2_3_19) {
-            matchedToken.kind = STATIC_TEXT_NON_WS;
-        } else {
-            char firstChar = matchedToken.image.charAt(0);
+        char firstChar = matchedToken.image.charAt(0);
 
-            if (!directiveSyntaxEstablished && autodetectTagSyntax) {
-                squBracTagSyntax = (firstChar == '[');
-                directiveSyntaxEstablished = true;
-            }
-
-            if (firstChar == '<' && squBracTagSyntax) {
-                matchedToken.kind = STATIC_TEXT_NON_WS;
-            } else if (firstChar == '[' && !squBracTagSyntax) {
-                matchedToken.kind = STATIC_TEXT_NON_WS;
-            } else {
-                String dn = matchedToken.image;
-                int index = dn.indexOf('#');
-                dn = dn.substring(index + 1);
-
-                // Until the tokenizer/parser is reworked, we have this quirk where something like <#list>
-                // doesn't match any directive starter tokens, because that token requires whitespace after the
-                // name as it should be followed by parameters. For now we work this around so we don't report
-                // unknown directive:
-                if (_CoreAPI.ALL_BUILT_IN_DIRECTIVE_NAMES.contains(dn)) {
-                    throw new TokenMgrError(
-                            "#" + dn + " is an existing directive, but the tag is malformed. " 
-                            + " (See FreeMarker Manual / Directive Reference.)",
-                            TokenMgrError.LEXICAL_ERROR,
-                            matchedToken.beginLine, matchedToken.beginColumn + 1,
-                            matchedToken.endLine, matchedToken.endColumn);
-                }
+        if (!directiveSyntaxEstablished && autodetectTagSyntax) {
+            squBracTagSyntax = (firstChar == '[');
+            directiveSyntaxEstablished = true;
+        }
 
-                String tip = null;
-                if (dn.equals("set") || dn.equals("var")) {
-                    tip = "Use #assign or #local or #global, depending on the intented scope "
-                          + "(#assign is template-scope). " + PLANNED_DIRECTIVE_HINT;
-                } else if (dn.equals("else_if") || dn.equals("elif")) {
-                	tip = "Use #elseif.";
-                } else if (dn.equals("no_escape")) {
-                	tip = "Use #noescape instead.";
-                } else if (dn.equals("method")) {
-                	tip = "Use #function instead.";
-                } else if (dn.equals("head") || dn.equals("template") || dn.equals("fm")) {
-                	tip = "You may meant #ftl.";
-                } else if (dn.equals("try") || dn.equals("atempt")) {
-                	tip = "You may meant #attempt.";
-                } else if (dn.equals("for") || dn.equals("each") || dn.equals("iterate") || dn.equals("iterator")) {
-                    tip = "You may meant #list (http://freemarker.org/docs/ref_directive_list.html).";
-                } else if (dn.equals("prefix")) {
-                    tip = "You may meant #import. " + PLANNED_DIRECTIVE_HINT;
-                } else if (dn.equals("item") || dn.equals("row") || dn.equals("rows")) {
-                    tip = "You may meant #items.";
-                } else if (dn.equals("separator") || dn.equals("separate") || dn.equals("separ")) {
-                    tip = "You may meant #sep.";
-                } else {
-                    tip = "Help (latest version): http://freemarker.org/docs/ref_directive_alphaidx.html; "
-                            + "you're using FreeMarker " + Configuration.getVersion() + ".";
-                }
+        if (firstChar == '<' && squBracTagSyntax) {
+            matchedToken.kind = STATIC_TEXT_NON_WS;
+        } else if (firstChar == '[' && !squBracTagSyntax) {
+            matchedToken.kind = STATIC_TEXT_NON_WS;
+        } else {
+            String dn = matchedToken.image;
+            int index = dn.indexOf('#');
+            dn = dn.substring(index + 1);
+
+            // Until the tokenizer/parser is reworked, we have this quirk where something like <#list>
+            // doesn't match any directive starter tokens, because that token requires whitespace after the
+            // name as it should be followed by parameters. For now we work this around so we don't report
+            // unknown directive:
+            if (_CoreAPI.ALL_BUILT_IN_DIRECTIVE_NAMES.contains(dn)) {
                 throw new TokenMgrError(
-                        "Unknown directive: #" + dn + (tip != null ? ". " + tip : ""),
+                        "#" + dn + " is an existing directive, but the tag is malformed. " 
+                        + " (See FreeMarker Manual / Directive Reference.)",
                         TokenMgrError.LEXICAL_ERROR,
                         matchedToken.beginLine, matchedToken.beginColumn + 1,
                         matchedToken.endLine, matchedToken.endColumn);
             }
+
+            String tip = null;
+            if (dn.equals("set") || dn.equals("var")) {
+                tip = "Use #assign or #local or #global, depending on the intented scope "
+                      + "(#assign is template-scope). " + PLANNED_DIRECTIVE_HINT;
+            } else if (dn.equals("else_if") || dn.equals("elif")) {
+            	tip = "Use #elseif.";
+            } else if (dn.equals("no_escape")) {
+            	tip = "Use #noescape instead.";
+            } else if (dn.equals("method")) {
+            	tip = "Use #function instead.";
+            } else if (dn.equals("head") || dn.equals("template") || dn.equals("fm")) {
+            	tip = "You may meant #ftl.";
+            } else if (dn.equals("try") || dn.equals("atempt")) {
+            	tip = "You may meant #attempt.";
+            } else if (dn.equals("for") || dn.equals("each") || dn.equals("iterate") || dn.equals("iterator")) {
+                tip = "You may meant #list (http://freemarker.org/docs/ref_directive_list.html).";
+            } else if (dn.equals("prefix")) {
+                tip = "You may meant #import. " + PLANNED_DIRECTIVE_HINT;
+            } else if (dn.equals("item") || dn.equals("row") || dn.equals("rows")) {
+                tip = "You may meant #items.";
+            } else if (dn.equals("separator") || dn.equals("separate") || dn.equals("separ")) {
+                tip = "You may meant #sep.";
+            } else {
+                tip = "Help (latest version): http://freemarker.org/docs/ref_directive_alphaidx.html; "
+                        + "you're using FreeMarker " + Configuration.getVersion() + ".";
+            }
+            throw new TokenMgrError(
+                    "Unknown directive: #" + dn + (tip != null ? ". " + tip : ""),
+                    TokenMgrError.LEXICAL_ERROR,
+                    matchedToken.beginLine, matchedToken.beginColumn + 1,
+                    matchedToken.endLine, matchedToken.endColumn);
         }
     }
 }
@@ -3150,12 +3142,8 @@ Macro Macro() :
         // To prevent parser check loopholes like <#list ...><#macro ...><#break></#macro></#list>.
         lastIteratorBlockContexts = iteratorBlockContexts;
         iteratorBlockContexts = null;
-        if (incompatibleImprovements >= _TemplateAPI.VERSION_INT_2_3_23) {
-	        lastBreakableDirectiveNesting = breakableDirectiveNesting;
-	        breakableDirectiveNesting = 0; 
-        } else {
-            lastBreakableDirectiveNesting = 0; // Just to prevent uninitialized local variable error later
-        }
+        lastBreakableDirectiveNesting = breakableDirectiveNesting;
+        breakableDirectiveNesting = 0; 
     }
     children = MixedContentElements()
     (
@@ -3171,9 +3159,7 @@ Macro Macro() :
     )
     {
         iteratorBlockContexts = lastIteratorBlockContexts;
-        if (incompatibleImprovements >= _TemplateAPI.VERSION_INT_2_3_23) {
-            breakableDirectiveNesting = lastBreakableDirectiveNesting;
-        }
+        breakableDirectiveNesting = lastBreakableDirectiveNesting;
         
         inMacro = inFunction = false;
         Macro result = new Macro(name, argNames, args, catchAll, isFunction, children);
@@ -3876,8 +3862,7 @@ Token UnparsedContent(Token start, StringBuilder buf) :
     )+
     {
         buf.setLength(buf.length() - t.image.length());
-        if (!t.image.endsWith(";")
-                && _TemplateAPI.getTemplateLanguageVersionAsInt(template) >= _TemplateAPI.VERSION_INT_2_3_21) {
+        if (!t.image.endsWith(";")) {
             throw new ParseException("Unclosed \"" + start.image + "\"", template, start);
         }
         return t;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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 5d2ae0d..374e845 100644
--- a/src/manual/en_US/FM3-CHANGE-LOG.txt
+++ b/src/manual/en_US/FM3-CHANGE-LOG.txt
@@ -85,5 +85,7 @@ the FreeMarer 3 changelog here:
   renamed to _StringUtil, thus people won't accidentally use it when they wanted to autocomplete to Apache Commons
   StringUtil). Created published static utility class, o.a.f.core.util.FTLUtil, which contains some methods moved
   over from the now internal utility classes.
-- Deleted o.a.f..core.util.DOMNodeModel
-- All CacheStorage-s must be thread safe from now on (removed ConcurrentCacheStorage marker interface)
\ No newline at end of file
+- Deleted o.a.f.core.util.DOMNodeModel (it has noting to do with the standard XML support, o.a.f.core.model.dom)
+- All CacheStorage-s must be thread safe from now on (removed ConcurrentCacheStorage marker interface)
+- Removed support for incompatibleImprovements before 3.0.0. So currently 3.0.0 is the only support value.
+- Changed the default of logTemplateExceptions to false.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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 153cc26..b5f2b8b 100644
--- a/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
+++ b/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
@@ -69,7 +69,6 @@ import org.apache.freemarker.core.ast.XMLOutputFormat;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
-import org.apache.freemarker.core.model.impl.SimpleObjectWrapper;
 import org.apache.freemarker.core.model.impl.SimpleScalar;
 import org.apache.freemarker.core.model.impl._StaticObjectWrappers;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
@@ -104,98 +103,21 @@ public class ConfigurationTest extends TestCase {
     public ConfigurationTest(String name) {
         super(name);
     }
-    
-    public void testIncompatibleImprovementsChangesDefaults() {
-        Version newVersion = Configuration.VERSION_2_3_21;
-        Version oldVersion = Configuration.VERSION_2_3_20;
-        
-        Configuration cfg = new Configuration();
-        assertUsesLegacyObjectWrapper(cfg);
-        assertEquals(cfg.getIncompatibleImprovements(), Configuration.VERSION_2_3_0);
-        
-        cfg.setIncompatibleImprovements(newVersion);
-        assertUsesNewObjectWrapper(cfg);
-        assertUsesNewTemplateLoader(cfg);
-        
-        cfg.setIncompatibleImprovements(oldVersion);
-        assertUsesLegacyObjectWrapper(cfg);
-        cfg.setIncompatibleImprovements(oldVersion);
-        assertUsesLegacyObjectWrapper(cfg);
-        
-        cfg.setIncompatibleImprovements(newVersion);
-        assertUsesNewObjectWrapper(cfg);
-        assertUsesNewTemplateLoader(cfg);
-        cfg.setIncompatibleImprovements(newVersion);
-        assertUsesNewObjectWrapper(cfg);
-        assertUsesNewTemplateLoader(cfg);
-        
-        cfg.setObjectWrapper(new SimpleObjectWrapper(Configuration.VERSION_2_3_0));
-        cfg.setIncompatibleImprovements(oldVersion);
-        assertSame(SimpleObjectWrapper.class, cfg.getObjectWrapper().getClass());
-        
-        cfg.setTemplateLoader(new StringTemplateLoader());
-        cfg.setIncompatibleImprovements(newVersion);
-        assertSame(SimpleObjectWrapper.class, cfg.getObjectWrapper().getClass());
-        assertSame(StringTemplateLoader.class, cfg.getTemplateLoader().getClass());
-        
-        cfg.setIncompatibleImprovements(oldVersion);
-        assertSame(SimpleObjectWrapper.class, cfg.getObjectWrapper().getClass());
-        assertSame(StringTemplateLoader.class, cfg.getTemplateLoader().getClass());
-
-        cfg.setObjectWrapper(_StaticObjectWrappers.DEFAULT_OBJECT_WRAPPER);
-        cfg.setIncompatibleImprovements(newVersion);
-        assertSame(_StaticObjectWrappers.DEFAULT_OBJECT_WRAPPER, cfg.getObjectWrapper());
-        assertSame(StringTemplateLoader.class, cfg.getTemplateLoader().getClass());
-        
-        cfg.unsetObjectWrapper();
-        assertUsesNewObjectWrapper(cfg);
-        cfg.unsetTemplateLoader();
-        assertUsesNewTemplateLoader(cfg);
-
-        cfg.setIncompatibleImprovements(oldVersion);
-        assertUsesLegacyObjectWrapper(cfg);
-
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_22);
-        assertUses2322ObjectWrapper(cfg);
-        assertUsesNewTemplateLoader(cfg);
-        
-        // ---
-        
-        cfg = new Configuration(newVersion);
-        assertUsesNewObjectWrapper(cfg);
-        assertUsesNewTemplateLoader(cfg);
-        
-        cfg.setIncompatibleImprovements(oldVersion);
-        assertUsesLegacyObjectWrapper(cfg);
-        
-        // ---
-        
-        cfg = new Configuration(Configuration.VERSION_2_3_22);
-        assertUses2322ObjectWrapper(cfg);
-        assertUsesNewTemplateLoader(cfg);
-    }
 
-    private void assertUses2322ObjectWrapper(Configuration cfg) {
-        Object ow = cfg.getObjectWrapper();
-        assertEquals(DefaultObjectWrapper.class, ow.getClass());
-        assertEquals(Configuration.VERSION_2_3_22,
-                ((DefaultObjectWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
-    }
-    
     public void testUnsetAndIsExplicitlySet() {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         assertFalse(cfg.isLogTemplateExceptionsExplicitlySet());
-        assertTrue(cfg.getLogTemplateExceptions());
+        assertFalse(cfg.getLogTemplateExceptions());
         //
-        cfg.setLogTemplateExceptions(false);
+        cfg.setLogTemplateExceptions(true);
         assertTrue(cfg.isLogTemplateExceptionsExplicitlySet());
-        assertFalse(cfg.getLogTemplateExceptions());
+        assertTrue(cfg.getLogTemplateExceptions());
         //
         for (int i = 0; i < 2; i++) {
             cfg.unsetLogTemplateExceptions();
             assertFalse(cfg.isLogTemplateExceptionsExplicitlySet());
-            assertTrue(cfg.getLogTemplateExceptions());
+            assertFalse(cfg.getLogTemplateExceptions());
         }
         
         assertFalse(cfg.isObjectWrapperExplicitlySet());
@@ -298,7 +220,7 @@ public class ConfigurationTest extends TestCase {
 
     private void assertUsesNewObjectWrapper(Configuration cfg) {
         assertEquals(
-                Configuration.VERSION_2_3_21,
+                Configuration.VERSION_3_0_0,
                 ((DefaultObjectWrapper) cfg.getObjectWrapper()).getIncompatibleImprovements());
     }
     
@@ -308,7 +230,7 @@ public class ConfigurationTest extends TestCase {
     
     public void testVersion() {
         Version v = Configuration.getVersion();
-        assertTrue(v.intValue() > _TemplateAPI.VERSION_INT_2_3_20);
+        assertTrue(v.intValue() >= _TemplateAPI.VERSION_INT_3_0_0);
         assertSame(v.toString(), Configuration.getVersionNumber());
         
         try {
@@ -318,14 +240,14 @@ public class ConfigurationTest extends TestCase {
         }
         
         try {
-            new Configuration(new Version(2, 2, 2));
+            new Configuration(new Version(2, 3, 0));
         } catch (IllegalArgumentException e) {
-            assertThat(e.getMessage(), containsString("2.3.0"));
+            assertThat(e.getMessage(), containsString("3.0.0"));
         }
     }
     
     public void testShowErrorTips() throws Exception {
-        Configuration cfg = new Configuration();
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         try {
             new Template(null, "${x}", cfg).process(null, _NullWriter.INSTANCE);
             fail();
@@ -354,7 +276,7 @@ public class ConfigurationTest extends TestCase {
         final String tUtf8Ftl = "t-utf8.ftl";
         final Integer custLookupCond = 123;
         
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setLocale(Locale.GERMAN);
         cfg.setDefaultEncoding(latin1);
         cfg.setEncoding(hu, latin2);
@@ -697,23 +619,23 @@ public class ConfigurationTest extends TestCase {
     }
 
     public void testChangingTemplateNameFormatHasEffect() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         StringTemplateLoader tl = new StringTemplateLoader();
         tl.putTemplate("a/b.ftl", "In a/b.ftl");
         tl.putTemplate("b.ftl", "In b.ftl");
         cfg.setTemplateLoader(tl);
-        
+
         {
+            cfg.setTemplateNameFormat(DefaultTemplateNameFormatFM2.INSTANCE);
             final Template template = cfg.getTemplate("a/./../b.ftl");
             assertEquals("a/b.ftl", template.getName());
             assertEquals("a/b.ftl", template.getSourceName());
             assertEquals("In a/b.ftl", template.toString());
         }
         
-        cfg.setTemplateNameFormat(DefaultTemplateNameFormat.INSTANCE);
-        
         {
+            cfg.setTemplateNameFormat(DefaultTemplateNameFormat.INSTANCE);
             final Template template = cfg.getTemplate("a/./../b.ftl");
             assertEquals("b.ftl", template.getName());
             assertEquals("b.ftl", template.getSourceName());
@@ -722,7 +644,7 @@ public class ConfigurationTest extends TestCase {
     }
 
     public void testTemplateNameFormatSetSetting() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         assertSame(DefaultTemplateNameFormatFM2.INSTANCE, cfg.getTemplateNameFormat());
         cfg.setSetting(Configuration.TEMPLATE_NAME_FORMAT_KEY, "defAult_2_4_0");
         assertSame(DefaultTemplateNameFormat.INSTANCE, cfg.getTemplateNameFormat());
@@ -734,44 +656,37 @@ public class ConfigurationTest extends TestCase {
     }
 
     public void testObjectWrapperSetSetting() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_20);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         {
             cfg.setSetting(Configurable.OBJECT_WRAPPER_KEY, "defAult");
             assertSame(_StaticObjectWrappers.DEFAULT_OBJECT_WRAPPER, cfg.getObjectWrapper());
-        }
-        
-        {
-            cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_22);
-            assertNotSame(_StaticObjectWrappers.DEFAULT_OBJECT_WRAPPER, cfg.getObjectWrapper());
             DefaultObjectWrapper dow = (DefaultObjectWrapper) cfg.getObjectWrapper();
-            assertEquals(Configuration.VERSION_2_3_22, dow.getIncompatibleImprovements());
-            assertTrue(dow.getForceLegacyNonListCollections());
+            assertEquals(Configuration.VERSION_3_0_0, dow.getIncompatibleImprovements());
         }
         
         {
-            cfg.setSetting(Configurable.OBJECT_WRAPPER_KEY, "defAult_2_3_0");
-            assertSame(_StaticObjectWrappers.DEFAULT_OBJECT_WRAPPER, cfg.getObjectWrapper());
+            cfg.setSetting(Configurable.OBJECT_WRAPPER_KEY, "simple");
+            assertSame(_StaticObjectWrappers.SIMPLE_OBJECT_WRAPPER, cfg.getObjectWrapper());
         }
         
         {
             cfg.setSetting(Configurable.OBJECT_WRAPPER_KEY,
-                    "DefaultObjectWrapper(2.3.21, useAdaptersForContainers=true, forceLegacyNonListCollections=false)");
+                    "DefaultObjectWrapper(3.0.0, useAdaptersForContainers=true, forceLegacyNonListCollections=false)");
             DefaultObjectWrapper dow = (DefaultObjectWrapper) cfg.getObjectWrapper();
-            assertEquals(Configuration.VERSION_2_3_21, dow.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, dow.getIncompatibleImprovements());
             assertFalse(dow.getForceLegacyNonListCollections());
         }
         
         {
             cfg.setSetting(Configurable.OBJECT_WRAPPER_KEY, "defAult");
             DefaultObjectWrapper dow = (DefaultObjectWrapper) cfg.getObjectWrapper();
-            assertEquals(Configuration.VERSION_2_3_22, dow.getIncompatibleImprovements());
             assertTrue(dow.getForceLegacyNonListCollections());
         }
     }
     
     public void testTemplateLookupStrategyDefaultAndSet() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         assertSame(DefaultTemplateLookupStrategy.INSTANCE, cfg.getTemplateLookupStrategy());
         
         cfg.setClassForTemplateLoading(ConfigurationTest.class, "");
@@ -806,7 +721,7 @@ public class ConfigurationTest extends TestCase {
     }
     
     public void testSetTemplateConfigurations() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         assertNull(cfg.getTemplateConfigurations());
 
         StringTemplateLoader tl = new StringTemplateLoader();
@@ -867,7 +782,7 @@ public class ConfigurationTest extends TestCase {
     }
 
     public void testSetAutoEscaping() throws Exception {
-       Configuration cfg = new Configuration();
+       Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
     
        assertEquals(Configuration.ENABLE_IF_DEFAULT_AUTO_ESCAPING_POLICY, cfg.getAutoEscapingPolicy());
 
@@ -904,7 +819,7 @@ public class ConfigurationTest extends TestCase {
     }
 
     public void testSetOutputFormat() throws Exception {
-       Configuration cfg = new Configuration();
+       Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
        
        assertEquals(UndefinedOutputFormat.INSTANCE, cfg.getOutputFormat());
        assertFalse(cfg.isOutputFormatExplicitlySet());
@@ -942,7 +857,7 @@ public class ConfigurationTest extends TestCase {
     
     @Test
     public void testGetOutputFormatByName() throws Exception {
-        Configuration cfg = new Configuration();
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         assertSame(HTMLOutputFormat.INSTANCE, cfg.getOutputFormat(HTMLOutputFormat.INSTANCE.getName()));
         
@@ -995,7 +910,7 @@ public class ConfigurationTest extends TestCase {
     }
 
     public void testSetRegisteredCustomOutputFormats() throws Exception {
-        Configuration cfg = new Configuration();
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         assertTrue(cfg.getRegisteredCustomOutputFormats().isEmpty());
         
@@ -1014,38 +929,30 @@ public class ConfigurationTest extends TestCase {
     }
 
     public void testSetRecognizeStandardFileExtensions() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
      
-        assertFalse(cfg.getRecognizeStandardFileExtensions());
+        assertTrue(cfg.getRecognizeStandardFileExtensions());
         assertFalse(cfg.isRecognizeStandardFileExtensionsExplicitlySet());
 
-        cfg.setRecognizeStandardFileExtensions(true);
-        assertTrue(cfg.getRecognizeStandardFileExtensions());
+        cfg.setRecognizeStandardFileExtensions(false);
+        assertFalse(cfg.getRecognizeStandardFileExtensions());
         assertTrue(cfg.isRecognizeStandardFileExtensionsExplicitlySet());
      
         cfg.unsetRecognizeStandardFileExtensions();
-        assertFalse(cfg.getRecognizeStandardFileExtensions());
+        assertTrue(cfg.getRecognizeStandardFileExtensions());
         assertFalse(cfg.isRecognizeStandardFileExtensionsExplicitlySet());
+        
+        cfg.setRecognizeStandardFileExtensions(true);
+        assertTrue(cfg.getRecognizeStandardFileExtensions());
+        assertTrue(cfg.isRecognizeStandardFileExtensionsExplicitlySet());
      
         cfg.setSetting(Configuration.RECOGNIZE_STANDARD_FILE_EXTENSIONS_KEY_CAMEL_CASE, "false");
         assertFalse(cfg.getRecognizeStandardFileExtensions());
         assertTrue(cfg.isRecognizeStandardFileExtensionsExplicitlySet());
         
         cfg.setSetting(Configuration.RECOGNIZE_STANDARD_FILE_EXTENSIONS_KEY_SNAKE_CASE, "default");
-        assertFalse(cfg.getRecognizeStandardFileExtensions());
-        assertFalse(cfg.isRecognizeStandardFileExtensionsExplicitlySet());
-        
-        cfg.unsetRecognizeStandardFileExtensions();
-        assertFalse(cfg.getRecognizeStandardFileExtensions());
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_24);
         assertTrue(cfg.getRecognizeStandardFileExtensions());
         assertFalse(cfg.isRecognizeStandardFileExtensionsExplicitlySet());
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_23);
-        assertFalse(cfg.getRecognizeStandardFileExtensions());
-        cfg.setRecognizeStandardFileExtensions(false);
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_24);
-        assertFalse(cfg.getRecognizeStandardFileExtensions());
-        assertTrue(cfg.isRecognizeStandardFileExtensionsExplicitlySet());
      }
     
     public void testSetTimeZone() throws TemplateException {
@@ -1054,7 +961,7 @@ public class ConfigurationTest extends TestCase {
             TimeZone sysDefTZ = TimeZone.getTimeZone("GMT-01");
             TimeZone.setDefault(sysDefTZ);
             
-            Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+            Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
             assertEquals(sysDefTZ, cfg.getTimeZone());
             assertEquals(sysDefTZ.getID(), cfg.getSetting(Configurable.TIME_ZONE_KEY));
             cfg.setSetting(Configurable.TIME_ZONE_KEY, "JVM default");
@@ -1079,7 +986,7 @@ public class ConfigurationTest extends TestCase {
             TimeZone sysDefTZ = TimeZone.getTimeZone("GMT-01");
             TimeZone.setDefault(sysDefTZ);
             
-            Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+            Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
             assertNull(cfg.getSQLDateAndTimeTimeZone());
             assertEquals("null", cfg.getSetting(Configurable.SQL_DATE_AND_TIME_TIME_ZONE_KEY));
             
@@ -1100,7 +1007,7 @@ public class ConfigurationTest extends TestCase {
     }
 
     public void testTimeZoneLayers() throws TemplateException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         Template t = new Template(null, "", cfg);
         Environment env1 = t.createProcessingEnvironment(null, new StringWriter());
         Environment env2 = t.createProcessingEnvironment(null, new StringWriter());
@@ -1183,19 +1090,19 @@ public class ConfigurationTest extends TestCase {
     public void testSetICIViaSetSettingAPI() throws TemplateException {
         Configuration cfg = new Configuration();
         assertEquals(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS, cfg.getIncompatibleImprovements());
-        cfg.setSetting(Configuration.INCOMPATIBLE_IMPROVEMENTS, "2.3.21");
-        assertEquals(Configuration.VERSION_2_3_21, cfg.getIncompatibleImprovements());
+        cfg.setSetting(Configuration.INCOMPATIBLE_IMPROVEMENTS, "3.0.0"); // This is the only valid value ATM...
+        assertEquals(Configuration.VERSION_3_0_0, cfg.getIncompatibleImprovements());
     }
 
     public void testSetLogTemplateExceptionsViaSetSettingAPI() throws TemplateException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
-        assertEquals(true, cfg.getLogTemplateExceptions());
-        cfg.setSetting(Configurable.LOG_TEMPLATE_EXCEPTIONS_KEY, "false");
-        assertEquals(false, cfg.getLogTemplateExceptions());
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
+        assertFalse(cfg.getLogTemplateExceptions());
+        cfg.setSetting(Configurable.LOG_TEMPLATE_EXCEPTIONS_KEY, "true");
+        assertTrue(cfg.getLogTemplateExceptions());
     }
     
     public void testSharedVariables() throws TemplateModelException {
-        Configuration cfg = new Configuration();
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
         cfg.setSharedVariable("erased", "");
         assertNotNull(cfg.getSharedVariable("erased"));
@@ -1226,7 +1133,7 @@ public class ConfigurationTest extends TestCase {
         cfg.setSharedVariable("b", "bbLegacy");
         
         // Cause re-wrapping of variables added via setSharedVaribles:
-        cfg.setObjectWrapper(new BeansWrapperBuilder(Configuration.VERSION_2_3_0).build());
+        cfg.setObjectWrapper(new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build());
 
         {
             TemplateScalarModel aVal = (TemplateScalarModel) cfg.getSharedVariable("a");
@@ -1245,17 +1152,15 @@ public class ConfigurationTest extends TestCase {
 
     @Test
     public void testApiBuiltinEnabled() throws IOException, TemplateException {
-        for (Version v : new Version[] { Configuration.VERSION_2_3_0, Configuration.VERSION_2_3_22 }) {
-            Configuration cfg = new Configuration(v);
-            try {
-                new Template(null, "${1?api}", cfg).process(null, _NullWriter.INSTANCE);
-                fail();
-            } catch (TemplateException e) {
-                assertThat(e.getMessage(), containsString(Configurable.API_BUILTIN_ENABLED_KEY));
-            }
-        }
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        try {
+            new Template(null, "${1?api}", cfg).process(null, _NullWriter.INSTANCE);
+            fail();
+        } catch (TemplateException e) {
+            assertThat(e.getMessage(), containsString(Configurable.API_BUILTIN_ENABLED_KEY));
+        }
+            
         cfg.setAPIBuiltinEnabled(true);
         new Template(null, "${m?api.hashCode()}", cfg)
                 .process(Collections.singletonMap("m", new HashMap()), _NullWriter.INSTANCE);
@@ -1263,7 +1168,7 @@ public class ConfigurationTest extends TestCase {
 
     @Test
     public void testTemplateUpdateDelay() throws IOException, TemplateException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
         assertEquals(DefaultTemplateResolver.DEFAULT_TEMPLATE_UPDATE_DELAY_MILLIS, cfg.getTemplateUpdateDelayMilliseconds());
         
@@ -1300,7 +1205,7 @@ public class ConfigurationTest extends TestCase {
     @Test
     @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS ", justification = "Testing wrong args")
     public void testSetCustomNumberFormat() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         try {
             cfg.setCustomNumberFormats(null);
@@ -1372,7 +1277,7 @@ public class ConfigurationTest extends TestCase {
 
     @Test
     public void testSetTabSize() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         String ftl = "${\t}";
         
@@ -1408,7 +1313,7 @@ public class ConfigurationTest extends TestCase {
 
     @Test
     public void testTabSizeSetting() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         assertEquals(8, cfg.getTabSize());
         cfg.setSetting(Configuration.TAB_SIZE_KEY_CAMEL_CASE, "4");
         assertEquals(4, cfg.getTabSize());
@@ -1426,7 +1331,7 @@ public class ConfigurationTest extends TestCase {
     @SuppressFBWarnings(value="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS", justification="We test failures")
     @Test
     public void testSetCustomDateFormat() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         try {
             cfg.setCustomDateFormats(null);
@@ -1498,7 +1403,7 @@ public class ConfigurationTest extends TestCase {
     
     @Test
     public void testHasCustomFormats() throws IOException, TemplateException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         Template t = new Template(null, "", cfg);
         Environment env = t.createProcessingEnvironment(null, null);
         assertFalse(cfg.hasCustomFormats());
@@ -1562,7 +1467,7 @@ public class ConfigurationTest extends TestCase {
     }
     
     public void testNamingConventionSetSetting() throws TemplateException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
         assertEquals(Configuration.AUTO_DETECT_NAMING_CONVENTION, cfg.getNamingConvention());
         
@@ -1577,7 +1482,7 @@ public class ConfigurationTest extends TestCase {
     }
 
     public void testLazyImportsSetSetting() throws TemplateException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
         assertFalse(cfg.getLazyImports());
         assertTrue(cfg.isLazyImportsSet());
@@ -1588,7 +1493,7 @@ public class ConfigurationTest extends TestCase {
     }
     
     public void testLazyAutoImportsSetSetting() throws TemplateException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
         assertNull(cfg.getLazyAutoImports());
         assertTrue(cfg.isLazyAutoImportsSet());
@@ -1604,7 +1509,7 @@ public class ConfigurationTest extends TestCase {
     
     @Test
     public void testGetSettingNamesAreSorted() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         for (boolean camelCase : new boolean[] { false, true }) {
             List<String> names = new ArrayList<>(cfg.getSettingNames(camelCase));
             List<String> cfgableNames = new ArrayList<>(new Template(null, "", cfg).getSettingNames(camelCase));
@@ -1623,7 +1528,7 @@ public class ConfigurationTest extends TestCase {
 
     @Test
     public void testGetSettingNamesNameConventionsContainTheSame() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         ConfigurableTest.testGetSettingNamesNameConventionsContainTheSame(
                 new ArrayList<>(cfg.getSettingNames(false)),
                 new ArrayList<>(cfg.getSettingNames(true)));
@@ -1631,7 +1536,7 @@ public class ConfigurationTest extends TestCase {
 
     @Test
     public void testStaticFieldKeysCoverAllGetSettingNames() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         List<String> names = new ArrayList<>(cfg.getSettingNames(false));
         List<String> cfgableNames = new ArrayList<>(cfg.getSettingNames(false));
         assertStartsWith(names, cfgableNames);
@@ -1644,7 +1549,7 @@ public class ConfigurationTest extends TestCase {
     
     @Test
     public void testGetSettingNamesCoversAllStaticKeyFields() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         Collection<String> names = cfg.getSettingNames(false);
         
         for (Class<? extends Configurable> cfgableClass : new Class[] { Configuration.class, Configurable.class }) {
@@ -1664,7 +1569,7 @@ public class ConfigurationTest extends TestCase {
 
     @Test
     public void testGetSettingNamesCoversAllSettingNames() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         Collection<String> names = cfg.getSettingNames(false);
         
         for (Field f : Configurable.class.getFields()) {
@@ -1677,7 +1582,7 @@ public class ConfigurationTest extends TestCase {
 
     @Test
     public void testSetSettingSupportsBothNamingConventions() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         cfg.setSetting(Configuration.DEFAULT_ENCODING_KEY_CAMEL_CASE, "UTF-16LE");
         assertEquals("UTF-16LE", cfg.getDefaultEncoding());

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/CustomAttributeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/CustomAttributeTest.java b/src/test/java/org/apache/freemarker/core/CustomAttributeTest.java
index 3f314e8..6ee16cc 100644
--- a/src/test/java/org/apache/freemarker/core/CustomAttributeTest.java
+++ b/src/test/java/org/apache/freemarker/core/CustomAttributeTest.java
@@ -19,7 +19,11 @@
 
 package org.apache.freemarker.core;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.fail;
 
 import java.math.BigDecimal;
 import java.util.Arrays;
@@ -55,7 +59,7 @@ public class CustomAttributeTest {
     
     @Test
     public void testStringKey() throws Exception {
-        Template t = new Template(null, "", new Configuration(Configuration.VERSION_2_3_22));
+        Template t = new Template(null, "", new Configuration(Configuration.VERSION_3_0_0));
         assertEquals(0, t.getCustomAttributeNames().length);        
         assertNull(t.getCustomAttribute(KEY_1));
         
@@ -86,7 +90,7 @@ public class CustomAttributeTest {
 
     @Test
     public void testRemoveFromEmptySet() throws Exception {
-        Template t = new Template(null, "", new Configuration(Configuration.VERSION_2_3_22));
+        Template t = new Template(null, "", new Configuration(Configuration.VERSION_3_0_0));
         t.removeCustomAttribute(KEY_1);
         assertEquals(0, t.getCustomAttributeNames().length);        
         assertNull(t.getCustomAttribute(KEY_1));
@@ -102,7 +106,7 @@ public class CustomAttributeTest {
                 + "'" + KEY_1 + "': [ 's', 2, true, {  'a': 'A' } ], "
                 + "'" + KEY_2 + "': " + VALUE_BIGDECIMAL + " "
                 + "}>",
-                new Configuration(Configuration.VERSION_2_3_22));
+                new Configuration(Configuration.VERSION_3_0_0));
         
         assertArrayEquals(new String[] { KEY_1, KEY_2 }, sort(t.getCustomAttributeNames()));
         assertEquals(VALUE_LIST, t.getCustomAttribute(KEY_1));
@@ -120,7 +124,7 @@ public class CustomAttributeTest {
                 + "'" + KEY_2 + "': 'b', "
                 + "'" + KEY_3 + "': 'c' "
                 + "}>",
-                new Configuration(Configuration.VERSION_2_3_22));
+                new Configuration(Configuration.VERSION_3_0_0));
         
         assertArrayEquals(new String[] { KEY_1, KEY_2, KEY_3 }, sort(t.getCustomAttributeNames()));
         assertEquals("a", t.getCustomAttribute(KEY_1));
@@ -141,7 +145,7 @@ public class CustomAttributeTest {
                 + "'" + KEY_2 + "': 'b', "
                 + "'" + KEY_3 + "': 'c' "
                 + "}>",
-                new Configuration(Configuration.VERSION_2_3_22));
+                new Configuration(Configuration.VERSION_3_0_0));
         
         assertArrayEquals(new String[] { KEY_1, KEY_2, KEY_3 }, sort(t.getCustomAttributeNames()));
         assertEquals("a", t.getCustomAttribute(KEY_1));
@@ -162,7 +166,7 @@ public class CustomAttributeTest {
 
     @Test
     public void testObjectKey() throws Exception {
-        Template t = new Template(null, "", new Configuration(Configuration.VERSION_2_3_22));
+        Template t = new Template(null, "", new Configuration(Configuration.VERSION_3_0_0));
         assertNull(CUST_ATT_TMP_1.get(t));
         
         CUST_ATT_TMP_1.set(VALUE_1, t);
@@ -194,7 +198,7 @@ public class CustomAttributeTest {
             // Expected
         }
         
-        final Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        final Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         final Template t = new Template(null, "${testScopesFromTemplateStep1()}", cfg);
         Environment env = t.createProcessingEnvironment(this, _NullWriter.INSTANCE);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ExceptionTest.java b/src/test/java/org/apache/freemarker/core/ExceptionTest.java
index c2f2a9f..3dcf97f 100644
--- a/src/test/java/org/apache/freemarker/core/ExceptionTest.java
+++ b/src/test/java/org/apache/freemarker/core/ExceptionTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.freemarker.core;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertThat;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -94,7 +94,7 @@ public class ExceptionTest extends TestCase {
 
     @SuppressWarnings("cast")
     public void testParseExceptionLocationInformation() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_21);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         StringTemplateLoader tl = new StringTemplateLoader();
         tl.putTemplate("foo_en.ftl", "\n\nxxx<#noSuchDirective>");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/GetSourceTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/GetSourceTest.java b/src/test/java/org/apache/freemarker/core/GetSourceTest.java
index 4f6e66e..ef2783b 100644
--- a/src/test/java/org/apache/freemarker/core/GetSourceTest.java
+++ b/src/test/java/org/apache/freemarker/core/GetSourceTest.java
@@ -20,16 +20,13 @@ package org.apache.freemarker.core;
 
 import static org.junit.Assert.assertEquals;
 
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.Template;
 import org.junit.Test;
 
 public class GetSourceTest {
 
-    
     @Test
     public void testGetSource() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         {
             // Note: Default tab size is 8.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/MistakenlyPublicImportAPIsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/MistakenlyPublicImportAPIsTest.java b/src/test/java/org/apache/freemarker/core/MistakenlyPublicImportAPIsTest.java
index 5d742bd..04054ad 100644
--- a/src/test/java/org/apache/freemarker/core/MistakenlyPublicImportAPIsTest.java
+++ b/src/test/java/org/apache/freemarker/core/MistakenlyPublicImportAPIsTest.java
@@ -19,17 +19,19 @@
 
 package org.apache.freemarker.core;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.io.StringWriter;
 import java.util.List;
 
 import org.apache.freemarker.core.ast.Environment;
+import org.apache.freemarker.core.ast.Environment.Namespace;
 import org.apache.freemarker.core.ast.InvalidReferenceException;
 import org.apache.freemarker.core.ast.LibraryLoad;
-import org.apache.freemarker.core.ast.Environment.Namespace;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.templateresolver.impl.StringTemplateLoader;
 import org.apache.freemarker.core.util._NullWriter;
@@ -42,7 +44,7 @@ public class MistakenlyPublicImportAPIsTest {
 
     @Test
     public void testImportCopying() throws IOException, TemplateException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         StringTemplateLoader tl = new StringTemplateLoader();
         tl.putTemplate("imp1", "<#macro m>1</#macro>");
         tl.putTemplate("imp2", "<#assign x = 2><#macro m>${x}</#macro>");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/MistakenlyPublicMacroAPIsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/MistakenlyPublicMacroAPIsTest.java b/src/test/java/org/apache/freemarker/core/MistakenlyPublicMacroAPIsTest.java
index 594af53..21e80c2 100644
--- a/src/test/java/org/apache/freemarker/core/MistakenlyPublicMacroAPIsTest.java
+++ b/src/test/java/org/apache/freemarker/core/MistakenlyPublicMacroAPIsTest.java
@@ -19,8 +19,9 @@
 
 package org.apache.freemarker.core;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
 
 import java.io.IOException;
 import java.io.StringWriter;
@@ -37,7 +38,7 @@ import org.junit.Test;
  */
 public class MistakenlyPublicMacroAPIsTest {
 
-    private final Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+    private final Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
     
     /**
      * Getting the macros from one template, and adding them to another.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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 977c29a..7d9b00e 100644
--- a/src/test/java/org/apache/freemarker/core/SimpleObjetWrapperTest.java
+++ b/src/test/java/org/apache/freemarker/core/SimpleObjetWrapperTest.java
@@ -19,8 +19,11 @@
 
 package org.apache.freemarker.core;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.IOException;
@@ -34,9 +37,6 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateCollectionModel;
 import org.apache.freemarker.core.model.TemplateDateModel;
@@ -56,7 +56,7 @@ public class SimpleObjetWrapperTest {
     
     @Test
     public void testDoesNotAllowAPIBuiltin() throws TemplateModelException {
-        SimpleObjectWrapper sow = new SimpleObjectWrapper(Configuration.VERSION_2_3_22);
+        SimpleObjectWrapper sow = new SimpleObjectWrapper(Configuration.VERSION_3_0_0);
         
         TemplateModelWithAPISupport map = (TemplateModelWithAPISupport) sow.wrap(new HashMap());
         try {
@@ -70,19 +70,17 @@ public class SimpleObjetWrapperTest {
     @SuppressWarnings("boxing")
     @Test
     public void testCanWrapBasicTypes() throws TemplateModelException {
-        for (Version version : new Version[] { Configuration.VERSION_2_3_0, Configuration.VERSION_2_3_22 }) {
-            SimpleObjectWrapper sow = new SimpleObjectWrapper(version);
-            assertTrue(sow.wrap("s") instanceof TemplateScalarModel);
-            assertTrue(sow.wrap(1) instanceof TemplateNumberModel);
-            assertTrue(sow.wrap(true) instanceof TemplateBooleanModel);
-            assertTrue(sow.wrap(new Date()) instanceof TemplateDateModel);
-            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);
-            assertNull(sow.wrap(null));
-        }
+        SimpleObjectWrapper sow = new SimpleObjectWrapper(Configuration.VERSION_3_0_0);
+        assertTrue(sow.wrap("s") instanceof TemplateScalarModel);
+        assertTrue(sow.wrap(1) instanceof TemplateNumberModel);
+        assertTrue(sow.wrap(true) instanceof TemplateBooleanModel);
+        assertTrue(sow.wrap(new Date()) instanceof TemplateDateModel);
+        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);
+        assertNull(sow.wrap(null));
     }
     
     @Test
@@ -93,7 +91,7 @@ public class SimpleObjetWrapperTest {
         is.setCharacterStream(new StringReader("<doc><sub a='1' /></doc>"));
         Document doc = db.parse(is);
         
-        SimpleObjectWrapper sow = new SimpleObjectWrapper(Configuration.VERSION_2_3_22);
+        SimpleObjectWrapper sow = new SimpleObjectWrapper(Configuration.VERSION_3_0_0);
         try {
             sow.wrap(doc);
             fail();
@@ -104,7 +102,7 @@ public class SimpleObjetWrapperTest {
     
     @Test
     public void testWontWrapGenericObjects() {
-        SimpleObjectWrapper sow = new SimpleObjectWrapper(Configuration.VERSION_2_3_22);
+        SimpleObjectWrapper sow = new SimpleObjectWrapper(Configuration.VERSION_3_0_0);
         try {
             sow.wrap(new File("/x"));
             fail();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/TemplateConstructorsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/TemplateConstructorsTest.java b/src/test/java/org/apache/freemarker/core/TemplateConstructorsTest.java
index f64128b..5e93fef 100644
--- a/src/test/java/org/apache/freemarker/core/TemplateConstructorsTest.java
+++ b/src/test/java/org/apache/freemarker/core/TemplateConstructorsTest.java
@@ -19,15 +19,16 @@
 
 package org.apache.freemarker.core;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.io.Reader;
 import java.io.StringReader;
 
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.Template;
 import org.junit.Test;
 public class TemplateConstructorsTest {
 
@@ -36,7 +37,7 @@ public class TemplateConstructorsTest {
     
     @Test
     public void test() throws IOException {
-        final Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        final Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         //cfg.setDefaultEncoding("ISO-8859-1");
         
         final String name = "foo/bar.ftl";

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/TemplateLanguageVersionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/TemplateLanguageVersionTest.java b/src/test/java/org/apache/freemarker/core/TemplateLanguageVersionTest.java
index ab67d25..1c8217a 100644
--- a/src/test/java/org/apache/freemarker/core/TemplateLanguageVersionTest.java
+++ b/src/test/java/org/apache/freemarker/core/TemplateLanguageVersionTest.java
@@ -19,14 +19,13 @@
 
 package org.apache.freemarker.core;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.Template;
-import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.templateresolver.impl.StringTemplateLoader;
 import org.apache.freemarker.test.util.TestUtil;
 import org.junit.Test;
@@ -34,13 +33,9 @@ public class TemplateLanguageVersionTest {
 
     @Test
     public void testDefaultVersion() throws IOException {
-        testDefaultWithVersion(Configuration.VERSION_2_3_0, Configuration.VERSION_2_3_0);
-        testDefaultWithVersion(new Version(2, 3, 18), Configuration.VERSION_2_3_0);
-        testDefaultWithVersion(Configuration.VERSION_2_3_19, Configuration.VERSION_2_3_19);
-        testDefaultWithVersion(Configuration.VERSION_2_3_20, Configuration.VERSION_2_3_20);
-        testDefaultWithVersion(Configuration.VERSION_2_3_21, Configuration.VERSION_2_3_21);
+        testDefaultWithVersion(Configuration.VERSION_3_0_0, Configuration.VERSION_3_0_0);
         try {
-            testDefaultWithVersion(TestUtil.getClosestFutureVersion(), Configuration.VERSION_2_3_21);
+            testDefaultWithVersion(TestUtil.getClosestFutureVersion(), Configuration.VERSION_3_0_0);
             fail("Maybe you need to update this test for the new FreeMarker version");
         } catch (IllegalArgumentException e) {
             assertThat(e.getMessage(), containsString("version"));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java b/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java
index f8b443a..1638ff7 100644
--- a/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java
+++ b/src/test/java/org/apache/freemarker/core/TemplateLookupStrategyTest.java
@@ -43,7 +43,7 @@ public class TemplateLookupStrategyTest {
 
     @Test
     public void testSetSetting() throws TemplateException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         assertSame(DefaultTemplateLookupStrategy.INSTANCE, cfg.getTemplateLookupStrategy());
 
         cfg.setSetting(Configuration.TEMPLATE_LOOKUP_STRATEGY_KEY, MyTemplateLookupStrategy.class.getName() + "()");
@@ -55,7 +55,7 @@ public class TemplateLookupStrategyTest {
     
     @Test
     public void testCustomStrategy() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
         tl.putTextTemplate("test.ftl", "");
@@ -90,7 +90,7 @@ public class TemplateLookupStrategyTest {
     
     @Test
     public void testDefaultStrategy() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
         tl.putTextTemplate("test.ftl", "");
@@ -260,7 +260,7 @@ public class TemplateLookupStrategyTest {
     
     @Test
     public void testAcquisition() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
         tl.putTextTemplate("t.ftl", "");
@@ -303,11 +303,8 @@ public class TemplateLookupStrategyTest {
     
     @Test
     public void testCustomLookupCondition() throws IOException, TemplateException {
-        testCustomLookup(new Configuration(Configuration.VERSION_2_3_0));
-        testCustomLookup(new Configuration(Configuration.VERSION_2_3_22));
-    }
-
-    private void testCustomLookup(Configuration cfg) throws IOException, TemplateException {
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
+        
         final String iAtDefaultContent = "i at default";
         final String iXxAtDefaultContent = "i_xx at default";
         final String iAtBaazComContent = "i at baaz.com";
@@ -533,7 +530,7 @@ public class TemplateLookupStrategyTest {
     
     @Test
     public void testNonparsed() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
         tl.putTextTemplate("test.txt", "");
@@ -569,7 +566,7 @@ public class TemplateLookupStrategyTest {
 
     @Test
     public void testParseError() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
         tl.putTextTemplate("test.ftl", "");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java b/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java
index ff9812c..cd6a0a3 100644
--- a/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java
+++ b/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java
@@ -29,8 +29,7 @@ import static org.junit.Assert.fail;
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.TemplateNotFoundException;
+import org.apache.freemarker.core.templateresolver.MalformedTemplateNameException;
 import org.apache.freemarker.core.templateresolver.TemplateLoader;
 import org.apache.freemarker.core.templateresolver.TemplateLookupContext;
 import org.apache.freemarker.core.templateresolver.TemplateLookupResult;
@@ -109,20 +108,24 @@ public class TemplateNotFoundMessageTest {
     
     @Test
     public void testOtherMessageDetails() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setTemplateLoader(new StringTemplateLoader());
         
         {
             String errMsg = failWith("../x", cfg);
             showErrorMessage(errMsg);
             assertThat(errMsg,
-                    allOf(containsStringIgnoringCase("reason"), containsStringIgnoringCase("root directory")));
+                    allOf(
+                            containsStringIgnoringCase("Malformed template name"),
+                            containsStringIgnoringCase("root directory")));
         }
         {
             String errMsg = failWith("x\u0000y", cfg);
             showErrorMessage(errMsg);
             assertThat(errMsg,
-                    allOf(containsStringIgnoringCase("reason"), containsStringIgnoringCase("null character")));
+                    allOf(
+                            containsStringIgnoringCase("Malformed template name"),
+                            containsStringIgnoringCase("null character")));
         }
         {
             String errMsg = failWith("x\\y", cfg);
@@ -180,16 +183,16 @@ public class TemplateNotFoundMessageTest {
         try {
             cfg.getTemplate(name);
             fail();
-        } catch (TemplateNotFoundException e) {
+        } catch (TemplateNotFoundException | MalformedTemplateNameException e) {
             return e.getMessage();
         } catch (IOException e) {
-            fail();
+            fail("Unexpected exception: " + e);
         }
         return null;
     }
     
     private String failWith(TemplateLoader tl) {
-        return failWith(tl, "missing.ftl", new Configuration(Configuration.VERSION_2_3_21));
+        return failWith(tl, "missing.ftl", new Configuration(Configuration.VERSION_3_0_0));
     }
 
     private String failWith(Configuration cfg) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/ASTBasedErrorMessagesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/ASTBasedErrorMessagesTest.java b/src/test/java/org/apache/freemarker/core/ast/ASTBasedErrorMessagesTest.java
index 6cb3ffc..62aadb4 100644
--- a/src/test/java/org/apache/freemarker/core/ast/ASTBasedErrorMessagesTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/ASTBasedErrorMessagesTest.java
@@ -27,11 +27,6 @@ import org.junit.Test;
 public class ASTBasedErrorMessagesTest extends TemplateTest {
     
     @Test
-    public void testOverloadSelectionError() {
-        assertErrorContains("${overloads.m(null)}", "2.3.21", "overloaded");
-    }
-    
-    @Test
     public void testInvalidRefBasic() {
         assertErrorContains("${foo}", "foo", "specify a default");
         assertErrorContains("${map[foo]}", "foo", "\\!map[", "specify a default");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/ASTPrinter.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/ASTPrinter.java b/src/test/java/org/apache/freemarker/core/ast/ASTPrinter.java
index 82a37a9..73fc4a4 100644
--- a/src/test/java/org/apache/freemarker/core/ast/ASTPrinter.java
+++ b/src/test/java/org/apache/freemarker/core/ast/ASTPrinter.java
@@ -69,8 +69,7 @@ public class ASTPrinter {
     }
     
     private ASTPrinter() {
-        cfg = new Configuration();
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_20);
+        cfg = new Configuration(Configuration.VERSION_3_0_0);
     }
     
     private void mainSingleTemplate(String[] args) throws IOException, FileNotFoundException {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/BreakPlacementTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/BreakPlacementTest.java b/src/test/java/org/apache/freemarker/core/ast/BreakPlacementTest.java
index ec0398a..0a435ba 100644
--- a/src/test/java/org/apache/freemarker/core/ast/BreakPlacementTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/BreakPlacementTest.java
@@ -56,11 +56,9 @@ public class BreakPlacementTest extends TemplateTest {
     }
 
     @Test
-    public void testInvalidPlacementMacroLoophole() throws IOException, TemplateException {
+    public void testInvalidPlacementInsideMacro() throws IOException, TemplateException {
         final String ftl = "<#list 1..2 as x>${x}<#macro m><#break></#macro></#list>";
-        getConfiguration().setIncompatibleImprovements(Configuration.VERSION_2_3_22);
-        assertOutput(ftl, "12");
-        getConfiguration().setIncompatibleImprovements(Configuration.VERSION_2_3_23);
+        getConfiguration().setIncompatibleImprovements(Configuration.VERSION_3_0_0);
         assertErrorContains(ftl, BREAK_NESTING_ERROR_MESSAGE_PART);
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/CanonicalFormTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/CanonicalFormTest.java b/src/test/java/org/apache/freemarker/core/ast/CanonicalFormTest.java
index 7c584cd..8af0b34 100644
--- a/src/test/java/org/apache/freemarker/core/ast/CanonicalFormTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/CanonicalFormTest.java
@@ -24,7 +24,6 @@ import java.io.StringWriter;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.TemplateNotFoundException;
-import org.apache.freemarker.core.ast.ParseException;
 import org.apache.freemarker.core.templateresolver.MalformedTemplateNameException;
 import org.apache.freemarker.core.templateresolver.impl.ClassTemplateLoader;
 import org.apache.freemarker.test.CopyrightCommentRemoverTemplateLoader;
@@ -58,7 +57,7 @@ public class CanonicalFormTest extends FileTestCase {
     
     private void assertCanonicalFormOf(String ftlFileName)
             throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setTemplateLoader(
                 new CopyrightCommentRemoverTemplateLoader(
                         new ClassTemplateLoader(CanonicalFormTest.class, "")));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/ConfigurableTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/ConfigurableTest.java b/src/test/java/org/apache/freemarker/core/ast/ConfigurableTest.java
index a4618a6..c4a6f83 100644
--- a/src/test/java/org/apache/freemarker/core/ast/ConfigurableTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/ConfigurableTest.java
@@ -19,8 +19,12 @@
 
 package org.apache.freemarker.core.ast;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.lang.reflect.Field;
@@ -32,7 +36,6 @@ import java.util.Set;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
-import org.apache.freemarker.core.ast.Configurable;
 import org.apache.freemarker.core.util._StringUtil;
 import org.junit.Test;
 
@@ -164,7 +167,7 @@ public class ConfigurableTest {
     }
     
     private Configurable createConfigurable() throws IOException {
-        return new Template(null, "", new Configuration(Configuration.VERSION_2_3_22));
+        return new Template(null, "", new Configuration(Configuration.VERSION_3_0_0));
     }
 
     private boolean keyFieldExists(String name) throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/DateFormatTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/DateFormatTest.java b/src/test/java/org/apache/freemarker/core/ast/DateFormatTest.java
index a0c7f95..3ac2763 100644
--- a/src/test/java/org/apache/freemarker/core/ast/DateFormatTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/DateFormatTest.java
@@ -18,8 +18,10 @@
  */
 package org.apache.freemarker.core.ast;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
 
 import java.io.IOException;
 import java.sql.Time;
@@ -32,12 +34,6 @@ import java.util.TimeZone;
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.ast.AliasTemplateDateFormatFactory;
-import org.apache.freemarker.core.ast.Environment;
-import org.apache.freemarker.core.ast.TemplateConfiguration;
-import org.apache.freemarker.core.ast.TemplateDateFormat;
-import org.apache.freemarker.core.ast.TemplateDateFormatFactory;
-import org.apache.freemarker.core.ast.UndefinedCustomFormatException;
 import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.impl.SimpleDate;
@@ -58,7 +54,7 @@ public class DateFormatTest extends TemplateTest {
     @Before
     public void setup() {
         Configuration cfg = getConfiguration();
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_24);
+        cfg.setIncompatibleImprovements(Configuration.VERSION_3_0_0);
         cfg.setLocale(Locale.US);
         cfg.setTimeZone(TimeZone.getTimeZone("GMT+01:00"));
         cfg.setSQLDateAndTimeTimeZone(TimeZone.getTimeZone("UTC"));
@@ -212,38 +208,19 @@ public class DateFormatTest extends TemplateTest {
         Configuration cfg = getConfiguration();
         addToDataModel("d", new SimpleDate(new Date(12345678L), TemplateDateModel.DATETIME));
         
-        testIcIAndEscapingWhenCustFormsAreAccepted(cfg);
-        
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_23);
-        testIcIAndEscapingWhenCustFormsAreAccepted(cfg);
-        
-        cfg.setCustomDateFormats(Collections.<String, TemplateDateFormatFactory>emptyMap());
-        
         cfg.setDateTimeFormat("@epoch");
-        assertErrorContains("${d}", "\"@epoch\"");
+        assertOutput("${d}", "12345678");
         cfg.setDateTimeFormat("'@'yyyy");
         assertOutput("${d}", "@1970");
         cfg.setDateTimeFormat("@@yyyy");
         assertOutput("${d}", "@@1970");
         
-        cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_24);
+        cfg.setCustomDateFormats(Collections.<String, TemplateDateFormatFactory>emptyMap());
+        
         cfg.setDateTimeFormat("@epoch");
         assertErrorContains("${d}", "custom", "\"epoch\"");
-        cfg.setDateTimeFormat("'@'yyyy");
-        assertOutput("${d}", "@1970");
-        cfg.setDateTimeFormat("@@yyyy");
-        assertOutput("${d}", "@@1970");
     }
 
-    protected void testIcIAndEscapingWhenCustFormsAreAccepted(Configuration cfg) throws IOException, TemplateException {
-        cfg.setDateTimeFormat("@epoch");
-        assertOutput("${d}", "12345678");
-        cfg.setDateTimeFormat("'@'yyyy");
-        assertOutput("${d}", "@1970");
-        cfg.setDateTimeFormat("@@yyyy");
-        assertOutput("${d}", "@@1970");
-    }
-    
     @Test
     public void testEnvironmentGetters() throws Exception {
         Template t = new Template(null, "", getConfiguration());

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/DirectiveCallPlaceTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/DirectiveCallPlaceTest.java b/src/test/java/org/apache/freemarker/core/ast/DirectiveCallPlaceTest.java
index 24e0a31..142552b 100644
--- a/src/test/java/org/apache/freemarker/core/ast/DirectiveCallPlaceTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/DirectiveCallPlaceTest.java
@@ -28,10 +28,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.ast.CallPlaceCustomDataInitializationException;
-import org.apache.freemarker.core.ast.DirectiveCallPlace;
-import org.apache.freemarker.core.ast.Environment;
-import org.apache.freemarker.core.ast.UnifiedCall;
 import org.apache.freemarker.core.model.TemplateDirectiveBody;
 import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateModel;
@@ -45,7 +41,7 @@ public class DirectiveCallPlaceTest extends TemplateTest {
     
     @Override
     protected Configuration createConfiguration() {
-        return new Configuration(Configuration.VERSION_2_3_22);
+        return new Configuration(Configuration.VERSION_3_0_0);
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/EncodingOverrideTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/EncodingOverrideTest.java b/src/test/java/org/apache/freemarker/core/ast/EncodingOverrideTest.java
index 90c72f8..ed4a190 100644
--- a/src/test/java/org/apache/freemarker/core/ast/EncodingOverrideTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/EncodingOverrideTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 import java.io.StringWriter;
@@ -60,7 +60,7 @@ public class EncodingOverrideTest {
     }
     
     private Configuration createConfig(String charset) {
-       Configuration cfg = new Configuration(Configuration.VERSION_2_3_21);
+       Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
        cfg.setClassForTemplateLoading(EncodingOverrideTest.class, "");
        cfg.setDefaultEncoding(charset);
        return cfg;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/EnvironmentCustomStateTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/EnvironmentCustomStateTest.java b/src/test/java/org/apache/freemarker/core/ast/EnvironmentCustomStateTest.java
index 38722be..9bd9480 100644
--- a/src/test/java/org/apache/freemarker/core/ast/EnvironmentCustomStateTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/EnvironmentCustomStateTest.java
@@ -18,11 +18,11 @@
  */
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
-import org.apache.freemarker.core.ast.Environment;
 import org.junit.Test;
 
 public class EnvironmentCustomStateTest {
@@ -32,7 +32,7 @@ public class EnvironmentCustomStateTest {
 
     @Test
     public void test() throws Exception {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_24);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         Template t = new Template(null, "", cfg);
         Environment env = t.createProcessingEnvironment(null, null);
         assertNull(env.getCustomState(KEY_1));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java b/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java
index 2243e6f..1359f18 100644
--- a/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/EnvironmentGetTemplateVariantsTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.freemarker.core.ast;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertSame;
 
 import java.io.IOException;
 import java.io.Writer;
@@ -30,7 +30,6 @@ import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core.ast.Environment;
 import org.apache.freemarker.core.model.TemplateDirectiveBody;
 import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateModel;
@@ -125,74 +124,67 @@ public class EnvironmentGetTemplateVariantsTest extends TemplateTest {
                 );
     }
     
-    private final static String EXPECTED_2_3_21 =
-            "<t=main ct=main mt=main>\n"
-            + "---1---\n"
-            + "[imp: <t=imp ct=imp mt=main>]\n"
-            + "---2---\n"
-            + "[impM: <t=main ct=imp mt=main>\n"
-                + "{<t=main ct=main mt=main>}\n"
-                + "[inc: <t=inc ct=inc mt=main>\n"
-                    + "[incM: <t=inc ct=inc mt=main> {<t=imp ct=inc mt=main>}]\n"
-                    + "[incInc: <t=inc ct=inc mt=main>\n"
-                        + "[incM: <t=inc ct=inc mt=main> {<t=imp ct=inc mt=main>}]\n"
+    @Test
+    public void test() throws IOException, TemplateException {
+        setConfiguration(createConfiguration(Configuration.VERSION_3_0_0));
+        assertOutputForNamed(
+                "main",
+                "<t=main ct=main mt=main>\n"
+                + "---1---\n"
+                + "[imp: <t=main ct=imp mt=main>]\n"
+                + "---2---\n"
+                + "[impM: <t=main ct=imp mt=main>\n"
+                    + "{<t=main ct=main mt=main>}\n"
+                    + "[inc: <t=main ct=inc mt=main>\n"
+                        + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
+                        + "[incInc: <t=main ct=inc mt=main>\n"
+                            + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
+                        + "]\n"
                     + "]\n"
+                    + "[incM: <t=main ct=inc mt=main> {<t=main ct=imp mt=main>}]\n"
                 + "]\n"
-                + "[incM: <t=main ct=inc mt=main> {<t=imp ct=imp mt=main>}]\n"
-            + "]\n"
-            + "---3---\n"
-            + "[inc: <t=inc ct=inc mt=main>\n"
-                + "[incM: <t=inc ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
-                + "[incInc: <t=inc ct=inc mt=main>\n"
-                    + "[incM: <t=inc ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
+                + "---3---\n"
+                + "[inc: <t=main ct=inc mt=main>\n"
+                    + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
+                    + "[incInc: <t=main ct=inc mt=main>\n"
+                        + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
+                    + "]\n"
                 + "]\n"
-            + "]\n"
-            + "---4---\n"
-            + "[incM: <t=main ct=inc mt=main> {<t=main ct=main mt=main>}]\n"
-            + "---5---\n"
-            + "[inc2: <t=inc2 ct=inc2 mt=main>\n"
-                + "[impM: <t=inc2 ct=imp mt=main>\n"
-                    + "{<t=main ct=inc2 mt=main>}\n"
-                    + "[inc: <t=inc ct=inc mt=main>\n"
-                        + "[incM: <t=inc ct=inc mt=main> {<t=imp ct=inc mt=main>}]\n"
+                + "---4---\n"
+                + "[incM: <t=main ct=inc mt=main> {<t=main ct=main mt=main>}]\n"
+                + "---5---\n"
+                + "[inc2: <t=main ct=inc2 mt=main>\n"
+                    + "[impM: <t=main ct=imp mt=main>\n"
+                        + "{<t=main ct=inc2 mt=main>}\n"
+                        + "[inc: <t=main ct=inc mt=main>\n"
+                            + "[incM: <t=main ct=inc mt=main> {<t=main ct=inc mt=main>}]\n"
+                        + "]\n"
+                        + "[incM: <t=main ct=inc mt=main> {<t=main ct=imp mt=main>}]\n"
                     + "]\n"
-                    + "[incM: <t=inc2 ct=inc mt=main> {<t=imp ct=imp mt=main>}]\n"
                 + "]\n"
-            + "]\n"
-            + "---6---\n"
-            + "[impM2: <t=main ct=imp mt=main>\n"
-                + "{<t=main ct=main mt=main>}\n"
-                + "[imp2M: <t=main ct=imp2 mt=main> {<t=imp ct=imp mt=main>}]\n"
-            + "]\n"
-            + "---7---\n"
-            + "[inc3: <t=inc3 ct=inc3 mt=main>\n"
-                + "[mainM: <t=inc3 ct=main mt=main> {<t=main ct=inc3 mt=main>} <t=inc3 ct=main mt=main>]\n"
-            + "]\n"
-            + "[mainM: "
-                + "<t=main ct=main mt=main> "
-                + "{<t=main ct=main mt=main> <t=inc4 ct=inc4 mt=main> <t=main ct=main mt=main>} "
-                + "<t=main ct=main mt=main>"
-            + "]\n"
-            + "<t=main ct=main mt=main>\n"
-            + "---8---\n"
-            + "mainF: <t=main ct=main mt=main>, impF: <t=main ct=imp mt=main>, incF: <t=main ct=inc mt=main>\n"
-            ;
-
-    @Test
-    public void test2321() throws IOException, TemplateException {
-        setConfiguration(createConfiguration(Configuration.VERSION_2_3_21));
-        assertOutputForNamed("main", EXPECTED_2_3_21);
-    }
-
-    @Test
-    public void test2322() throws IOException, TemplateException {
-        setConfiguration(createConfiguration(Configuration.VERSION_2_3_22));
-        assertOutputForNamed("main", EXPECTED_2_3_21.replaceAll("<t=\\w+", "<t=main"));
+                + "---6---\n"
+                + "[impM2: <t=main ct=imp mt=main>\n"
+                    + "{<t=main ct=main mt=main>}\n"
+                    + "[imp2M: <t=main ct=imp2 mt=main> {<t=main ct=imp mt=main>}]\n"
+                + "]\n"
+                + "---7---\n"
+                + "[inc3: <t=main ct=inc3 mt=main>\n"
+                    + "[mainM: <t=main ct=main mt=main> {<t=main ct=inc3 mt=main>} <t=main ct=main mt=main>]\n"
+                + "]\n"
+                + "[mainM: "
+                    + "<t=main ct=main mt=main> "
+                    + "{<t=main ct=main mt=main> <t=main ct=inc4 mt=main> <t=main ct=main mt=main>} "
+                    + "<t=main ct=main mt=main>"
+                + "]\n"
+                + "<t=main ct=main mt=main>\n"
+                + "---8---\n"
+                + "mainF: <t=main ct=main mt=main>, impF: <t=main ct=imp mt=main>, incF: <t=main ct=inc mt=main>\n"
+                .replaceAll("<t=\\w+", "<t=main"));
     }
 
     @Test
     public void testNotStarted() throws IOException, TemplateException {
-        Template t = new Template("foo", "", createConfiguration(Configuration.VERSION_2_3_21));
+        Template t = new Template("foo", "", createConfiguration(Configuration.VERSION_3_0_0));
         final Environment env = t.createProcessingEnvironment(null, null);
         assertSame(t, env.getMainTemplate());
         assertSame(t, env.getCurrentTemplate());



[2/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.21.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.21.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.21.ftl
deleted file mode 100644
index 43684a8..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.21.ftl
+++ /dev/null
@@ -1,349 +0,0 @@
-<#--
-  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.
--->
-<#-- Since with IcI 2.3.21+ the results must not depend on method introspection order, there's only once template -->
-
-<#include "overloaded-methods-2-common.ftl">
-
-<@assertEquals actual=obj.mVarargs('a', obj.getNnS('b'), obj.getNnS('c')) expected='mVarargs(String... a1 = abc)' />
-
-<@assertEquals actual=obj.mNull1(null) expected="mNull1(String a1 = null)" />
-<@assertEquals actual=obj.mNull1(123) expected="mNull1(int a1 = 123)" />
-<@assertEquals actual=obj.mNull2(null) expected="mNull2(String a1 = null)" />
-<@assertEquals actual=obj.mVarargs('a', null) expected="mVarargs(String... a1 = anull)" />
-<@assertEquals actual=obj.mVarargs(null, 'a') expected="mVarargs(File a1, String... a2)" />
-<@assertEquals actual=obj.mSpecificity('a', 'b') expected="mSpecificity(String a1, Object a2)" />
-
-<@assertEquals actual=obj.mChar('a') expected='mChar(char a1 = a)' />
-<@assertEquals actual=obj.mBoolean(true) expected="mBoolean(boolean a1 = true)" />
-<@assertEquals actual=obj.mBoolean(null) expected="mBoolean(Boolean a1 = null)" />
-
-<@assertEquals actual=obj.mIntNonOverloaded(123?long) expected=123 />
-<@assertEquals actual=obj.mIntNonOverloaded(123) expected=123 />
-<@assertEquals actual=obj.mIntNonOverloaded(123.5) expected=123 />
-<@assertEquals actual=obj.mIntNonOverloaded(2147483648) expected=-2147483648 /> <#-- overflow -->
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123.5) expected='mNumBoxedVSBoxed(Long a1 = 123)' />
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123?int) expected='mNumBoxedVSBoxed(Long a1 = 123)' />
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123?long) expected="mNumBoxedVSBoxed(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123?short) expected="mNumBoxedVSBoxed(Short a1 = 123)" />
-<@assertEquals 
-    actual=obj.mNumUnambigous(2147483648) expected="mNumUnambigous(Integer a1 = -2147483648)" /> <#-- overflow -->
-
-<@assertEquals actual=obj.mIntPrimVSBoxed(123?int) expected="mIntPrimVSBoxed(int a1 = 123)" />
-<@assertEquals actual=obj.mIntPrimVSBoxed(123?short) expected="mIntPrimVSBoxed(int a1 = 123)" />
-<@assertEquals actual=obj.mIntPrimVSBoxed(123) expected="mIntPrimVSBoxed(int a1 = 123)" />
-<#-- This doesn't fail as 123L can be converted to int without loss: -->
-<@assertEquals actual=obj.mIntPrimVSBoxed(123?long) expected="mIntPrimVSBoxed(int a1 = 123)" />
-
-<@assertEquals actual=obj.mNumPrimVSPrim(123?short) expected="mNumPrimVSPrim(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123?int) expected="mNumPrimVSPrim(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123?long) expected="mNumPrimVSPrim(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123?double) expected="mNumPrimVSPrim(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123456) expected="mNumPrimVSPrim(long a1 = 123456)" />
-
-<@assertEquals actual=obj.mNumPrimAll(123?byte) expected="mNumPrimAll(byte a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?short) expected="mNumPrimAll(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?int) expected="mNumPrimAll(int a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?long) expected="mNumPrimAll(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?float) expected="mNumPrimAll(float a1 = 123.0)" />
-<@assertEquals actual=obj.mNumPrimAll(123?double) expected="mNumPrimAll(double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumPrimAll(123) expected="mNumPrimAll(BigDecimal a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(obj.bigInteger(123)) expected="mNumPrimAll(BigInteger a1 = 123)" />
-
-<@assertEquals actual=obj.mNumBoxedAll(123?byte) expected="mNumBoxedAll(Byte a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?short) expected="mNumBoxedAll(Short a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?int) expected="mNumBoxedAll(Integer a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?long) expected="mNumBoxedAll(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?float) expected="mNumBoxedAll(Float a1 = 123.0)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?double) expected="mNumBoxedAll(Double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumBoxedAll(123) expected="mNumBoxedAll(BigDecimal a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(obj.bigInteger(123)) expected="mNumBoxedAll(BigInteger a1 = 123)" />
-
-<@assertEquals actual=obj.mNumPrimAll2nd(123?byte) expected="mNumPrimAll2nd(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?short) expected="mNumPrimAll2nd(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?int) expected="mNumPrimAll2nd(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?long) expected="mNumPrimAll2nd(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?float) expected="mNumPrimAll2nd(double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?double) expected="mNumPrimAll2nd(double a1 = 123.0)" />
-
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?byte) expected="mNumBoxedAll2nd(Short a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?short) expected="mNumBoxedAll2nd(Short a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?int) expected="mNumBoxedAll2nd(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?long) expected="mNumBoxedAll2nd(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?float) expected="mNumBoxedAll2nd(Double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?double) expected="mNumBoxedAll2nd(Double a1 = 123.0)" />
- 
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?int) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?long) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?double) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123.5?double) expected="mNumPrimFallbackToNumber(Number a1 = 123.5)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(123)) expected="mNumPrimFallbackToNumber(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(9223372036854775808))
-    expected="mNumPrimFallbackToNumber(Number a1 = 9223372036854775808)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.rational(246, 2)) expected="mNumPrimFallbackToNumber(Number a1 = 246/2)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber('x') expected="mNumPrimFallbackToNumber(Object a1 = x)" />
-
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?int) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?long) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?double) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123.5?double) expected="mNumBoxedFallbackToNumber(Number a1 = 123.5)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(123)) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(9223372036854775808))
-    expected="mNumBoxedFallbackToNumber(Number a1 = 9223372036854775808)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.rational(246, 2)) expected="mNumBoxedFallbackToNumber(Number a1 = 246/2)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber('x') expected="mNumBoxedFallbackToNumber(Object a1 = x)" />
-
-<@assertEquals actual=obj.mDecimalLoss(1.5) expected="mDecimalLoss(double a1 = 1.5)" />
-<@assertEquals actual=obj.mDecimalLoss(1.5?double) expected="mDecimalLoss(double a1 = 1.5)" />
-
-<@assertEquals actual=obj.mNumConversionLoses1(1?double, '', '') expected="Number 1.0 java.lang.Double" />
-<@assertEquals actual=obj.mNumConversionLoses1(1?short, '', '') expected="Number 1 java.lang.Short" />
-<@assertEquals actual=obj.mNumConversionLoses1(1?long, '', '') expected="Number 1 java.lang.Long" />
-<@assertEquals actual=obj.mNumConversionLoses2(1?double, '', '') expected="Number 1.0 java.lang.Double" />
-<@assertEquals actual=obj.mNumConversionLoses2(1?short, '', '') expected="Number 1 java.lang.Short" />
-<@assertEquals actual=obj.mNumConversionLoses2(1?long, '', '') expected="Number 1 java.lang.Long" />
-<@assertEquals actual=obj.mNumConversionLoses3(1?double, '', '') expected="Serializable 1.0 java.lang.Double" />
-<@assertEquals actual=obj.mNumConversionLoses3(1?int, '', '') expected="Serializable 1 java.lang.Integer" />
-<@assertEquals actual=obj.mNumConversionLoses3(1?short, '', '') expected="Serializable 1 java.lang.Short" />
-<@assertEquals actual=obj.mNumConversionLoses3(1?long, '', '') expected="Serializable 1 java.lang.Long" />
-
-<#-- BigDecimal-to-int is preferred over to-long for BC and user expectations: -->
-<@assertEquals actual=obj.nIntAndLong(1) expected="nIntAndLong(int 1)" />
-<@assertEquals actual=obj.nIntAndLong(1?long) expected="nIntAndLong(long 1)" />
-<#-- BigDecimal-to-short is, however unfavored due to the higher chance of overflow: -->
-<@assertEquals actual=obj.nIntAndShort(1) expected="nIntAndShort(int 1)" />
-<@assertEquals actual=obj.nIntAndShort(1?short) expected="nIntAndShort(short 1)" />
-<@assertEquals actual=obj.nLongAndShort(1) expected="nLongAndShort(long 1)" />
-<@assertEquals actual=obj.nLongAndShort(1?short) expected="nLongAndShort(short 1)" />
-
-<@assertEquals actual=obj.varargs1(null, 1, 2, 3.5) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.5])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2.5, 3) expected='varargs1(String s = null, double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs1(null, 1.5, 2, 3) expected='varargs1(String s = null, double... xs = [1.5, 2.0, 3.0])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2, 'c') expected='varargs1(String s = null, Object... xs = [1, 2, c])' />
-<@assertEquals actual=obj.varargs1(null, 1, 'b', 3) expected='varargs1(String s = null, Object... xs = [1, b, 3])' />
-<@assertEquals actual=obj.varargs1(null, 'a', 2, 3) expected='varargs1(String s = null, Object... xs = [a, 2, 3])' />
-<@assertEquals actual=obj.varargs1('s', 1, 2, 3) expected='varargs1(String s = "s", int... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1('s', 1.1, 2.1, 3.1) expected='varargs1(String s = "s", double... xs = [1.1, 2.1, 3.1])' />
-<@assertEquals actual=obj.varargs1('s', 'a', 'b', 'c') expected='varargs1(String s = "s", Object... xs = [a, b, c])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2, 3) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1(null, 1.1, 2.1, 3.1) expected='varargs1(String s = null, double... xs = [1.1, 2.1, 3.1])' />
-<@assertEquals actual=obj.varargs1(null, 'a', 'b', 'c') expected='varargs1(String s = null, Object... xs = [a, b, c])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2, 3?double) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2?double, 3?double) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.0])' />
-<@assertEquals actual=obj.varargs1(null, 1, 2?float, 3?float) expected='varargs1(String s = null, double... xs = [1.0, 2.0, 3.0])' />
-<@assertEquals actual=obj.varargs1(null, 1?double, 2?byte, 3?byte) expected='varargs1(String s = null, int... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1(0, 1, 2, 3) expected='varargs1(Object s = 0, Object... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs1('s') expected='varargs1(String s = "s", int... xs = [])' />
-
-<@assertEquals actual=obj.varargs2(1, 2.5, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1?int, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1?long, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1?long, 2?double, 3) expected='varargs2(int... xs = [1, 2, 3])' />
-
-<@assertEquals actual=obj.varargs3(1, 2, 3) expected='varargs3(Comparable... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs3('a', 'b', 'c') expected='varargs3(String... xs = [a, b, c])' />
-<@assertEquals actual=obj.varargs3(1, 'b', 'c') expected='varargs3(Comparable... xs = [1, b, c])' />
-<@assertEquals actual=obj.varargs3('a', 'b', 3) expected='varargs3(Comparable... xs = [a, b, 3])' />
-<@assertEquals actual=obj.varargs3('a', [], 3) expected='varargs3(Object... xs = [a, [], 3])' />
-<@assertEquals actual=obj.varargs3(null, 'b', null) expected='varargs3(String... xs = [null, b, null])' />
-<@assertEquals actual=obj.varargs3(null, 2, null) expected='varargs3(Comparable... xs = [null, 2, null])' />
-<@assertEquals actual=obj.varargs3(null, [], null) expected='varargs3(Object... xs = [null, [], null])' />
-<@assertEquals actual=obj.varargs3(null, null, null) expected='varargs3(String... xs = [null, null, null])' />
-<@assertEquals actual=obj.varargs3() expected='varargs3(String... xs = [])' />
-
-<@assertEquals actual=obj.varargs4(null) expected='varargs4(Integer... xs = [null])' />
-<@assertEquals actual=obj.varargs4(null, null, null) expected='varargs4(Integer... xs = [null, null, null])' />
-<@assertEquals actual=obj.varargs4(1, null, 2) expected='varargs4(Integer... xs = [1, null, 2])' />
-<@assertEquals actual=obj.varargs4(1) expected='varargs4(int... xs = [1])' />
-<@assertEquals actual=obj.varargs4(1, 2, 3) expected='varargs4(int... xs = [1, 2, 3])' />
-
-<@assertEquals actual=obj.varargs5(1, 2, 3, 4, 5) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [4, 5])' />
-<@assertEquals actual=obj.varargs5(1, 2, 3, 4) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [4])' />
-<@assertEquals actual=obj.varargs5(1, 2, 3) expected='varargs5(int a1 = 1, int a2 = 2, int a3 = 3, int... xs = [])' />
-<@assertEquals actual=obj.varargs5(1, 2) expected='varargs5(int a1 = 1, int a2 = 2, int... xs = [])' />
-<@assertEquals actual=obj.varargs5(1) expected='varargs5(int a1 = 1, int... xs = [])' />
-<@assertEquals actual=obj.varargs5() expected='varargs5(int... xs = [])' />
-
-<@assertEquals actual=obj.varargs6('s', 2) expected='varargs6(String a1 = s, int... xs = [2])' />
-<@assertEquals actual=obj.varargs6('s') expected='varargs6(String a1 = s, int... xs = [])' />
-<@assertEquals actual=obj.varargs6(1, 2) expected='varargs6(Object a1 = 1, int a2 = 2, int... xs = [])' />
-<@assertFails message="no compatible overloaded">${obj.varargs6(1)}</@>
-
-<@assertEquals actual=obj.varargs7(1?int, 2?int) expected='varargs7(int... xs = [1, 2])' />
-<@assertEquals actual=obj.varargs7(1?short, 2?int) expected='varargs7(short a1 = 1, int... xs = [2])' />
-
-<#-- Tests that a pre-2.3.21 bug is fixed now: -->
-<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3) expected='mVarargsIgnoredTail(int... is = [1, 2, 3])' />
-<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3.5) expected='mVarargsIgnoredTail(int i = 1, double... ds = [2.0, 3.5])' />
-
-<@assertEquals actual=obj.mNullAmbiguous('a') expected='mNullAmbiguous(String s = a)' />
-<@assertEquals actual=obj.mNullAmbiguous(123) expected='mNullAmbiguous(int i = 123)' />
-<@assertEquals actual=obj.mNullAmbiguous(1.9) expected='mNullAmbiguous(int i = 1)' />
-<@assertEquals actual=obj.mNullAmbiguous(1?double) expected='mNullAmbiguous(int i = 1)' />
-<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(1.9?double)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.mNullAmbiguous(null)}</@>
-
-<@assertFails message="multiple compatible overloaded">${obj.mNullAmbiguous2(null)}</@>
-
-<@assertEquals actual=obj.mNullNonAmbiguous(null) expected='mNullNonAmbiguous(String s = null)' />
-
-<#-- The primitive int-s will win twice, but then String wins over Object, which is stronger: -->
-<@assertEquals actual=obj.mLowRankWins(1, 2, 'a') expected='mLowRankWins(Integer x = 1, Integer y = 2, String s = a)' />
-
-<@assertEquals actual=obj.mRareWrappings(obj.file, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringWrappedAsBoolean)
-               expected='mRareWrappings(File f = file, double d1 = 123.0002, Double d2 = 123.0002, double d3 = 123.0002, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.stringWrappedAsBoolean, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringAdaptedToBoolean)
-               expected='mRareWrappings(String s = yes, double d1 = 123.0002, Double d2 = 123.0002, double d3 = 123.0002, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.stringAdaptedToBoolean2, obj.wrapperNumber, obj.wrapperNumber, obj.wrapperNumber, obj.stringAdaptedToBoolean2)
-               expected='mRareWrappings(String s = yes, double d1 = 123.0001, Double d2 = 123.0001, double d3 = 123.0001, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, obj.booleanWrappedAsAnotherBoolean)
-               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.adaptedNumber, 0, 0, 0, !obj.booleanWrappedAsAnotherBoolean)
-               expected='mRareWrappings(Object o = 124, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, !obj.stringAdaptedToBoolean)
-               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
-               
-<@assertEquals actual=obj.mRareWrappings2(obj.adaptedNumber) expected='mRareWrappings2(byte b = 124)' />
-
-<#-- Test for List VS array problems due to too vague hinting: -->
-
-<@assertEquals actual=obj.mSeqToArrayNonOverloaded(['a', 'b'], 'c') expected='mSeqToArrayNonOverloaded(String[] [a, b], String c)' />
-
-<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 'c') expected='mSeqToArrayGoodHint(String[] [a, b], String c)' />
-<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 3) expected='mSeqToArrayGoodHint(String[] [a, b], int 3)' />
-
-<@assertEquals actual=obj.mSeqToArrayGoodHint2(['a', 'b'], 'c') expected='mSeqToArrayGoodHint2(String[] [a, b], String c)' />
-<@assertEquals actual=obj.mSeqToArrayGoodHint2('a') expected='mSeqToArrayGoodHint2(String a)' />
-
-<@assertEquals actual=obj.mSeqToArrayPoorHint(['a', 'b'], 'c') expected='mSeqToArrayPoorHint(String[] [a, b], String c)' />
-<@assertEquals actual=obj.mSeqToArrayPoorHint('a', 2) expected='mSeqToArrayPoorHint(String a, int 2)' />
-
-<@assertEquals actual=obj.mSeqToArrayPoorHint2(['a', 'b']) expected='mSeqToArrayPoorHint2(String[] [a, b])' />
-<@assertEquals actual=obj.mSeqToArrayPoorHint2('a') expected='mSeqToArrayPoorHint2(String a)' />
-
-<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3(['a', 'b']) expected='mSeqToArrayPoorHint3(String[] [a, b])' /></@>
-<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3([1, 2]) expected='mSeqToArrayPoorHint3(int[] [a, b])' /></@>
-
-<@assertEquals actual=obj.mStringArrayVsListPreference(['a', 'b']) expected="mStringArrayVsListPreference(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaObjectArray) expected="mStringArrayVsListPreference(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(['a', 'b']) expected="mStringArrayVsObjectArrayPreference(Object[] [a, b])" />
-<@assertEquals actual=obj.mIntArrayVsIntegerArrayPreference([1, 2]) expected="mIntArrayVsIntegerArrayPreference(Integer[] [1, 2])" />
-
-<#if dowPre22>
-  <@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaStringArray) expected="mStringArrayVsObjectArrayPreference(Object[] [a, b])" />
-  <@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaIntArray) expected="mStringArrayVsObjectArrayPreference(Object[] [11, 22])" />
-<#else>
-  <@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaStringArray) expected="mStringArrayVsObjectArrayPreference(String[] [a, b])" />
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaIntArray)}</@>
-</#if>
-<@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaIntegerArray) expected="mStringArrayVsObjectArrayPreference(Object[] [11, 22])" />
-
-<@assertEquals actual=obj.mIntegerArrayOverloaded([1, 2], 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
-<@assertEquals actual=obj.mIntegerArrayOverloaded([1?byte, 2?byte], 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
-<@assertEquals actual=obj.mIntegerArrayOverloaded(obj.javaIntegerList, 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
-<@assertEquals actual=obj.mIntegerArrayOverloaded(obj.javaByteList, 3) expected="mIntegerArrayOverloaded(Integer[] [1, 2], int 3)" />
-
-<@assertEquals actual=obj.mStringArrayOverloaded(['a', 'b'], 3) expected="mStringArrayOverloaded(String[] [a, b], int 3)" />
-<@assertEquals actual=obj.mStringArrayOverloaded(obj.javaStringList, 3) expected="mStringArrayOverloaded(String[] [a, b], int 3)" />
-<@assertEquals actual=obj.mStringArrayOverloaded(obj.javaCharacterList, 3) expected="mStringArrayOverloaded(String[] [c, C], int 3)" />
-<@assertFails message="Failed to convert sequence">${obj.mStringArrayOverloaded([1, 2], 3)}</@>
-<@assertFails message="Failed to convert">${obj.mStringArrayOverloaded(obj.javaIntegerList, 3)}</@>
-
-<@assertEquals actual=obj.mCharArrayOverloaded(['a', 'b'], 3) expected="mCharArrayOverloaded(char[] [a, b], int 3)" />
-<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaCharacterList, 3) expected="mCharArrayOverloaded(char[] [c, C], int 3)" />
-<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaStringList, 3) expected="mCharArrayOverloaded(char[] [a, b], int 3)" />
-<@assertFails message="Failed to convert sequence">${obj.mCharArrayOverloaded(['aa', 'bb'], 3)}</@>
-<@assertFails message="Failed to convert">${obj.mCharArrayOverloaded(obj.javaString2List, 3)}</@>
-<@assertEquals actual=obj.mCharArrayOverloaded(['a', 'b'], 's') expected="mCharArrayOverloaded(Character[] [a, b], String s)" />
-<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaCharacterList, 's') expected="mCharArrayOverloaded(Character[] [c, C], String s)" />
-<@assertEquals actual=obj.mCharArrayOverloaded(obj.javaStringList, 's') expected="mCharArrayOverloaded(Character[] [a, b], String s)" />
-<@assertFails message="Failed to convert sequence">${obj.mCharArrayOverloaded(['aa', 'bb'], 's')}</@>
-<@assertFails message="Failed to convert">${obj.mCharArrayOverloaded(obj.javaString2List, 's')}</@>
-
-<@assertEquals actual=obj.mStringArrayArrayOverloaded([['a', 'b'], ['c']], 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
-<@assertEquals actual=obj.mStringArrayArrayOverloaded(obj.javaStringListList, 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
-<@assertEquals actual=obj.mStringArrayArrayOverloaded(obj.javaStringSequenceList, 3) expected="mStringArrayArrayOverloaded(String[][] [[a, b], [c]], int 3)" />
-<@assertFails message="Failed to convert">${obj.mStringArrayArrayOverloaded(obj.javaStringList, 3)}</@>
-<@assertFails message="Failed to convert">${obj.mStringArrayArrayOverloaded(obj.javaIntegerListList, 3)}</@>
-<@assertEquals actual=obj.mIntArrayArrayOverloaded(obj.javaListOfIntArrays) expected="mIntArrayArrayOverloaded([[1, 2, 3], [], [4]])" />
-<@assertEquals actual=obj.mArrayOfListsOverloaded(obj.javaListOfIntArrays) expected="mArrayOfListsOverloaded([[1, 2, 3], [], [4]])" />
-<@assertEquals actual=obj.mIntArrayArrayNonOverloaded(obj.javaListOfIntArrays) expected="mIntArrayArrayNonOverloaded([[1, 2, 3], [], [4]])" />
-<@assertEquals actual=obj.mArrayOfListsNonOverloaded(obj.javaListOfIntArrays) expected="mArrayOfListsNonOverloaded([[1, 2, 3], [], [4]])" />
-
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(['a', 'b']) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringList) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringArray) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2(['a']) expected="mStringArrayVarargsOverloaded2(String[] [a])" />
-
-<#-- Situations that lead to array-to-List conversion: -->
-<@assertEquals actual=obj.mListOrString(obj.javaStringArray) expected="mListOrString(List [a, b])" />
-<@assertEquals actual=obj.mListOrString(obj.javaEmptyStringArray) expected="mListOrString(List [])" />
-<@assertEquals actual=obj.mListOrString(obj.javaIntArray) expected="mListOrString(List [11, 22])" />
-<@assertEquals actual=obj.mListListOrString(obj.javaStringArrayArray) expected="mListListOrString(List [[a, b], [], [c]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-
-<@assertEquals actual=obj.mMapOrBoolean(obj.hashAndScalarModel) expected="mMapOrBoolean(Map {})" />
-<@assertEquals actual=obj.mMapOrBoolean(obj.booleanAndScalarModel) expected="mMapOrBoolean(boolean true)" />
-<@assertEquals actual=obj.mMapOrBoolean(obj.allModels) expected="mMapOrBoolean(boolean true)" />
-
-<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.hashAndScalarModel) expected="mMapOrBooleanVarargs(Map... [{}])" />
-<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanVarargs(Map... [{}, {}])" />
-<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.allModels) expected="mMapOrBooleanVarargs(boolean... [true])" />
-<@assertEquals actual=obj.mMapOrBooleanVarargs(obj.allModels, obj.allModels) expected="mMapOrBooleanVarargs(boolean... [true, true])" />
-
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map {})" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map... [{}, {}])" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel, obj.hashAndScalarModel) expected="mMapOrBooleanFixedAndVarargs(Map... [{}, {}, {}])" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean true)" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean... [true, true])" />
-<@assertEquals actual=obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels, obj.allModels) expected="mMapOrBooleanFixedAndVarargs(boolean... [true, true, true])" />
-
-<@assertEquals actual=obj.mNumberOrArray(obj.allModels) expected="mNumberOrArray(Number 1)" />
-<@assertEquals actual=obj.mNumberOrArray([obj.allModels]) expected="mNumberOrArray(Object[] [1])" />
-<@assertEquals actual=obj.mIntOrArray(obj.allModels) expected="mIntOrArray(int 1)" />
-<@assertEquals actual=obj.mDateOrArray(obj.allModels) expected="mDateOrArray(Date 0)" />
-<@assertEquals actual=obj.mStringOrArray(obj.allModels) expected="mStringOrArray(String s)" />
-<@assertEquals actual=obj.mBooleanOrArray(obj.allModels) expected="mBooleanOrArray(boolean true)" />
-<@assertEquals actual=obj.mMapOrArray(obj.allModels) expected="mMapOrArray(Map {})" />
-<@assertEquals actual=obj.mListOrArray(obj.allModels) expected="mListOrArray(List [])" />
-<@assertEquals actual=obj.mSetOrArray(obj.allModels) expected="mSetOrArray(Set [])" />
-
-<@assertEquals actual=obj.mCharOrCharacterOverloaded('c') expected="mCharOrCharacterOverloaded(char c)" />
-<@assertEquals actual=obj.mCharOrCharacterOverloaded(obj.javaString) expected="mCharOrCharacterOverloaded(char s)" />
-<@assertEquals actual=obj.mCharOrCharacterOverloaded(null) expected="mCharOrCharacterOverloaded(Character null)" />
-
-<@assertEquals actual=obj.mCharOrBooleanOverloaded('c') expected="mCharOrBooleanOverloaded(char c)" />
-<@assertEquals actual=obj.mCharOrBooleanOverloaded(true) expected="mCharOrBooleanOverloaded(boolean true)" />
-
-<@assertEquals actual=obj.mCharOrStringOverloaded('c', true) expected="mCharOrStringOverloaded(char c, boolean true)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded('c', true) expected="mCharacterOrStringOverloaded(Character c, boolean true)" />
-
-<@assertEquals actual=obj.mCharOrStringOverloaded2('c') expected="mCharOrStringOverloaded2(char c)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded2('c') expected="mCharacterOrStringOverloaded2(Character c)" />
-<@assertEquals actual=obj.mCharOrStringOverloaded2('ss') expected="mCharOrStringOverloaded2(String ss)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded2('ss') expected="mCharacterOrStringOverloaded2(String ss)" />
-
-<#-- The exmple given in bug report 363 -->
-<#assign theMap = {'name':'Billy', 'lastName', 'Pilgrim'} />
-<@assertEquals actual=obj.bugReport363(theMap, []) expected="Executed: testMethod(Map fields, List listField) on input: fields={name=Billy, lastName=Pilgrim} and listField=[]" />
-<@assertEquals actual=obj.bugReport363(theMap, null) expected="Executed: testMethod(Map fields, List listField) on input: fields={name=Billy, lastName=Pilgrim} and listField=null" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-common.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-common.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-common.ftl
deleted file mode 100644
index 2ce13ef..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-common.ftl
+++ /dev/null
@@ -1,89 +0,0 @@
-<#--
-  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.
--->
-<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringList) expected="mStringArrayVsListPreference(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringArray) expected=dowPre22?string("mStringArrayVsListPreference(List [a, b])", "mStringArrayVsListPreference(String[] [a, b])") />
-<#if dow>
-  <@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaObjectArray) expected="mStringArrayVsListPreference(List [a, b])" />
-</#if>
-
-<#-- Check if non-overloaded calls still work; they share some code with overloaded methods: -->
-<@assertEquals actual=obj.mIntArrayNonOverloaded([1, 2, 3]) expected="mIntArrayNonOverloaded(int[] [1, 2, 3])" />
-<@assertEquals actual=obj.mIntegerArrayNonOverloaded([1, 2, 3]) expected="mIntegerArrayNonOverloaded(Integer[] [1, 2, 3])" />
-<@assertEquals actual=obj.mIntegerListNonOverloaded([1, 2, 3]) expected="mIntegerListNonOverloaded(List<Integer> [1, 2, 3])" />
-<@assertEquals actual=obj.mStringListNonOverloaded(['a', 'b', 'c']) expected="mStringListNonOverloaded(List<String> [a, b, c])" />
-<@assertEquals actual=obj.mStringListNonOverloaded(obj.javaStringList) expected="mStringListNonOverloaded(List<String> [a, b])" />
-<@assertEquals actual=obj.mStringListNonOverloaded(obj.javaStringArray) expected="mStringListNonOverloaded(List<String> [a, b])" />
-<@assertEquals actual=obj.mStringArrayNonOverloaded(['a', 'b', 'c']) expected="mStringArrayNonOverloaded(String[] [a, b, c])" />
-<@assertEquals actual=obj.mStringArrayNonOverloaded(obj.javaStringList) expected="mStringArrayNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayNonOverloaded(obj.javaStringArray) expected="mStringArrayNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mObjectListNonOverloaded(['a', 'b', 3]) expected="mObjectListNonOverloaded(List<Object> [a, b, 3])" />
-<@assertEquals actual=obj.mObjectListNonOverloaded(obj.javaStringList) expected="mObjectListNonOverloaded(List<Object> [a, b])" />
-<@assertEquals actual=obj.mObjectListNonOverloaded(obj.javaStringArray) expected="mObjectListNonOverloaded(List<Object> [a, b])" />
-<@assertEquals actual=obj.mObjectArrayNonOverloaded(['a', 'b', 3]) expected="mObjectArrayNonOverloaded(Object[] [a, b, 3])" />
-<@assertEquals actual=obj.mObjectArrayNonOverloaded(obj.javaStringList) expected="mObjectArrayNonOverloaded(Object[] [a, b])" />
-<@assertEquals actual=obj.mObjectArrayNonOverloaded(obj.javaStringArray) expected="mObjectArrayNonOverloaded(Object[] [a, b])" />
-
-<@assertEquals actual=obj.mStringArrayVsListPreference(obj.javaStringArray) expected=dowPre22?string("mStringArrayVsListPreference(List [a, b])", "mStringArrayVsListPreference(String[] [a, b])") />
-
-<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded('a', 'b') expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(['a', 'b']) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(obj.javaStringList) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsNonOverloaded(obj.javaStringArray) expected="mStringArrayVarargsNonOverloaded(String[] [a, b])" />
-
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded1('a', 'b') expected="mStringArrayVarargsOverloaded1(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(['a', 'b']) expected="mStringArrayVarargsOverloaded1(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(obj.javaStringList) expected="mStringArrayVarargsOverloaded1(List [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded1(obj.javaStringArray) expected=dowPre22?string("mStringArrayVarargsOverloaded1(List [a, b])", "mStringArrayVarargsOverloaded1(String[] [a, b])") />
-
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2('a', 'b') expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded2('a') expected="mStringArrayVarargsOverloaded2(String a)" />
-
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a']) expected="mStringArrayVarargsOverloaded3(String[] [a])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a', 'b']) expected="mStringArrayVarargsOverloaded3(String[] [a, b])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3(['a', 'b', 'c']) expected="mStringArrayVarargsOverloaded3(String[] [a, b, c])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a') expected="mStringArrayVarargsOverloaded3(String[] [a])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a', 'b') expected="mStringArrayVarargsOverloaded3(String a, String b)" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded3('a', 'b', 'c') expected="mStringArrayVarargsOverloaded3(String[] [a, b, c])" />
-
-<@assertEquals actual=obj.mListOrString(['a', 'b']) expected="mListOrString(List [a, b])" />
-<@assertEquals actual=obj.mListOrString('a') expected="mListOrString(String a)" />
-<@assertEquals actual=obj.mListListOrString([['a'], 'b', 3]) expected="mListListOrString(List [[a], b, 3])" />
-<@assertEquals actual=obj.mListListOrString('s') expected="mListListOrString(String s)" />
-
-<#-- Because the fixed arg interpretations are ambiguous, it only considers the vararg interpretations:  -->
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(['a', 'b', 'c']) expected="mStringArrayVarargsOverloaded4(List[] [[a, b, c]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4('a', 'b', 'c') expected="mStringArrayVarargsOverloaded4(String[] [a, b, c])" />
-
-<#-- Fixed arg solutions have priority: -->
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b]])" />
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray) expected=dowPre22?string("mStringArrayVarargsOverloaded4(List[] [[a, b]])", "mStringArrayVarargsOverloaded4(String[] [a, b])") />
-
-<#-- Choses between the vararg solutions: -->
-<@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-
-<#-- Until there's no overloading String->Character conversion work: -->
-<@assertEquals actual=obj.mCharNonOverloaded('c') expected="mCharNonOverloaded(char c)" />
-<@assertEquals actual=obj.mCharNonOverloaded(obj.javaString) expected="mCharNonOverloaded(char s)" />
-<@assertEquals actual=obj.mCharacterNonOverloaded('c') expected="mCharacterNonOverloaded(Character c)" />
-<@assertEquals actual=obj.mCharacterNonOverloaded(obj.javaString) expected="mCharacterNonOverloaded(Character s)" />
-
-<@assertEquals actual=obj.mCharOrStringOverloaded('s', 1) expected="mCharOrStringOverloaded(String s, int 1)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded('s', 1) expected="mCharacterOrStringOverloaded(String s, int 1)" />
-<@assertEquals actual=obj.mCharOrStringOverloaded2('ss') expected="mCharOrStringOverloaded2(String ss)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded2('ss') expected="mCharacterOrStringOverloaded2(String ss)" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-desc-bwici-2.3.20.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-desc-bwici-2.3.20.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-desc-bwici-2.3.20.ftl
deleted file mode 100644
index 9582dfe..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-desc-bwici-2.3.20.ftl
+++ /dev/null
@@ -1,43 +0,0 @@
-<#--
-  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.
--->
-<#-- Note that the point of 2.3.20 tests is to check if bugs fixed in 2.3.21 are still emulated in pre-2.3.21 mode -->
-
-<@assertFails message="no compatible overloaded">${obj.mVarargs('a', obj.getNnS('b'), obj.getNnS('c'))}</@>
-<@assertFails message="no compatible overloaded">${obj.mChar('a')}</@>
-<@assertFails message="no compatible overloaded">${obj.mIntPrimVSBoxed(123?long)}</@>
-<@assertEquals actual=obj.mIntPrimVSBoxed(123?short) expected="mIntPrimVSBoxed(int a1 = 123)" />
-<@assertEquals actual=obj.mIntPrimVSBoxed(123) expected="mIntPrimVSBoxed(int a1 = 123)" />
-<@assertEquals actual=obj.varargs4(1, 2, 3) expected='varargs4(int... xs = [1, 2, 3])' />
-
-<@assertFails message="multiple compatible overloaded">${obj.mVarargsIgnoredTail(1, 2, 3)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.mVarargsIgnoredTail(1, 2, 3.5)}</@>
-
-<@assertEquals actual=obj.mLowRankWins(1, 2, 'a') expected='mLowRankWins(int x = 1, int y = 2, Object o = a)' />
-
-<@assertEquals actual=obj.mRareWrappings(obj.file, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringWrappedAsBoolean)
-               expected='mRareWrappings(File f = file, double d1 = 123.0001, Double d2 = 123.0002, double d3 = 124.0, b = true)' />
-<@assertFails message="no compatible overloaded">${obj.mRareWrappings(obj.stringWrappedAsBoolean, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringAdaptedToBoolean)}</@>
-<@assertFails message="no compatible overloaded">${obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, obj.booleanWrappedAsAnotherBoolean)}</@>
-<@assertFails message="no compatible overloaded">${obj.mRareWrappings(obj.adaptedNumber, 0, 0, 0, !obj.booleanWrappedAsAnotherBoolean)}</@>
-<@assertFails message="no compatible overloaded">${obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, !obj.stringAdaptedToBoolean)}</@>
-
-<@assertFails message="no compatible overloaded">${obj.mCharOrCharacterOverloaded('c')}</@>
-<@assertFails message="no compatible overloaded">${obj.mCharOrCharacterOverloaded(obj.javaString)}</@>
-
-<#include 'overloaded-methods-2-bwici-2.3.20.ftl'>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-inc-bwici-2.3.20.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-inc-bwici-2.3.20.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-inc-bwici-2.3.20.ftl
deleted file mode 100644
index 6c1e6b9..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-inc-bwici-2.3.20.ftl
+++ /dev/null
@@ -1,47 +0,0 @@
-<#--
-  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.
--->
-<#-- Note that the point of 2.3.20 tests is to check if bugs fixed in 2.3.21 are still emulated in pre-2.3.21 mode -->
-
-<@assertEquals actual=obj.mVarargs('a', obj.getNnS('b'), obj.getNnS('c')) expected='mVarargs(String... a1 = abc)' />
-<@assertFails message="multiple compatible overload">${obj.mChar('a')}</@>
-<@assertFails message="multiple compatible overload">${obj.mIntPrimVSBoxed(123?long)}</@>
-<@assertFails message="multiple compatible overload">${obj.mIntPrimVSBoxed(123?short)}</@>
-<@assertFails message="multiple compatible overload">${obj.mIntPrimVSBoxed(123)}</@>
-<@assertFails message="multiple compatible overload">${obj.varargs4(1, 2, 3)}</@>
-
-<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3) expected='mVarargsIgnoredTail(int... is = [1, 2, 3])' />
-<@assertEquals actual=obj.mVarargsIgnoredTail(1, 2, 3.5) expected='mVarargsIgnoredTail(int... is = [1, 2, 3])' />
-
-<@assertEquals actual=obj.mLowRankWins(1, 2, 'a') expected='mLowRankWins(Integer x = 1, Integer y = 2, String s = a)' />
-
-<@assertEquals actual=obj.mRareWrappings(obj.file, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringWrappedAsBoolean)
-               expected='mRareWrappings(File f = file, double d1 = 123.0001, Double d2 = 123.0002, double d3 = 123.0002, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.stringWrappedAsBoolean, obj.adaptedNumber, obj.adaptedNumber, obj.adaptedNumber, obj.stringAdaptedToBoolean)
-               expected='mRareWrappings(String s = yes, double d1 = 123.0001, Double d2 = 123.0002, double d3 = 123.0002, b = false)' />
-<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, obj.booleanWrappedAsAnotherBoolean)
-               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = false)' />
-<@assertEquals actual=obj.mRareWrappings(obj.adaptedNumber, 0, 0, 0, !obj.booleanWrappedAsAnotherBoolean)
-               expected='mRareWrappings(Object o = 124, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
-<@assertEquals actual=obj.mRareWrappings(obj.booleanWrappedAsAnotherBoolean, 0, 0, 0, !obj.stringAdaptedToBoolean)
-               expected='mRareWrappings(Object o = true, double d1 = 0.0, Double d2 = 0.0, double d3 = 0.0, b = true)' />
-
-<@assertFails message="multiple compatible overloaded">${obj.mCharOrCharacterOverloaded('c')}</@>
-<@assertFails message="multiple compatible overloaded">${obj.mCharOrCharacterOverloaded(obj.javaString)}</@>
-
-<#include 'overloaded-methods-2-bwici-2.3.20.ftl'>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-23bc.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-23bc.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-23bc.ftl
deleted file mode 100644
index 49d38dd..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-23bc.ftl
+++ /dev/null
@@ -1,69 +0,0 @@
-[#ftl]
-[#--
-  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.
---]
-
-[#assign m = {"a": 1, "b": 2}]
-[#assign ls = [1, 2]]
-[#assign ambigousMsg = "Multiple compatible overloaded"]
-[#assign noMatchingMsg = "No compatible overloaded"]
-
-[@assertEquals actual=obj.oneArg(null) expected='oneArg<Object>(null)' /]
-[@assertEquals actual=obj.oneArg("s") expected='oneArg<String>("s")' /]
-[@assertFails message=ambigousMsg]${obj.oneArg(true)}[/@] (should be oneArg<Boolean>)
-[@assertEquals actual=obj.oneArg(ls) expected='oneArg<List>([1, 2])' /]
-[@assertEquals actual=obj.oneArg(m) expected='oneArg<Map>({"a": 1, "b": 2})' /]
-
-[@assertEquals actual=obj.oneArg2(m) expected='oneArg2<Map>({"a": 1, "b": 2})' /]
-[@assertEquals actual=obj.oneArg2(ls) expected='oneArg2<List>([1, 2])' /]
-[@assertFails message=noMatchingMsg]${obj.oneArg2(null)}[/@] (should be ambiguous)
-
-[@assertFails message=noMatchingMsg]${obj.oneArg3(null)}[/@] (should be oneArg3<List>(null))
-
-[#-- This test is unpredictable. The overloaded method implementation is buggy, and the result depends on the order in
-     which the reflection API returns the methods, which for example changes between J2SE 5 and 6.   
-[@assertFails message=ambigousMsg]${obj.oneArg4(123)}[/@] (should be oneArg<Integer>)
---] 
-
-[@assertEquals actual=obj.notOverloaded(ls) expected='notOverloaded<List>([1, 2])' /]
-[@assertEquals actual=obj.notOverloaded(null) expected='notOverloaded<List>(null)' /]
-
-[@assertEquals actual=obj.varargsIssue1(m, []) expected='varargsIssue1<Map, List>({"a": 1, "b": 2}, [])' /] 
-[@assertEquals actual=obj.varargsIssue1(m, null) expected='varargsIssue1<Object...>({"a": 1, "b": 2}, null)' /] (should be varargsIssue1<Map, List>)
-
-[@assertEquals actual=obj.varargsIssue2("s", m) expected='varargsIssue2<String, Map>("s", {"a": 1, "b": 2})' /]
-[@assertEquals actual=obj.varargsIssue2("s", ls) expected='varargsIssue2<String, List>("s", [1, 2])' /]
-[@assertEquals actual=obj.varargsIssue2("s", null) expected='varargsIssue2<Object...>("s", null)' /] (should be an error?)
-
-[@assertEquals actual=obj.numberIssue1(1) expected='numberIssue1<int>(1)' /]
-[@assertEquals actual=obj.numberIssue1(0.5) expected='numberIssue1<int>(0)' /] (should be numberIssue1<float>(0.5))
-[@assertEquals actual=obj.numberIssue1(0.5?float) expected='numberIssue1<float>(0.5)' /]
-[@assertFails message=noMatchingMsg]${obj.numberIssue1(0.5?double)}[/@]
-[@assertFails message=noMatchingMsg]${obj.numberIssue1(null)}[/@]
-
-[@assertFails message=ambigousMsg]${obj.numberIssue2(1)}[/@]
-[@assertFails message=ambigousMsg]${obj.numberIssue2(0.5)}[/@] (should be numberIssue2<BigDecimal>(0.5))
-[@assertFails message=noMatchingMsg]${obj.numberIssue2(null)}[/@] (should be numberIssue2<BigDecimal>(null))
-
-[@assertEquals actual=obj.numberIssue3(0.5) expected='numberIssue3<int>(0)' /] (should be numberIssue1<double>(0.5))
-[@assertEquals actual=obj.numberIssue3(0.5?double) expected='numberIssue3<double>(0.5)' /]
-[@assertEquals actual=obj.numberIssue3(0.5?float) expected='numberIssue3<double>(0.5)' /]
-
-[@assertEquals actual="org.apache.freemarker.test.templatesuite.models.OverloadedConstructor"?new(123) expected="int 123" /]
-[@assertEquals actual="org.apache.freemarker.test.templatesuite.models.OverloadedConstructor"?new("foo") expected="String foo" /]
-[@assertFails message=noMatchingMsg]${"org.apache.freemarker.test.templatesuite.models.OverloadedConstructor"?new(null)}[/@]


[3/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java b/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java
index 2e7cc56..924e170 100644
--- a/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java
+++ b/src/test/resources/org/apache/freemarker/core/SimpleObjectWrapperTest.java
@@ -19,48 +19,38 @@
 
 package org.apache.freemarker.core;
 
-import static org.junit.Assert.*;
+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 java.util.Collections;
 import java.util.Date;
 import java.util.HashSet;
 
-import org.apache.freemarker.core.Configuration;
 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.DefaultObjectWrapperTest.TestBean;
 import org.apache.freemarker.core.model.impl.SimpleDate;
-import org.apache.freemarker.core.model.impl.SimpleHash;
 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.apache.freemarker.core.model.impl.DefaultObjectWrapperTest.TestBean;
 import org.junit.Test;
 
 public class SimpleObjectWrapperTest {
     
     @Test
     public void testBasics() throws TemplateModelException {
-        {
-            SimpleObjectWrapper ow = new SimpleObjectWrapper(Configuration.VERSION_2_3_22);
-            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
-        }
-        
-        {
-            SimpleObjectWrapper ow = new SimpleObjectWrapper(Configuration.VERSION_2_3_21);
-            testCustomizationCommonPart(ow);
-            assertTrue(ow.wrap(Collections.emptyMap()) instanceof SimpleHash);
-            assertTrue(ow.wrap(Collections.emptyList()) instanceof SimpleSequence);
-            assertTrue(ow.wrap(new boolean[] { }) instanceof SimpleSequence);
-            assertTrue(ow.wrap(new HashSet()) instanceof SimpleSequence);
-        }
+        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
     }
 
     @SuppressWarnings("boxing")

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.0.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.0.txt b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.0.txt
deleted file mode 100644
index cdffd2a..0000000
--- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.0.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.
- */
-a1: -
-any:a1 was null, set to 0
-a1: 0
-page:a1 was 0, set to 1
-a1: 1
-request:a1 was null, set to 2
-session:a1 was null, set to 3
-application:a1 was null, set to 4
-Request.a1: 2
-Session.a1: 3
-Application.a1: 4
-a1: 1
-page:a1 was 1, set to null
-a1: 2
-request:a1 was 2, set to null
-a1: 3
-session:a1 was 3, set to null
-a1: 4
-application:a1 was 4, set to null
-a1: -
-a2: -
-application:a2 was null, set to 4
-a2: 4
-session:a2 was null, set to 3
-a2: 3
-request:a2 was null, set to 2
-a2: 2
-page:a2 was null, set to 1
-a2: 1
-G1
-page:a1 was G1, set to P1
-P1
-G2
-page:a2 was G2, set to P2
-P2
-Values created in the template:
-String: s [java.lang.String]
-Number: 1 [java.math.BigDecimal]
-Boolean: true [java.lang.Boolean]
-Date-time: [IGNORED]
-Sequence: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence]
-Hash: {"a": 1, "b": 2, "c": 3} [org.apache.freemarker.core.ast.HashLiteral$SequenceHash]
-Values created in Java:
-LinkedList: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence]
-ArrayList: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence]
-MyList: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence]
-LinkedHashMap: {a=1, b=2, c=3} [org.apache.freemarker.core.model.impl.SimpleHash]
-TreeMap: {a=1, b=2, c=3} [org.apache.freemarker.core.model.impl.SimpleHash]
-MyMap: [IGNORED] [org.apache.freemarker.core.model.impl.SimpleHash]
-TreeSet: [1, 2, 3] [org.apache.freemarker.core.model.impl.SimpleSequence]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.22-future.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.22-future.txt b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.22-future.txt
deleted file mode 100644
index 01c8f88..0000000
--- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-2.3.22-future.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.
- */
-a1: -
-any:a1 was null, set to 0
-a1: 0
-page:a1 was 0, set to 1
-a1: 1
-request:a1 was null, set to 2
-session:a1 was null, set to 3
-application:a1 was null, set to 4
-Request.a1: 2
-Session.a1: 3
-Application.a1: 4
-a1: 1
-page:a1 was 1, set to null
-a1: 2
-request:a1 was 2, set to null
-a1: 3
-session:a1 was 3, set to null
-a1: 4
-application:a1 was 4, set to null
-a1: -
-
-a2: -
-application:a2 was null, set to 4
-a2: 4
-session:a2 was null, set to 3
-a2: 3
-request:a2 was null, set to 2
-a2: 2
-page:a2 was null, set to 1
-a2: 1
-
-G1
-page:a1 was G1, set to P1
-P1
-
-G2
-page:a2 was G2, set to P2
-P2
-
-Values created in the template:
-String: s [java.lang.String]
-Number: 1 [java.math.BigDecimal]
-Boolean: true [java.lang.Boolean]
-Date-time: 2014-12-20T16:19:00Z [java.util.Date]
-Sequence: [1, 2, 3] [org.apache.freemarker.core.model.impl.beans.SequenceAdapter]
-Hash: {a=1, b=2, c=3} [org.apache.freemarker.core.model.impl.beans.HashAdapter]
-
-Values created in Java:
-LinkedList: [1, 2, 3] [java.util.LinkedList]
-ArrayList: [1, 2, 3] [java.util.ArrayList]
-MyList: [1, 2, 3] [org.apache.freemarker.servlet.jsp.RealServletContainertTest$MyList]
-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] [java.util.TreeSet]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-modernModels.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-modernModels.txt b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-modernModels.txt
new file mode 100644
index 0000000..01c8f88
--- /dev/null
+++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/basic/WEB-INF/expected/attributes-modernModels.txt
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+a1: -
+any:a1 was null, set to 0
+a1: 0
+page:a1 was 0, set to 1
+a1: 1
+request:a1 was null, set to 2
+session:a1 was null, set to 3
+application:a1 was null, set to 4
+Request.a1: 2
+Session.a1: 3
+Application.a1: 4
+a1: 1
+page:a1 was 1, set to null
+a1: 2
+request:a1 was 2, set to null
+a1: 3
+session:a1 was 3, set to null
+a1: 4
+application:a1 was 4, set to null
+a1: -
+
+a2: -
+application:a2 was null, set to 4
+a2: 4
+session:a2 was null, set to 3
+a2: 3
+request:a2 was null, set to 2
+a2: 2
+page:a2 was null, set to 1
+a2: 1
+
+G1
+page:a1 was G1, set to P1
+P1
+
+G2
+page:a2 was G2, set to P2
+P2
+
+Values created in the template:
+String: s [java.lang.String]
+Number: 1 [java.math.BigDecimal]
+Boolean: true [java.lang.Boolean]
+Date-time: 2014-12-20T16:19:00Z [java.util.Date]
+Sequence: [1, 2, 3] [org.apache.freemarker.core.model.impl.beans.SequenceAdapter]
+Hash: {a=1, b=2, c=3} [org.apache.freemarker.core.model.impl.beans.HashAdapter]
+
+Values created in Java:
+LinkedList: [1, 2, 3] [java.util.LinkedList]
+ArrayList: [1, 2, 3] [java.util.ArrayList]
+MyList: [1, 2, 3] [org.apache.freemarker.servlet.jsp.RealServletContainertTest$MyList]
+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] [java.util.TreeSet]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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 b4b2d9e..0fa1a03 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
@@ -57,7 +57,7 @@
 		<!-- FreeMarker settings: -->
 		<init-param>
 			<param-name>incompatible_improvements</param-name>
-			<param-value>2.3.22</param-value>
+			<param-value>3.0.0</param-value>
             <!-- Recommended to set to a high value. For the details, see the Java API docs of
                  freemarker.template.Configuration#Configuration(Version). -->
 		</init-param>
@@ -87,47 +87,17 @@
 	</servlet>
 
     <servlet>
-        <servlet-name>freemarker-2.3.0</servlet-name>
+        <servlet-name>freemarker-modernModels</servlet-name>
         <servlet-class>org.apache.freemarker.servlet.FreemarkerServlet</servlet-class>
         
         <!-- Specific parts: -->
         <init-param>
             <param-name>incompatible_improvements</param-name>
-            <param-value>2.3.0</param-value>
-        </init-param>
-        
-        <!-- Common parts: -->
-        <init-param>
-            <param-name>TemplatePath</param-name>
-            <param-value>/</param-value>
-        </init-param>
-        <init-param>
-            <param-name>locale</param-name>
-            <param-value>en_US</param-value>
-        </init-param>
-        <init-param>
-            <param-name>default_encoding</param-name>
-            <param-value>UTF-8</param-value> <!-- The encoding of the template files. -->
-        </init-param>
-        <init-param>
-            <param-name>template_exception_handler</param-name>
-            <!-- Some may prefer "html_debug" for development. -->
-            <param-value>rethrow</param-value>
-        </init-param>
-    </servlet>
-
-    <servlet>
-        <servlet-name>freemarker-2.3.22-future</servlet-name>
-        <servlet-class>org.apache.freemarker.servlet.FreemarkerServlet</servlet-class>
-        
-        <!-- Specific parts: -->
-        <init-param>
-            <param-name>incompatible_improvements</param-name>
-            <param-value>2.3.22</param-value>
+            <param-value>3.0.0</param-value>
         </init-param>
         <init-param>
             <param-name>object_wrapper</param-name>
-            <param-value>DefaultObjectWrapper(2.3.22, forceLegacyNonListCollections=false)</param-value>
+            <param-value>DefaultObjectWrapper(3.0.0, forceLegacyNonListCollections=false)</param-value>
         </init-param>
         
         <!-- Common parts: -->

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml
index a847471..67818b0 100644
--- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml
+++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/config/WEB-INF/web.xml
@@ -90,14 +90,10 @@
         <servlet-class>org.apache.freemarker.servlet.jsp.RealServletContainertTest$AssertDefaultsFreemarkerServlet</servlet-class>
         <init-param>
             <param-name>incompatible_improvements</param-name>
-            <param-value>2.3.22</param-value>
+            <param-value>3.0.0</param-value>
         </init-param>
     </servlet>
     <servlet>
-        <servlet-name>freemarker-assertDefaultsIcI2322FreemarkerServlet</servlet-name>
-        <servlet-class>org.apache.freemarker.servlet.jsp.RealServletContainertTest$AssertDefaultsIcI2322FreemarkerServlet</servlet-class>
-    </servlet>
-    <servlet>
         <servlet-name>freemarker-assertCustomizedDefaultsFreemarkerServlet</servlet-name>
         <servlet-class>org.apache.freemarker.servlet.jsp.RealServletContainertTest$AssertCustomizedDefaultsFreemarkerServlet</servlet-class>
     </servlet>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml
index 9269f00..5d5cd20 100644
--- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml
+++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/multipleLoaders/WEB-INF/web.xml
@@ -43,7 +43,7 @@
 		</init-param>
         <init-param>
             <param-name>incompatible_improvements</param-name>
-            <param-value>2.3.22</param-value>
+            <param-value>3.0.0</param-value>
         </init-param>
 		<init-param>
 			<param-name>template_exception_handler</param-name>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml
index b999f5d..079681c 100644
--- a/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml
+++ b/src/test/resources/org/apache/freemarker/servlet/jsp/webapps/tldDiscovery/WEB-INF/web.xml
@@ -59,7 +59,7 @@
     <!-- FreeMarker settings: -->
     <init-param>
       <param-name>incompatible_improvements</param-name>
-      <param-value>2.3.21</param-value>
+      <param-value>3.0.0</param-value>
     </init-param>
     <init-param>
       <param-name>template_exception_handler</param-name>
@@ -113,7 +113,7 @@
     <!-- FreeMarker settings: -->
     <init-param>
       <param-name>incompatible_improvements</param-name>
-      <param-value>2.3.22</param-value>
+      <param-value>3.0.0</param-value>
     </init-param>
     <init-param>
       <param-name>template_exception_handler</param-name>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/servlet/web.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/servlet/web.xml b/src/test/resources/org/apache/freemarker/test/servlet/web.xml
new file mode 100644
index 0000000..f6322fd
--- /dev/null
+++ b/src/test/resources/org/apache/freemarker/test/servlet/web.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  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.
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+	version="2.4">
+
+	<servlet>
+		<servlet-name>controller</servlet-name>
+		<servlet-class>com.example.Model2ControllerServlet</servlet-class>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>controller</servlet-name>
+		<url-pattern>*.c</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>controller</servlet-name>
+        <url-pattern>/</url-pattern>
+	</servlet-mapping>
+
+	<servlet>
+		<servlet-name>freemarker</servlet-name>
+		<servlet-class>org.apache.freemarker.servlet.FreemarkerServlet</servlet-class>
+
+		<!-- FreemarkerServlet settings: -->
+		<init-param>
+			<param-name>TemplatePath</param-name>
+			<param-value>/</param-value>
+		</init-param>
+		<init-param>
+			<param-name>NoCache</param-name>
+			<param-value>true</param-value>
+		</init-param>
+		<init-param>
+			<param-name>ContentType</param-name>
+			<param-value>text/html; charset=UTF-8</param-value> <!-- Forces UTF-8 output encoding! -->
+		</init-param>
+
+		<!-- FreeMarker settings: -->
+		<init-param>
+			<param-name>incompatible_improvements</param-name>
+			<param-value>3.0.0</param-value>
+		</init-param>
+		<init-param>
+			<param-name>template_exception_handler</param-name>
+			<!-- Some may prefer "html_debug" for development. -->
+			<param-value>rethrow</param-value>
+		</init-param>
+		<init-param>
+			<param-name>template_update_delay</param-name>
+			<param-value>0</param-value> <!-- 0 is for development only! Use higher value otherwise. -->
+		</init-param>
+		<init-param>
+			<param-name>default_encoding</param-name>
+			<param-value>UTF-8</param-value> <!-- The encoding of the template files. -->
+		</init-param>
+		<init-param>
+			<param-name>number_format</param-name>
+			<param-value>0.##########</param-value>
+		</init-param>
+
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>freemarker</servlet-name>
+		<url-pattern>*.ftl</url-pattern>
+	</servlet-mapping>
+
+	<!-- Prevent the visiting of MVC Views from outside the servlet container. 
+		RequestDispatcher.forward/include should and will still work. Removing this 
+		may open security holes! -->
+	<security-constraint>
+		<web-resource-collection>
+			<web-resource-name>FreeMarker MVC Views</web-resource-name>
+			<url-pattern>*.ftl</url-pattern>
+		</web-resource-collection>
+		<auth-constraint>
+			<!-- Nobody is allowed to visit these -->
+		</auth-constraint>
+	</security-constraint>
+
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins-ici-2.3.20.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins-ici-2.3.20.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins-ici-2.3.20.txt
deleted file mode 100644
index aff6329..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins-ici-2.3.20.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-FreeMarker: Encoding built-in tests
-
-html: [&amp;&lt;&gt;&quot;&#39;{}\a/]
-xml:  [&amp;&lt;&gt;&quot;&apos;{}\a/]
-xhtml: [&amp;&lt;&gt;&quot;&#39;{}\a/]
-rtf:  [&<>"'\{\}\\a/]
-html: [a&amp;a&lt;a&gt;a&quot;a&#39;a{a}a\]
-xml:  [a&amp;a&lt;a&gt;a&quot;a&apos;a{a}a\]
-xhtml: [a&amp;a&lt;a&gt;a&quot;a&#39;a{a}a\]
-rtf:  [a&a<a>a"a'a\{a\}a\\]
-html: [&lt;&lt;&lt;&lt;&lt;]
-xml:  [&lt;&lt;&lt;&lt;&lt;]
-xhtml: [&lt;&lt;&lt;&lt;&lt;]
-rtf:  [\{\{\{\{\{]
-html: []
-xml:  []
-xhtml: []
-rtf:  []
-html: [a]
-xml:  [a]
-xhtml: [a]
-rtf:  [a]
-html: [&amp;]
-xml:  [&amp;]
-xhtml: [&amp;]
-rtf:  [\{]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt
index 2ea37e2..aff6329 100644
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/encoding-builtins.txt
@@ -18,11 +18,11 @@
  */
 FreeMarker: Encoding built-in tests
 
-html: [&amp;&lt;&gt;&quot;'{}\a/]
+html: [&amp;&lt;&gt;&quot;&#39;{}\a/]
 xml:  [&amp;&lt;&gt;&quot;&apos;{}\a/]
 xhtml: [&amp;&lt;&gt;&quot;&#39;{}\a/]
 rtf:  [&<>"'\{\}\\a/]
-html: [a&amp;a&lt;a&gt;a&quot;a'a{a}a\]
+html: [a&amp;a&lt;a&gt;a&quot;a&#39;a{a}a\]
 xml:  [a&amp;a&lt;a&gt;a&quot;a&apos;a{a}a\]
 xhtml: [a&amp;a&lt;a&gt;a&quot;a&#39;a{a}a\]
 rtf:  [a&a<a>a"a'a\{a\}a\\]

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.20.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.20.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.20.txt
deleted file mode 100644
index df0becc..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.20.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-  KVPs:
-    a = 1
-    b = 2
-    a = 3
-  
-  Keys:
-    a
-    b
-    a
-  
-  Values:
-    1
-    2
-    3
-
-  KVPs:
-  
-  Keys:
-  
-  Values:
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.21.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.21.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.21.txt
deleted file mode 100644
index 653cbe3..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral-ici-2.3.21.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.
- */
-  KVPs:
-    a = 3
-    b = 2
-  
-  Keys:
-    a
-    b
-  
-  Values:
-    3
-    2
-
-  KVPs:
-  
-  Keys:
-  
-  Values:
-

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt
new file mode 100644
index 0000000..653cbe3
--- /dev/null
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/listhashliteral.txt
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+  KVPs:
+    a = 3
+    b = 2
+  
+  Keys:
+    a
+    b
+  
+  Values:
+    3
+    2
+
+  KVPs:
+  
+  Keys:
+  
+  Values:
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.21.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.21.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.21.txt
deleted file mode 100644
index 0554864..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.21.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.
- */
-StNuBoMeTaMaHaHxSeCoCxEnInDiNo
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 0 1 0 0 0 0 0 0 0 0 1 0
-0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
-0 0 0 0 0 0 1 1 0 0 0 0 0 0 0
-0 0 0 0 0 0 0 0 1 0 0 1 1 0 0
-0 0 0 0 0 0 0 0 0 1 0 1 0 0 0
-0 0 0 0 0 0 0 0 0 1 1 1 0 0 0
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 1 1 0 0 0 0 0 0 0
-0 0 0 1 0 0 0 0 1 0 0 0 1 0 0
-0 0 0 1 0 0 0 0 1 0 0 0 1 0 0

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.24.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.24.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.24.txt
deleted file mode 100644
index 924bbe8..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins-ici-2.3.24.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.
- */
-StNuBoMeTaMaHaHxSeCoCxEnInDiNo
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 0 1 0 0 0 0 0 0 0 0 1 0
-0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
-0 0 0 0 0 0 1 1 0 0 0 0 0 0 0
-0 0 0 0 0 0 0 0 1 0 0 1 1 0 0
-0 0 0 0 0 0 0 0 0 1 0 1 0 0 0
-0 0 0 0 0 0 0 0 0 1 1 1 0 0 0
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 1 1 0 0 0 0 0 0 0
-0 0 0 1 0 0 0 0 0 0 0 0 1 0 0
-0 0 0 1 0 0 0 0 0 0 0 0 1 0 0

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt
index d3ac7fa..924bbe8 100644
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/expected/type-builtins.txt
@@ -29,5 +29,5 @@ StNuBoMeTaMaHaHxSeCoCxEnInDiNo
 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0
-0 0 0 1 0 0 0 0 1 0 0 1 1 0 0
-0 0 0 1 0 0 0 0 1 0 0 1 1 0 0
+0 0 0 1 0 0 0 0 0 0 0 0 1 0 0
+0 0 0 1 0 0 0 0 0 0 0 0 1 0 0

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-common.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-common.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-common.ftl
deleted file mode 100644
index d70a854..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-common.ftl
+++ /dev/null
@@ -1,159 +0,0 @@
-<#--
-  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.
--->
-<#assign d = "2010-05-15 22:38:05:23 +0200"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
-<#setting time_zone="GMT+02">
-<@assertEquals actual=d?iso_utc expected="2010-05-15T20:38:05Z" />
-<@assertEquals actual=d?iso_utc_ms expected="2010-05-15T20:38:05.023Z" />
-<@assertEquals actual=d?iso_utc_m expected="2010-05-15T20:38Z" />
-<@assertEquals actual=d?iso_utc_h expected="2010-05-15T20Z" />
-<@assertEquals actual=d?iso_utc_nz expected="2010-05-15T20:38:05" />
-<@assertEquals actual=d?iso_utc_ms_nz expected="2010-05-15T20:38:05.023" />
-<@assertEquals actual=d?iso_utc_m_nz expected="2010-05-15T20:38" />
-<@assertEquals actual=d?iso_utc_h_nz expected="2010-05-15T20" />
-<@assertEquals actual=d?iso_local expected="2010-05-15T22:38:05+02:00" />
-<@assertEquals actual=d?iso_local_ms expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?iso_local_m expected="2010-05-15T22:38+02:00" />
-<@assertEquals actual=d?iso_local_h expected="2010-05-15T22+02:00" />
-<@assertEquals actual=d?iso_local_nz expected="2010-05-15T22:38:05" />
-<@assertEquals actual=d?iso_local_ms_nz expected="2010-05-15T22:38:05.023" />
-<@assertEquals actual=d?iso_local_m_nz expected="2010-05-15T22:38" />
-<@assertEquals actual=d?iso_local_h_nz expected="2010-05-15T22" />
-
-<@assertEquals actual=d?date?iso_utc expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_ms expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_m expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_h expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_ms_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_m_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_utc_h_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_ms expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_m expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_h expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_ms_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_m_nz expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_local_h_nz expected="2010-05-15" />
-
-<@assertEquals actual=d?time?iso_utc expected="20:38:05Z" />
-<@assertEquals actual=d?time?iso_utc_ms expected="20:38:05.023Z" />
-<@assertEquals actual=d?time?iso_utc_m expected="20:38Z" />
-<@assertEquals actual=d?time?iso_utc_h expected="20Z" />
-<@assertEquals actual=d?time?iso_utc_nz expected="20:38:05" />
-<@assertEquals actual=d?time?iso_utc_ms_nz expected="20:38:05.023" />
-<@assertEquals actual=d?time?iso_utc_m_nz expected="20:38" />
-<@assertEquals actual=d?time?iso_utc_h_nz expected="20" />
-<@assertEquals actual=d?time?iso_local expected="22:38:05+02:00" />
-<@assertEquals actual=d?time?iso_local_ms expected="22:38:05.023+02:00" />
-<@assertEquals actual=d?time?iso_local_m expected="22:38+02:00" />
-<@assertEquals actual=d?time?iso_local_h expected="22+02:00" />
-<@assertEquals actual=d?time?iso_local_nz expected="22:38:05" />
-<@assertEquals actual=d?time?iso_local_ms_nz expected="22:38:05.023" />
-<@assertEquals actual=d?time?iso_local_m_nz expected="22:38" />
-<@assertEquals actual=d?time?iso_local_h_nz expected="22" />
-
-<#assign dStrange = "600-01-01 23:59:59:123 +0000"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
-<@assertEquals actual=dStrange?iso_utc_ms expected="0600-01-03T23:59:59.123Z" />
-
-<#-- java.sql treatment -->
-<@assertEquals actual=sqlDate?iso_local expected="2010-05-15" />
-<@assertEquals actual=sqlDate?iso_local_nz expected="2010-05-15" />
-<@assertEquals actual=sqlTime?iso_local_nz expected="22:38:05" />
-<@assertEquals actual=sqlTime?iso_utc_nz expected="20:38:05" />
-
-<#setting time_zone="GMT+03"> <#-- should not mater -->
-<@assertEquals actual=d?iso("UTC") expected="2010-05-15T20:38:05Z" />
-<@assertEquals actual=d?iso_ms("UTC") expected="2010-05-15T20:38:05.023Z" />
-<@assertEquals actual=d?iso_m("UTC") expected="2010-05-15T20:38Z" />
-<@assertEquals actual=d?iso_h("UTC") expected="2010-05-15T20Z" />
-<@assertEquals actual=d?iso_nz("UTC") expected="2010-05-15T20:38:05" />
-<@assertEquals actual=d?iso_ms_nz("UTC") expected="2010-05-15T20:38:05.023" />
-<@assertEquals actual=d?iso_m_nz("UTC") expected="2010-05-15T20:38" />
-<@assertEquals actual=d?iso_h_nz("UTC") expected="2010-05-15T20" />
-<@assertEquals actual=d?iso("GMT+02") expected="2010-05-15T22:38:05+02:00" />
-<@assertEquals actual=d?iso_ms("GMT+02") expected="2010-05-15T22:38:05.023+02:00" />
-<@assertEquals actual=d?iso_m("GMT+02") expected="2010-05-15T22:38+02:00" />
-<@assertEquals actual=d?iso_h("GMT+02") expected="2010-05-15T22+02:00" />
-<@assertEquals actual=d?iso_nz("GMT+02") expected="2010-05-15T22:38:05" />
-<@assertEquals actual=d?iso_ms_nz("GMT+02") expected="2010-05-15T22:38:05.023" />
-<@assertEquals actual=d?iso_m_nz("GMT+02") expected="2010-05-15T22:38" />
-<@assertEquals actual=d?iso_h_nz("GMT+02") expected="2010-05-15T22" />
-
-<@assertEquals actual=d?date?iso("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_ms("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_m("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_h("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_nz("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_ms_nz("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_m_nz("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_h_nz("UTC") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_ms("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_m("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_h("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_nz("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_ms_nz("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_m_nz("GMT+02") expected="2010-05-15" />
-<@assertEquals actual=d?date?iso_h_nz("GMT+02") expected="2010-05-15" />
-
-<@assertEquals actual=d?time?iso("UTC") expected="20:38:05Z" />
-<@assertEquals actual=d?time?iso_ms("UTC") expected="20:38:05.023Z" />
-<@assertEquals actual=d?time?iso_m("UTC") expected="20:38Z" />
-<@assertEquals actual=d?time?iso_h("UTC") expected="20Z" />
-<@assertEquals actual=d?time?iso_nz("UTC") expected="20:38:05" />
-<@assertEquals actual=d?time?iso_ms_nz("UTC") expected="20:38:05.023" />
-<@assertEquals actual=d?time?iso_m_nz("UTC") expected="20:38" />
-<@assertEquals actual=d?time?iso_h_nz("UTC") expected="20" />
-<@assertEquals actual=d?time?iso("GMT+02") expected="22:38:05+02:00" />
-<@assertEquals actual=d?time?iso_ms("GMT+02") expected="22:38:05.023+02:00" />
-<@assertEquals actual=d?time?iso_m("GMT+02") expected="22:38+02:00" />
-<@assertEquals actual=d?time?iso_h("GMT+02") expected="22+02:00" />
-<@assertEquals actual=d?time?iso_nz("GMT+02") expected="22:38:05" />
-<@assertEquals actual=d?time?iso_ms_nz("GMT+02") expected="22:38:05.023" />
-<@assertEquals actual=d?time?iso_m_nz("GMT+02") expected="22:38" />
-<@assertEquals actual=d?time?iso_h_nz("GMT+02") expected="22" />
-
-<@assertEquals actual=d?iso(javaUTC) expected="2010-05-15T20:38:05Z" />
-<@assertEquals actual=d?iso(javaGMT02) expected="2010-05-15T22:38:05+02:00" />
-<@assertEquals actual=d?iso(adaptedToStringScalar) expected="2010-05-15T22:38:05+02:00" />
-
-<#assign d = "12:00:00:1 +0000"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?iso_utc_ms expected="12:00:00.001Z" />
-<#assign d = "12:00:00:10 +0000"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?iso_utc_ms expected="12:00:00.01Z" />
-<#assign d = "12:00:00:100 +0000"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?iso_utc_ms expected="12:00:00.1Z" />
-<#assign d = "12:00:00:0 +0000"?time("HH:mm:ss:S Z")>
-<@assertEquals actual=d?iso_utc_ms expected="12:00:00Z" />
-
-<#setting time_zone="GMT+02">
-<#assign d = "2010-05-15"?date("yyyy-MM-dd")>
-<@assertEquals actual=d?iso_local expected="2010-05-15" />
-<@assertEquals actual=d?iso_utc expected="2010-05-14" />
-
-<#setting time_zone="GMT+02:30">
-<#assign d = "2010-05-15"?datetime("yyyy-MM-dd")>
-<@assertEquals actual=d?iso_local expected="2010-05-15T00:00:00+02:30" />
-
-<#setting time_zone="America/New_York">
-<@assertEquals actual="2010-05-09 20:00 +0000"?datetime("yyyy-MM-dd HH:mm Z")?iso_local expected="2010-05-09T16:00:00-04:00" />
-<@assertEquals actual="2010-01-01 20:00 +0000"?datetime("yyyy-MM-dd HH:mm Z")?iso_local expected="2010-01-01T15:00:00-05:00" />
-
-<@assertFails>${d?iso("no such zone")}</@>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-ici-2.3.21.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-ici-2.3.21.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-ici-2.3.21.ftl
deleted file mode 100644
index 03ffd00..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi-ici-2.3.21.ftl
+++ /dev/null
@@ -1,23 +0,0 @@
-<#--
-  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.
--->
-<#include "dateformat-iso-bi-common.ftl">
-
-<#setting time_zone="GMT+02">
-<@assertEquals actual=sqlTime?iso_local expected="22:38:05" />
-<@assertEquals actual=sqlTime?iso_utc expected="20:38:05" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl
index c2d7ad4..4dc191b 100644
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/dateformat-iso-bi.ftl
@@ -16,8 +16,148 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<#include "dateformat-iso-bi-common.ftl">
+<#assign d = "2010-05-15 22:38:05:23 +0200"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
+<#setting time_zone="GMT+02">
+<@assertEquals actual=d?iso_utc expected="2010-05-15T20:38:05Z" />
+<@assertEquals actual=d?iso_utc_ms expected="2010-05-15T20:38:05.023Z" />
+<@assertEquals actual=d?iso_utc_m expected="2010-05-15T20:38Z" />
+<@assertEquals actual=d?iso_utc_h expected="2010-05-15T20Z" />
+<@assertEquals actual=d?iso_utc_nz expected="2010-05-15T20:38:05" />
+<@assertEquals actual=d?iso_utc_ms_nz expected="2010-05-15T20:38:05.023" />
+<@assertEquals actual=d?iso_utc_m_nz expected="2010-05-15T20:38" />
+<@assertEquals actual=d?iso_utc_h_nz expected="2010-05-15T20" />
+<@assertEquals actual=d?iso_local expected="2010-05-15T22:38:05+02:00" />
+<@assertEquals actual=d?iso_local_ms expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?iso_local_m expected="2010-05-15T22:38+02:00" />
+<@assertEquals actual=d?iso_local_h expected="2010-05-15T22+02:00" />
+<@assertEquals actual=d?iso_local_nz expected="2010-05-15T22:38:05" />
+<@assertEquals actual=d?iso_local_ms_nz expected="2010-05-15T22:38:05.023" />
+<@assertEquals actual=d?iso_local_m_nz expected="2010-05-15T22:38" />
+<@assertEquals actual=d?iso_local_h_nz expected="2010-05-15T22" />
+
+<@assertEquals actual=d?date?iso_utc expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_ms expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_m expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_h expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_ms_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_m_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_utc_h_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_ms expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_m expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_h expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_ms_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_m_nz expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_local_h_nz expected="2010-05-15" />
+
+<@assertEquals actual=d?time?iso_utc expected="20:38:05Z" />
+<@assertEquals actual=d?time?iso_utc_ms expected="20:38:05.023Z" />
+<@assertEquals actual=d?time?iso_utc_m expected="20:38Z" />
+<@assertEquals actual=d?time?iso_utc_h expected="20Z" />
+<@assertEquals actual=d?time?iso_utc_nz expected="20:38:05" />
+<@assertEquals actual=d?time?iso_utc_ms_nz expected="20:38:05.023" />
+<@assertEquals actual=d?time?iso_utc_m_nz expected="20:38" />
+<@assertEquals actual=d?time?iso_utc_h_nz expected="20" />
+<@assertEquals actual=d?time?iso_local expected="22:38:05+02:00" />
+<@assertEquals actual=d?time?iso_local_ms expected="22:38:05.023+02:00" />
+<@assertEquals actual=d?time?iso_local_m expected="22:38+02:00" />
+<@assertEquals actual=d?time?iso_local_h expected="22+02:00" />
+<@assertEquals actual=d?time?iso_local_nz expected="22:38:05" />
+<@assertEquals actual=d?time?iso_local_ms_nz expected="22:38:05.023" />
+<@assertEquals actual=d?time?iso_local_m_nz expected="22:38" />
+<@assertEquals actual=d?time?iso_local_h_nz expected="22" />
+
+<#assign dStrange = "600-01-01 23:59:59:123 +0000"?datetime("yyyy-MM-dd HH:mm:ss:S Z")>
+<@assertEquals actual=dStrange?iso_utc_ms expected="0600-01-03T23:59:59.123Z" />
+
+<#-- java.sql treatment -->
+<@assertEquals actual=sqlDate?iso_local expected="2010-05-15" />
+<@assertEquals actual=sqlDate?iso_local_nz expected="2010-05-15" />
+<@assertEquals actual=sqlTime?iso_local_nz expected="22:38:05" />
+<@assertEquals actual=sqlTime?iso_utc_nz expected="20:38:05" />
+
+<#setting time_zone="GMT+03"> <#-- should not mater -->
+<@assertEquals actual=d?iso("UTC") expected="2010-05-15T20:38:05Z" />
+<@assertEquals actual=d?iso_ms("UTC") expected="2010-05-15T20:38:05.023Z" />
+<@assertEquals actual=d?iso_m("UTC") expected="2010-05-15T20:38Z" />
+<@assertEquals actual=d?iso_h("UTC") expected="2010-05-15T20Z" />
+<@assertEquals actual=d?iso_nz("UTC") expected="2010-05-15T20:38:05" />
+<@assertEquals actual=d?iso_ms_nz("UTC") expected="2010-05-15T20:38:05.023" />
+<@assertEquals actual=d?iso_m_nz("UTC") expected="2010-05-15T20:38" />
+<@assertEquals actual=d?iso_h_nz("UTC") expected="2010-05-15T20" />
+<@assertEquals actual=d?iso("GMT+02") expected="2010-05-15T22:38:05+02:00" />
+<@assertEquals actual=d?iso_ms("GMT+02") expected="2010-05-15T22:38:05.023+02:00" />
+<@assertEquals actual=d?iso_m("GMT+02") expected="2010-05-15T22:38+02:00" />
+<@assertEquals actual=d?iso_h("GMT+02") expected="2010-05-15T22+02:00" />
+<@assertEquals actual=d?iso_nz("GMT+02") expected="2010-05-15T22:38:05" />
+<@assertEquals actual=d?iso_ms_nz("GMT+02") expected="2010-05-15T22:38:05.023" />
+<@assertEquals actual=d?iso_m_nz("GMT+02") expected="2010-05-15T22:38" />
+<@assertEquals actual=d?iso_h_nz("GMT+02") expected="2010-05-15T22" />
+
+<@assertEquals actual=d?date?iso("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_ms("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_m("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_h("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_nz("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_ms_nz("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_m_nz("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_h_nz("UTC") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_ms("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_m("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_h("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_nz("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_ms_nz("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_m_nz("GMT+02") expected="2010-05-15" />
+<@assertEquals actual=d?date?iso_h_nz("GMT+02") expected="2010-05-15" />
+
+<@assertEquals actual=d?time?iso("UTC") expected="20:38:05Z" />
+<@assertEquals actual=d?time?iso_ms("UTC") expected="20:38:05.023Z" />
+<@assertEquals actual=d?time?iso_m("UTC") expected="20:38Z" />
+<@assertEquals actual=d?time?iso_h("UTC") expected="20Z" />
+<@assertEquals actual=d?time?iso_nz("UTC") expected="20:38:05" />
+<@assertEquals actual=d?time?iso_ms_nz("UTC") expected="20:38:05.023" />
+<@assertEquals actual=d?time?iso_m_nz("UTC") expected="20:38" />
+<@assertEquals actual=d?time?iso_h_nz("UTC") expected="20" />
+<@assertEquals actual=d?time?iso("GMT+02") expected="22:38:05+02:00" />
+<@assertEquals actual=d?time?iso_ms("GMT+02") expected="22:38:05.023+02:00" />
+<@assertEquals actual=d?time?iso_m("GMT+02") expected="22:38+02:00" />
+<@assertEquals actual=d?time?iso_h("GMT+02") expected="22+02:00" />
+<@assertEquals actual=d?time?iso_nz("GMT+02") expected="22:38:05" />
+<@assertEquals actual=d?time?iso_ms_nz("GMT+02") expected="22:38:05.023" />
+<@assertEquals actual=d?time?iso_m_nz("GMT+02") expected="22:38" />
+<@assertEquals actual=d?time?iso_h_nz("GMT+02") expected="22" />
+
+<@assertEquals actual=d?iso(javaUTC) expected="2010-05-15T20:38:05Z" />
+<@assertEquals actual=d?iso(javaGMT02) expected="2010-05-15T22:38:05+02:00" />
+<@assertEquals actual=d?iso(adaptedToStringScalar) expected="2010-05-15T22:38:05+02:00" />
+
+<#assign d = "12:00:00:1 +0000"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?iso_utc_ms expected="12:00:00.001Z" />
+<#assign d = "12:00:00:10 +0000"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?iso_utc_ms expected="12:00:00.01Z" />
+<#assign d = "12:00:00:100 +0000"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?iso_utc_ms expected="12:00:00.1Z" />
+<#assign d = "12:00:00:0 +0000"?time("HH:mm:ss:S Z")>
+<@assertEquals actual=d?iso_utc_ms expected="12:00:00Z" />
+
+<#setting time_zone="GMT+02">
+<#assign d = "2010-05-15"?date("yyyy-MM-dd")>
+<@assertEquals actual=d?iso_local expected="2010-05-15" />
+<@assertEquals actual=d?iso_utc expected="2010-05-14" />
+
+<#setting time_zone="GMT+02:30">
+<#assign d = "2010-05-15"?datetime("yyyy-MM-dd")>
+<@assertEquals actual=d?iso_local expected="2010-05-15T00:00:00+02:30" />
+
+<#setting time_zone="America/New_York">
+<@assertEquals actual="2010-05-09 20:00 +0000"?datetime("yyyy-MM-dd HH:mm Z")?iso_local expected="2010-05-09T16:00:00-04:00" />
+<@assertEquals actual="2010-01-01 20:00 +0000"?datetime("yyyy-MM-dd HH:mm Z")?iso_local expected="2010-01-01T15:00:00-05:00" />
+
+<@assertFails>${d?iso("no such zone")}</@>
 
 <#setting time_zone="GMT+02">
-<@assertEquals actual=sqlTime?iso_local expected="22:38:05+02:00" />
-<@assertEquals actual=sqlTime?iso_utc expected="20:38:05Z" />
+<@assertEquals actual=sqlTime?iso_local expected="22:38:05" />
+<@assertEquals actual=sqlTime?iso_utc expected="20:38:05" />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl
index 8374a5e..2839dec 100644
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/hashliteral.ftl
@@ -92,16 +92,9 @@ ${({} + { "a" : "foo" }).a}, ${({ "a" : "bar" } + {}).a}
 <@noOutput>
 
 <#assign m = { 'a': 1, 'b', 2, 'a': 3 }>
-<#if iciIntValue gte 2003021>
-	<@assertEquals expected="a, b" actual=m?keys?join(', ') />
-	<@assertEquals expected="3, 2" actual=m?values?join(', ') />
-	<@assertEquals expected=3 actual=m['a'] />
-	<@assertEquals expected=2 actual=m['b'] />
-<#else>
-	<@assertEquals expected="a, b, a" actual=m?keys?join(', ') />
-	<@assertEquals expected="1, 2, 3" actual=m?values?join(', ') />
-	<@assertEquals expected=3 actual=m['a'] />
-	<@assertEquals expected=2 actual=m['b'] />
-</#if>
+<@assertEquals expected="a, b" actual=m?keys?join(', ') />
+<@assertEquals expected="3, 2" actual=m?values?join(', ') />
+<@assertEquals expected=3 actual=m['a'] />
+<@assertEquals expected=2 actual=m['b'] />
 
 </...@noOutput>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl
index ffdf8fb..1c09b68 100644
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl
+++ b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/number-format.ftl
@@ -34,17 +34,9 @@ ${double3?c}
 ${double4?c}
 ${bigDecimal?c}
 ${bigDecimal2?c}
-<#if iciIntValue gte 2003021>
-  <@assertEquals expected="INF" actual="INF"?number?c />
-  <@assertEquals expected="INF" actual="INF"?number?c />
-  <@assertEquals expected="-INF" actual="-INF"?number?c />
-  <@assertEquals expected="-INF" actual="-INF"?number?float?c />
-  <@assertEquals expected="NaN" actual="NaN"?number?float?c />
-  <@assertEquals expected="NaN" actual="NaN"?number?float?c />
-<#else>
-  <#setting locale = "en_US">
-  <#setting number_format = "0.#">
-  <@assertEquals expected="INF"?number?string actual="INF"?number?c />
-  <@assertEquals expected="-INF"?number?string actual="-INF"?number?c />
-  <@assertEquals expected="NaN"?number?string actual="NaN"?number?c />
-</#if>
\ No newline at end of file
+<@assertEquals expected="INF" actual="INF"?number?c />
+<@assertEquals expected="INF" actual="INF"?number?c />
+<@assertEquals expected="-INF" actual="-INF"?number?c />
+<@assertEquals expected="-INF" actual="-INF"?number?float?c />
+<@assertEquals expected="NaN" actual="NaN"?number?float?c />
+<@assertEquals expected="NaN" actual="NaN"?number?float?c />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.20.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.20.ftl b/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.20.ftl
deleted file mode 100644
index b65be17..0000000
--- a/src/test/resources/org/apache/freemarker/test/templatesuite/templates/overloaded-methods-2-bwici-2.3.20.ftl
+++ /dev/null
@@ -1,285 +0,0 @@
-<#--
-  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.
--->
-<#-- The parts of the IcI 2.3.20 tests that give the same result regardless of method introspection order -->
-<#-- Note that the point of 2.3.20 tests is to check if bugs fixed in 2.3.21 are still emulated in pre-2.3.21 mode -->
-
-<#include "overloaded-methods-2-common.ftl">
-
-<@assertFails message="no compatible overloaded">${obj.mNull1(null)}</@>
-<@assertEquals actual=obj.mNull1(123) expected="mNull1(int a1 = 123)" />
-<@assertEquals actual=obj.mNull2(null) expected="mNull2(Object a1 = null)" />
-<@assertFails message="no compatible overloaded">${obj.mVarargs('a', null)}</@>
-<@assertFails message="no compatible overloaded">${obj.mVarargs(null, 'a')}</@>
-<@assertFails message="multiple compatible overloaded">${obj.mSpecificity('a', 'b')}</@>
-<@assertFails message="multiple compatible overloaded">${obj.mBoolean(true)}</@>
-
-<@assertEquals actual=obj.mIntNonOverloaded(123?long) expected=123 />
-<@assertEquals actual=obj.mIntNonOverloaded(123) expected=123 />
-<@assertEquals actual=obj.mIntNonOverloaded(123.5) expected=123 />
-<@assertEquals actual=obj.mIntNonOverloaded(2147483648) expected=-2147483648 /> <#-- overflow -->
-<@assertFails message="no compatible overloaded">${obj.mNumBoxedVSBoxed(123.5)}</@>
-<@assertFails message="no compatible overloaded">${obj.mNumBoxedVSBoxed(123?int)}</@>
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123?long) expected="mNumBoxedVSBoxed(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedVSBoxed(123?short) expected="mNumBoxedVSBoxed(Short a1 = 123)" />
-<@assertEquals 
-    actual=obj.mNumUnambigous(2147483648) expected="mNumUnambigous(Integer a1 = -2147483648)" /> <#-- overflow -->
-
-<@assertFails message="multiple compatible overloaded">${obj.mIntPrimVSBoxed(123?int)}</@>
-
-<@assertEquals actual=obj.mNumPrimVSPrim(123?short) expected="mNumPrimVSPrim(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123?int) expected="mNumPrimVSPrim(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimVSPrim(123?long) expected="mNumPrimVSPrim(long a1 = 123)" />
-<@assertFails message="no compatible overloaded">${obj.mNumPrimVSPrim(123?double)}</@>
-<@assertEquals actual=obj.mNumPrimVSPrim(123456) expected="mNumPrimVSPrim(short a1 = -7616)" /> <#-- overflow due to bad choice -->
-
-<@assertEquals actual=obj.mNumPrimAll(123?byte) expected="mNumPrimAll(byte a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?short) expected="mNumPrimAll(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?int) expected="mNumPrimAll(int a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?long) expected="mNumPrimAll(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll(123?float) expected="mNumPrimAll(float a1 = 123.0)" />
-<@assertEquals actual=obj.mNumPrimAll(123?double) expected="mNumPrimAll(double a1 = 123.0)" />
-<@assertFails message="multiple compatible overloaded">${obj.mNumPrimAll(123)}</@>
-<@assertEquals actual=obj.mNumPrimAll(obj.bigInteger(123)) expected="mNumPrimAll(BigInteger a1 = 123)" />
-
-<@assertEquals actual=obj.mNumBoxedAll(123?byte) expected="mNumBoxedAll(Byte a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?short) expected="mNumBoxedAll(Short a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?int) expected="mNumBoxedAll(Integer a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?long) expected="mNumBoxedAll(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?float) expected="mNumBoxedAll(Float a1 = 123.0)" />
-<@assertEquals actual=obj.mNumBoxedAll(123?double) expected="mNumBoxedAll(Double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumBoxedAll(123) expected="mNumBoxedAll(BigDecimal a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedAll(obj.bigInteger(123)) expected="mNumBoxedAll(BigInteger a1 = 123)" />
-
-<@assertEquals actual=obj.mNumPrimAll2nd(123?byte) expected="mNumPrimAll2nd(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?short) expected="mNumPrimAll2nd(short a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?int) expected="mNumPrimAll2nd(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?long) expected="mNumPrimAll2nd(long a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?float) expected="mNumPrimAll2nd(double a1 = 123.0)" />
-<@assertEquals actual=obj.mNumPrimAll2nd(123?double) expected="mNumPrimAll2nd(double a1 = 123.0)" />
-
-<@assertFails message="no compatible overloaded">${obj.mNumBoxedAll2nd(123?byte)}</@>
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?short) expected="mNumBoxedAll2nd(Short a1 = 123)" />
-<@assertFails message="no compatible overloaded">${obj.mNumBoxedAll2nd(123?int)}</@>
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?long) expected="mNumBoxedAll2nd(Long a1 = 123)" />
-<@assertFails message="no compatible overloaded">${obj.mNumBoxedAll2nd(123?float)}</@>
-<@assertEquals actual=obj.mNumBoxedAll2nd(123?double) expected="mNumBoxedAll2nd(Double a1 = 123.0)" />
-
-<@assertFails message="multiple compatible overloaded">${obj.mNumPrimFallbackToNumber(123?int)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.mNumPrimFallbackToNumber(123?long)}</@>
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(123?double) expected="mNumPrimFallbackToNumber(Number a1 = 123.0)" />
-<@assertFails message="multiple compatible overloaded">${obj.mNumPrimFallbackToNumber(123)}</@>
-<@assertEquals actual=obj.mNumPrimFallbackToNumber(obj.bigInteger(123)) expected="mNumPrimFallbackToNumber(Number a1 = 123)" />
-<@assertEquals actual=obj.mNumPrimFallbackToNumber('x') expected="mNumPrimFallbackToNumber(Object a1 = x)" />
-
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?int) expected="mNumBoxedFallbackToNumber(Number a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?long) expected="mNumBoxedFallbackToNumber(Long a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123?double) expected="mNumBoxedFallbackToNumber(Number a1 = 123.0)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(123) expected="mNumBoxedFallbackToNumber(Number a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber(obj.bigInteger(123)) expected="mNumBoxedFallbackToNumber(Number a1 = 123)" />
-<@assertEquals actual=obj.mNumBoxedFallbackToNumber('x') expected="mNumBoxedFallbackToNumber(Object a1 = x)" />
-
-<@assertEquals actual=obj.mDecimalLoss(1.5) expected="mDecimalLoss(int a1 = 1)" /><#-- Yes, buggy... -->
-<@assertEquals actual=obj.mDecimalLoss(1.5?double) expected="mDecimalLoss(double a1 = 1.5)" />
-
-<#-- BigDecimal conversions chose the smallest target type before IcI 2.3.31, increasing the risk of overflows: -->
-<@assertEquals actual=obj.nIntAndLong(1) expected="nIntAndLong(int 1)" />
-<@assertEquals actual=obj.nIntAndLong(1?long) expected="nIntAndLong(long 1)" />
-<@assertEquals actual=obj.nIntAndShort(1) expected="nIntAndShort(short 1)" />
-<@assertEquals actual=obj.nIntAndShort(1?short) expected="nIntAndShort(short 1)" />
-<@assertEquals actual=obj.nIntAndShort(1?int) expected="nIntAndShort(int 1)" />
-<@assertEquals actual=obj.nLongAndShort(1) expected="nLongAndShort(short 1)" />
-<@assertEquals actual=obj.nLongAndShort(1?short) expected="nLongAndShort(short 1)" />
-<@assertEquals actual=obj.nLongAndShort(1?long) expected="nLongAndShort(long 1)" />
-
-<#-- Usual wrong choice on null: -->
-<@assertEquals actual=obj.varargs1(null, 1, 2, 3.5) expected='varargs1(Object s = null, Object... xs = [1, 2, 3.5])' />
-
-<#-- Some bugs that cause loosing of decimals will occur here... -->
-<@assertFails message="multiple compatible overloaded">${obj.varargs1('s', 1, 2, 3.5)}</@>
-<@assertEquals actual=obj.varargs1('s', 1, 2, 'c') expected='varargs1(String s = "s", Object... xs = [1, 2, c])' />
-<@assertEquals actual=obj.varargs1('s', 1, 'b', 3) expected='varargs1(String s = "s", Object... xs = [1, b, 3])' />
-<@assertEquals actual=obj.varargs1('s', 'a', 2, 3) expected='varargs1(String s = "s", Object... xs = [a, 2, 3])' />
-<@assertFails message="multiple compatible overloaded">${obj.varargs1('s', 1, 2, 3)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.varargs1('s', 1.1, 2.1, 3.1)}</@>
-<@assertEquals actual=obj.varargs1('s', 'a', 'b', 'c') expected='varargs1(String s = "s", Object... xs = [a, b, c])' />
-<@assertFails message="multiple compatible overloaded"><@assertEquals actual=obj.varargs1('s', 1?double, 2?byte, 3?byte) expected='varargs1(String s = "s", int... xs = [1, 2, 3])' /></@>
-<@assertEquals actual=obj.varargs1(0, 1, 2, 3) expected='varargs1(Object s = 0, Object... xs = [1, 2, 3])' />
-<@assertFails message="multiple compatible overloaded">${obj.varargs1('s', 1?double, 2?double, 3?double)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.varargs1('s')}</@>
-
-<@assertEquals actual=obj.varargs2(1, 2.5, 3) expected='varargs2(int... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs2(1, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1?int, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1?long, 2.5?double, 3) expected='varargs2(double... xs = [1.0, 2.5, 3.0])' />
-<@assertEquals actual=obj.varargs2(1?long, 2?double, 3) expected='varargs2(double... xs = [1.0, 2.0, 3.0])' />
-
-<@assertEquals actual=obj.varargs3(1, 2, 3) expected='varargs3(Comparable... xs = [1, 2, 3])' />
-<@assertEquals actual=obj.varargs3('a', 'b', 'c') expected='varargs3(String... xs = [a, b, c])' />
-<@assertEquals actual=obj.varargs3(1, 'b', 'c') expected='varargs3(Comparable... xs = [1, b, c])' />
-<@assertEquals actual=obj.varargs3('a', 'b', 3) expected='varargs3(Comparable... xs = [a, b, 3])' />
-<@assertEquals actual=obj.varargs3('a', [], 3) expected='varargs3(Object... xs = [a, [], 3])' />
-<@assertEquals actual=obj.varargs3(null, 'b', null) expected='varargs3(Object... xs = [null, b, null])' />
-<@assertEquals actual=obj.varargs3(null, 2, null) expected='varargs3(Object... xs = [null, 2, null])' />
-<@assertEquals actual=obj.varargs3(null, [], null) expected='varargs3(Object... xs = [null, [], null])' />
-<@assertEquals actual=obj.varargs3(null, null, null) expected='varargs3(Object... xs = [null, null, null])' />
-<@assertEquals actual=obj.varargs3() expected='varargs3(String... xs = [])' />
-
-<@assertFails message="no compatible overloaded">${obj.varargs4(null, null, null)}</@>
-
-<@assertFails message="multiple compatible overloaded">${obj.varargs5(1, 2, 3, 4, 5)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.varargs5(1, 2, 3, 4)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.varargs5(1, 2, 3)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.varargs5(1, 2)}</@>
-<@assertFails message="multiple compatible overloaded">${obj.varargs5(1)}</@>
-<@assertEquals actual=obj.varargs5() expected='varargs5(int... xs = [])' />
-
-<@assertEquals actual=obj.varargs6('s', 2) expected='varargs6(String a1 = s, int... xs = [2])' />
-<@assertEquals actual=obj.varargs6('s') expected='varargs6(String a1 = s, int... xs = [])' />
-<@assertEquals actual=obj.varargs6(1, 2) expected='varargs6(Object a1 = 1, int a2 = 2, int... xs = [])' />
-<@assertFails message="no compatible overloaded">${obj.varargs6(1)}</@>
-
-<@assertEquals actual=obj.varargs7(1?int, 2?int) expected='varargs7(int... xs = [1, 2])' />
-<@assertEquals actual=obj.varargs7(1?short, 2?int) expected='varargs7(short a1 = 1, int... xs = [2])' />
-
-<@assertEquals actual=obj.mNullAmbiguous('a') expected='mNullAmbiguous(String s = a)' />
-<@assertEquals actual=obj.mNullAmbiguous(123) expected='mNullAmbiguous(int i = 123)' />
-<@assertEquals actual=obj.mNullAmbiguous(1.9) expected='mNullAmbiguous(int i = 1)' />
-<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(1?double)}</@>
-<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(1.9?double)}</@>
-<@assertFails message="no compatible overloaded">${obj.mNullAmbiguous(null)}</@>
-
-<@assertEquals actual=obj.mNullAmbiguous2(null) expected='mNullAmbiguous(Object o = null)' />
-
-<@assertFails message="no compatible overloaded">${obj.mNullNonAmbiguous(null)}</@>
-
-<@assertEquals actual=obj.mRareWrappings(obj.stringAdaptedToBoolean2, obj.wrapperNumber, obj.wrapperNumber, obj.wrapperNumber, obj.stringAdaptedToBoolean2)
-               expected='mRareWrappings(String s = yes, double d1 = 123.0001, Double d2 = 123.0001, double d3 = 123.0001, b = true)' />
-               
-<@assertFails message="no compatible overloaded">${obj.mRareWrappings2(obj.adaptedNumber)}</@>
-
-<#-- Test for List VS array problems due to too vague hinting: -->
-
-<@assertEquals actual=obj.mSeqToArrayNonOverloaded(['a', 'b'], 'c') expected='mSeqToArrayNonOverloaded(String[] [a, b], String c)' />
-
-<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 'c') expected='mSeqToArrayGoodHint(String[] [a, b], String c)' />
-<@assertEquals actual=obj.mSeqToArrayGoodHint(['a', 'b'], 3) expected='mSeqToArrayGoodHint(String[] [a, b], int 3)' />
-
-<@assertEquals actual=obj.mSeqToArrayGoodHint2(['a', 'b'], 'c') expected='mSeqToArrayGoodHint2(String[] [a, b], String c)' />
-<@assertEquals actual=obj.mSeqToArrayGoodHint2('a') expected='mSeqToArrayGoodHint2(String a)' />
-
-<@assertFails message="no compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint(['a', 'b'], 'c') expected='mSeqToArrayPoorHint(String[] [a, b], String c)' /></@>
-<@assertEquals actual=obj.mSeqToArrayPoorHint('a', 2) expected='mSeqToArrayPoorHint(String a, int 2)' />
-
-<@assertFails message="no compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint2(['a', 'b']) expected='mSeqToArrayPoorHint2(String[] [a, b])' /></@>
-<@assertEquals actual=obj.mSeqToArrayPoorHint2('a') expected='mSeqToArrayPoorHint2(String a)' />
-
-<@assertFails message="no compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3(['a', 'b']) expected='mSeqToArrayPoorHint3(String[] [a, b])' /></@>
-<@assertFails message="no compatible overloaded"><@assertEquals actual=obj.mSeqToArrayPoorHint3([1, 2]) expected='mSeqToArrayPoorHint3(int[] [a, b])' /></@>
-
-<@assertEquals actual=obj.mStringArrayVsListPreference(['a', 'b']) expected="mStringArrayVsListPreference(List [a, b])" />
-<@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(['a', 'b'])}</@>
-<#if !dow>
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVsListPreference(obj.javaObjectArray)}</@>
-</#if>
-<@assertFails message="no compatible overloaded">${obj.mIntArrayVsIntegerArrayPreference([1, 2])}</@>
-
-<#if dow>
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaStringArray)}</@>
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaIntArray)}</@>
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaIntegerArray)}</@>
-<#else>
-  <@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaStringArray) expected="mStringArrayVsObjectArrayPreference(String[] [a, b])" />
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVsObjectArrayPreference(obj.javaIntArray)}</@>
-  <@assertEquals actual=obj.mStringArrayVsObjectArrayPreference(obj.javaIntegerArray) expected="mStringArrayVsObjectArrayPreference(Object[] [11, 22])" />
-</#if>
-
-<@assertFails message="no compatible overloaded">${obj.mIntegerArrayOverloaded([1, 2], 3)}</@>
-<@assertFails message="no compatible overloaded">${obj.mIntegerArrayOverloaded([1?byte, 2?byte], 3)}</@>
-<@assertFails message="no compatible overloaded">${obj.mIntegerArrayOverloaded(obj.javaIntegerList, 3)}</@>
-<@assertFails message="no compatible overloaded">${obj.mIntegerArrayOverloaded(obj.javaByteList, 3)}</@>
-
-<@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded2(['a', 'b'])}</@>
-<#if dow>
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded2(obj.javaStringList)}</@>
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded2(obj.javaStringArray)}</@>
-<#else>
-  <@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringList) expected="mStringArrayVarargsOverloaded2(String[] [[a, b]])" /> <#-- toString() accident... -->
-  <@assertEquals actual=obj.mStringArrayVarargsOverloaded2(obj.javaStringArray) expected="mStringArrayVarargsOverloaded2(String[] [a, b])" />
-</#if>
-<@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded2(['a'])}</@>
-
-<#if dow>
-  <#-- As with DOW we never end up with array-s after unwrapping, they just work like Lists: -->
-  <@assertEquals actual=obj.mListOrString(obj.javaStringArray) expected="mListOrString(List [a, b])" />
-  <@assertEquals actual=obj.mListListOrString(obj.javaStringArrayArray) expected="mListListOrString(List [[a, b], [], [c]])" />
-  <@assertEquals actual=obj.mListOrString(obj.javaIntArray) expected="mListOrString(List [11, 22])" />
-  <@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-  <@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringArray) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-  <@assertEquals actual=obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringList) expected="mStringArrayVarargsOverloaded4(List[] [[a, b], [a, b]])" />
-<#else>
-  <#-- Pure BeansWrapper unwraps to array-s, but before IcI 2.3.21 it couldn't treat them as Lists: -->
-  <@assertFails message="no compatible overloaded">${obj.mListOrString(obj.javaStringArray)}</@>
-  <@assertFails message="no compatible overloaded">${obj.mListListOrString(obj.javaStringArrayArray)}</@>
-  <@assertFails message="no compatible overloaded">${obj.mListOrString(obj.javaIntArray)}</@>
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringArray)}</@>
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded4(obj.javaStringList, obj.javaStringArray)}</@>
-  <@assertFails message="no compatible overloaded">${obj.mStringArrayVarargsOverloaded4(obj.javaStringArray, obj.javaStringList)}</@>
-</#if>
-
-<@assertFails message="no compatible overloaded">${obj.mIntArrayArrayOverloaded(obj.javaListOfIntArrays)}</@>
-<@assertFails message="no compatible overloaded">${obj.mArrayOfListsOverloaded(obj.javaListOfIntArrays)}</@>
-
-<@assertFails message="no compatible overloaded">${obj.mMapOrBoolean(obj.hashAndScalarModel)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrBoolean(obj.booleanAndScalarModel)}</@>
-
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanVarargs(obj.hashAndScalarModel)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanVarargs(obj.allModels)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanVarargs(obj.allModels, obj.allModels)}</@>
-
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.hashAndScalarModel, obj.hashAndScalarModel, obj.hashAndScalarModel)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.allModels)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrBooleanFixedAndVarargs(obj.allModels, obj.allModels, obj.allModels)}</@>
-
-<@assertEquals actual=obj.mNumberOrArray(obj.allModels) expected="mNumberOrArray(Number 1)" />
-<@assertFails message="no compatible overloaded"><@assertEquals actual=obj.mNumberOrArray([obj.allModels]) expected="mNumberOrArray(Object[] [1])" /></@>
-<@assertEquals actual=obj.mIntOrArray(obj.allModels) expected="mIntOrArray(int 1)" />
-<@assertFails message="no compatible overloaded">${obj.mDateOrArray(obj.allModels)}</@>
-<@assertFails message="no compatible overloaded">${obj.mStringOrArray(obj.allModels)}</@>
-<@assertFails message="no compatible overloaded">${obj.mBooleanOrArray(obj.allModels)}</@>
-<@assertFails message="no compatible overloaded">${obj.mMapOrArray(obj.allModels)}</@>
-<@assertFails message="no compatible overloaded">${obj.mListOrArray(obj.allModels)}</@>
-<@assertFails message="no compatible overloaded">${obj.mSetOrArray(obj.allModels)}</@>
-
-<@assertFails message="no compatible overloaded">${obj.mCharOrCharacterOverloaded(null)}</@>
-<@assertFails message="no compatible overloaded">${obj.mCharOrBooleanOverloaded('c')}</@>
-<@assertEquals actual=obj.mCharOrBooleanOverloaded(true) expected="mCharOrBooleanOverloaded(boolean true)" />
-
-<@assertFails message="no compatible overloaded">${obj.mCharOrStringOverloaded('c', true)}</@>
-<@assertFails message="no compatible overloaded">${obj.mCharacterOrStringOverloaded('c', true)}</@>
-<@assertEquals actual=obj.mCharOrStringOverloaded2('c') expected="mCharOrStringOverloaded2(String c)" />
-<@assertEquals actual=obj.mCharacterOrStringOverloaded2('c') expected="mCharacterOrStringOverloaded2(String c)" />
-
-<#-- The exmple given in bug report 363 -->
-<#assign theMap = {'name':'Billy', 'lastName', 'Pilgrim'} />
-<@assertEquals actual=obj.bugReport363(theMap, []) expected="Executed: testMethod(Map fields, List listField) on input: fields={name=Billy, lastName=Pilgrim} and listField=[]" />
-<@assertEquals actual=obj.bugReport363(theMap, null) expected="Executed: testMethod(Object... fields) on input: fields=[{name=Billy, lastName=Pilgrim}, null]" />


[4/9] incubator-freemarker git commit: Removed support for incompatibleImprovements below 3.0.0.

Posted by dd...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003020.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003020.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003020.java
deleted file mode 100644
index 28f7024..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003020.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperDesc2003020 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperDesc2003020() {
-        super(Configuration.VERSION_2_3_20, true);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003021.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003021.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003021.java
deleted file mode 100644
index 9cbc8ee..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003021.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperDesc2003021 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperDesc2003021() {
-        super(Configuration.VERSION_2_3_21, true);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003022.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003022.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003022.java
deleted file mode 100644
index 8a9692e..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperDesc2003022.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperDesc2003022 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperDesc2003022() {
-        super(Configuration.VERSION_2_3_22, true);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc.java
new file mode 100644
index 0000000..60a331a
--- /dev/null
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc.java
@@ -0,0 +1,30 @@
+/*
+ * 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.core.model.impl.beans;
+
+import org.apache.freemarker.core.Configuration;
+
+public class DefaultObjectWrapperInc extends DefaultObjectWrapperWithSortedMethods {
+
+    public DefaultObjectWrapperInc() {
+        super(Configuration.VERSION_3_0_0, false);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003020.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003020.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003020.java
deleted file mode 100644
index 5bef55c..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003020.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperInc2003020 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperInc2003020() {
-        super(Configuration.VERSION_2_3_20, false);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003021.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003021.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003021.java
deleted file mode 100644
index fd3f6a7..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003021.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperInc2003021 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperInc2003021() {
-        super(Configuration.VERSION_2_3_21, false);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003022.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003022.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003022.java
deleted file mode 100644
index 3107c76..0000000
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/DefaultObjectWrapperInc2003022.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.core.model.impl.beans;
-
-import org.apache.freemarker.core.Configuration;
-
-public class DefaultObjectWrapperInc2003022 extends DefaultObjectWrapperWithSortedMethods {
-
-    public DefaultObjectWrapperInc2003022() {
-        super(Configuration.VERSION_2_3_22, false);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java
index f8912eb..bcaf81a 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/EnumModelsTest.java
@@ -19,7 +19,13 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 
@@ -29,7 +35,6 @@ import org.apache.freemarker.core.model.TemplateMethodModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
@@ -39,7 +44,7 @@ public class EnumModelsTest {
     
     @Test
     public void modelCaching() throws Exception {
-        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_2_3_21);
+        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0);
         TemplateHashModel enums = bw.getEnumModels();
         TemplateHashModel e = (TemplateHashModel) enums.get(E.class.getName());
         assertNotNull(e);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java
index 37791d1..8b097a0 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/ErrorMessagesTest.java
@@ -18,29 +18,31 @@
  */
 
 package org.apache.freemarker.core.model.impl.beans;
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.not;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 import java.util.Collections;
 import java.util.Date;
 
 import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.ast.HTMLOutputFormat;
 import org.apache.freemarker.core.ast.TemplateHTMLOutputModel;
 import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateMethodModelEx;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
 import org.junit.Test;
 
 public class ErrorMessagesTest {
 
     @Test
     public void getterMessage() throws TemplateModelException {
-        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_2_3_0).build();
+        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
         TemplateHashModel thm= (TemplateHashModel) bw.wrap(new TestBean());
         
         try {
@@ -58,68 +60,66 @@ public class ErrorMessagesTest {
     public void markupOutputParameter() throws Exception {
         TemplateHTMLOutputModel html = HTMLOutputFormat.INSTANCE.fromMarkup("<p>a");
 
-        for (Version ici : new Version[] { Configuration.VERSION_2_3_0, Configuration.VERSION_2_3_24 }) {
-            BeansWrapper bw = new BeansWrapperBuilder(ici).build();
-            TemplateHashModel thm = (TemplateHashModel) bw.wrap(new TestBean());
-            
-            {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("m1");
-                try {
-                    m.exec(Collections.singletonList(html));
-                    fail();
-                } catch (TemplateModelException e) {
-                    assertThat(e.getMessage(), allOf(
-                            containsString("String"), containsString("convert"), containsString("markup_output"),
-                            containsString("Tip:"), containsString("?markup_string")));
-                }
+        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
+        TemplateHashModel thm = (TemplateHashModel) bw.wrap(new TestBean());
+        
+        {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("m1");
+            try {
+                m.exec(Collections.singletonList(html));
+                fail();
+            } catch (TemplateModelException e) {
+                assertThat(e.getMessage(), allOf(
+                        containsString("String"), containsString("convert"), containsString("markup_output"),
+                        containsString("Tip:"), containsString("?markup_string")));
             }
-            
-            {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("m2");
-                try {
-                    m.exec(Collections.singletonList(html));
-                    fail();
-                } catch (TemplateModelException e) {
-                    assertThat(e.getMessage(), allOf(
-                            containsString("Date"), containsString("convert"), containsString("markup_output"),
-                            not(containsString("?markup_string"))));
-                }
+        }
+        
+        {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("m2");
+            try {
+                m.exec(Collections.singletonList(html));
+                fail();
+            } catch (TemplateModelException e) {
+                assertThat(e.getMessage(), allOf(
+                        containsString("Date"), containsString("convert"), containsString("markup_output"),
+                        not(containsString("?markup_string"))));
             }
-            
-            for (String methodName : new String[] { "mOverloaded", "mOverloaded3" }) {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get(methodName);
-                try {
-                    m.exec(Collections.singletonList(html));
-                    fail();
-                } catch (TemplateModelException e) {
-                    assertThat(e.getMessage(), allOf(
-                            containsString("No compatible overloaded"),
-                            containsString("String"), containsString("markup_output"),
-                            containsString("Tip:"), containsString("?markup_string")));
-                }
+        }
+        
+        for (String methodName : new String[] { "mOverloaded", "mOverloaded3" }) {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get(methodName);
+            try {
+                m.exec(Collections.singletonList(html));
+                fail();
+            } catch (TemplateModelException e) {
+                assertThat(e.getMessage(), allOf(
+                        containsString("No compatible overloaded"),
+                        containsString("String"), containsString("markup_output"),
+                        containsString("Tip:"), containsString("?markup_string")));
             }
-            
-            {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("mOverloaded2");
-                try {
-                    m.exec(Collections.singletonList(html));
-                    fail();
-                } catch (TemplateModelException e) {
-                    assertThat(e.getMessage(), allOf(
-                            containsString("No compatible overloaded"),
-                            containsString("Integer"), containsString("markup_output"),
-                            not(containsString("?markup_string"))));
-                }
+        }
+        
+        {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("mOverloaded2");
+            try {
+                m.exec(Collections.singletonList(html));
+                fail();
+            } catch (TemplateModelException e) {
+                assertThat(e.getMessage(), allOf(
+                        containsString("No compatible overloaded"),
+                        containsString("Integer"), containsString("markup_output"),
+                        not(containsString("?markup_string"))));
             }
-            
-            {
-                TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("mOverloaded4");
-                Object r = m.exec(Collections.singletonList(html));
-                if (r instanceof TemplateScalarModel) {
-                    r = ((TemplateScalarModel) r).getAsString();
-                }
-                assertEquals("<p>a", r);
+        }
+        
+        {
+            TemplateMethodModelEx m = (TemplateMethodModelEx) thm.get("mOverloaded4");
+            Object r = m.exec(Collections.singletonList(html));
+            if (r instanceof TemplateScalarModel) {
+                r = ((TemplateScalarModel) r).getAsString();
             }
+            assertEquals("<p>a", r);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java
index b91101e..0bc9168 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/IsApplicableTest.java
@@ -26,10 +26,6 @@ import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.freemarker.core.model.impl.beans.ArgumentTypes;
-import org.apache.freemarker.core.model.impl.beans.OverloadedNumberUtil;
-import org.apache.freemarker.core.model.impl.beans.ReflectionCallableMemberDescriptor;
-
 import junit.framework.TestCase;
 
 @SuppressWarnings("boxing")
@@ -40,21 +36,21 @@ public class IsApplicableTest extends TestCase {
     }
     
     public void testSingle() {
-        ArgumentTypes ats = new ArgumentTypes(new Object[] { new Object() }, true);
+        ArgumentTypes ats = new ArgumentTypes(new Object[] { new Object() });
         assertApplicable(ats, Object.class);
         assertNotApplicable(ats, String.class);
         assertNotApplicable(ats, CharSequence.class);
         assertNotApplicable(ats, Integer.class);
         assertNotApplicable(ats, Integer.TYPE);
         
-        ats = new ArgumentTypes(new Object[] { "" }, true);
+        ats = new ArgumentTypes(new Object[] { "" });
         assertApplicable(ats, Object.class);
         assertApplicable(ats, CharSequence.class);
         assertApplicable(ats, String.class);
         assertNotApplicable(ats, Integer.class);
         assertNotApplicable(ats, Integer.TYPE);
 
-        ats = new ArgumentTypes(new Object[] { 1 }, true);
+        ats = new ArgumentTypes(new Object[] { 1 });
         assertApplicable(ats, Object.class);
         assertNotApplicable(ats, CharSequence.class);
         assertNotApplicable(ats, String.class);
@@ -69,7 +65,7 @@ public class IsApplicableTest extends TestCase {
         assertApplicable(ats, BigDecimal.class);
         assertApplicable(ats, BigInteger.class);
 
-        ats = new ArgumentTypes(new Object[] { new OverloadedNumberUtil.IntegerOrByte(1, (byte) 1) }, true);
+        ats = new ArgumentTypes(new Object[] { new OverloadedNumberUtil.IntegerOrByte(1, (byte) 1) });
         assertApplicable(ats, Object.class);
         assertNotApplicable(ats, CharSequence.class);
         assertNotApplicable(ats, String.class);
@@ -84,7 +80,7 @@ public class IsApplicableTest extends TestCase {
         assertApplicable(ats, BigDecimal.class);
         assertApplicable(ats, BigInteger.class);
         
-        ats = new ArgumentTypes(new Object[] { 1.0f }, true);
+        ats = new ArgumentTypes(new Object[] { 1.0f });
         assertApplicable(ats, Object.class);
         assertNotApplicable(ats, CharSequence.class);
         assertNotApplicable(ats, String.class);
@@ -97,7 +93,7 @@ public class IsApplicableTest extends TestCase {
         assertApplicable(ats, BigDecimal.class);
         assertNotApplicable(ats, BigInteger.class);
         
-        ats = new ArgumentTypes(new Object[] { null }, true);
+        ats = new ArgumentTypes(new Object[] { null });
         assertApplicable(ats, Object.class);
         assertApplicable(ats, String.class);
         assertApplicable(ats, Integer.class);
@@ -108,7 +104,7 @@ public class IsApplicableTest extends TestCase {
     }
     
     public void testMulti() {
-        ArgumentTypes ats = new ArgumentTypes(new Object[] { new Object(), "", 1, true }, true);
+        ArgumentTypes ats = new ArgumentTypes(new Object[] { new Object(), "", 1, true });
         assertApplicable(ats, Object.class, Object.class, Object.class, Object.class);
         assertApplicable(ats, Object.class, String.class, Number.class, Boolean.class);
         assertApplicable(ats, Object.class, CharSequence.class, Integer.class, Serializable.class);
@@ -121,7 +117,7 @@ public class IsApplicableTest extends TestCase {
     }    
 
     public void testNoParam() {
-        ArgumentTypes ats = new ArgumentTypes(new Object[] { }, true);
+        ArgumentTypes ats = new ArgumentTypes(new Object[] { });
         assertApplicable(ats);
         assertNotApplicable(ats, Object.class);
     }
@@ -134,7 +130,7 @@ public class IsApplicableTest extends TestCase {
             new Object[] { "" },
         };
         for (Object[] args : argLists) {
-            ArgumentTypes ats = new ArgumentTypes(args, true);
+            ArgumentTypes ats = new ArgumentTypes(args);
             assertApplicable(ats, true, String.class, int[].class);
             assertApplicable(ats, true, String.class, Integer[].class);
             assertApplicable(ats, true, Object.class, Comparable[].class);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java
index 21d0cb0..d88777f 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/MiscNumericalOperationsTest.java
@@ -22,15 +22,10 @@ package org.apache.freemarker.core.model.impl.beans;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 
-import junit.framework.TestCase;
-
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.OverloadedFixArgsMethods;
-import org.apache.freemarker.core.model.impl.beans.OverloadedMethodsSubset;
-import org.apache.freemarker.core.model.impl.beans.OverloadedNumberUtil;
 import org.junit.Assert;
 
+import junit.framework.TestCase;
+
 public class MiscNumericalOperationsTest extends TestCase {
 
     public MiscNumericalOperationsTest(String name) {
@@ -40,57 +35,50 @@ public class MiscNumericalOperationsTest extends TestCase {
     public void testForceUnwrappedNumberToType() {
         // Usual type to to all other types:
         Double n = Double.valueOf(123.75);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Short.class, false), Short.valueOf(n.shortValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Short.TYPE, false), Short.valueOf(n.shortValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Byte.class, false), Byte.valueOf(n.byteValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Byte.TYPE, false), Byte.valueOf(n.byteValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Integer.class, false), Integer.valueOf(n.intValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Integer.TYPE, false), Integer.valueOf(n.intValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Long.class, false), Long.valueOf(n.longValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Long.TYPE, false), Long.valueOf(n.longValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Float.class, false), Float.valueOf(n.floatValue()));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Float.TYPE, false), Float.valueOf(n.floatValue()));
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Double.class, false) == n);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Double.TYPE, false) == n);
-        try {
-            assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigInteger.class, false), new BigInteger("123"));
-            fail();
-        } catch (NumberFormatException e) {
-            // expected
-        }
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigInteger.class, true), new BigInteger("123"));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigDecimal.class, false), new BigDecimal("123.75"));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Short.class), Short.valueOf(n.shortValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Short.TYPE), Short.valueOf(n.shortValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Byte.class), Byte.valueOf(n.byteValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Byte.TYPE), Byte.valueOf(n.byteValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Integer.class), Integer.valueOf(n.intValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Integer.TYPE), Integer.valueOf(n.intValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Long.class), Long.valueOf(n.longValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Long.TYPE), Long.valueOf(n.longValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Float.class), Float.valueOf(n.floatValue()));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, Float.TYPE), Float.valueOf(n.floatValue()));
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Double.class) == n);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Double.TYPE) == n);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigInteger.class), new BigInteger("123"));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(n, BigDecimal.class), new BigDecimal("123.75"));
         
         // Cases of conversion to BigDecimal:
         BigDecimal bd = new BigDecimal("123");
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(new BigInteger("123"), BigDecimal.class, false), bd);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(bd, BigDecimal.class, false) == bd);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Long.valueOf(123), BigDecimal.class, false), bd);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Double.valueOf(123), BigDecimal.class, false), bd);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(new BigInteger("123"), BigDecimal.class), bd);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(bd, BigDecimal.class) == bd);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Long.valueOf(123), BigDecimal.class), bd);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Double.valueOf(123), BigDecimal.class), bd);
         
         // Cases of conversion to BigInteger:
         BigInteger bi = new BigInteger("123");
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(new BigDecimal("123.6"), BigInteger.class, true), bi);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(new BigDecimal("123.6"), BigInteger.class), bi);
         assertEquals(BeansWrapper.forceUnwrappedNumberToType(
-                new OverloadedNumberUtil.IntegerBigDecimal(new BigDecimal("123")), BigInteger.class, true), bi);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(bi, BigInteger.class, true) == bi);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Long.valueOf(123), BigInteger.class, true), bi);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Double.valueOf(123.6), BigInteger.class, true), bi);
+                new OverloadedNumberUtil.IntegerBigDecimal(new BigDecimal("123")), BigInteger.class), bi);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(bi, BigInteger.class) == bi);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Long.valueOf(123), BigInteger.class), bi);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(Double.valueOf(123.6), BigInteger.class), bi);
 
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Number.class, true) == n);
-        assertNull(BeansWrapper.forceUnwrappedNumberToType(n, RationalNumber.class, true));
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(n, Number.class) == n);
+        assertNull(BeansWrapper.forceUnwrappedNumberToType(n, RationalNumber.class));
         RationalNumber r = new RationalNumber(1, 2);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(r, RationalNumber.class, true) == r);
-        assertTrue(BeansWrapper.forceUnwrappedNumberToType(r, Number.class, true) == r);
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, Double.class, true), Double.valueOf(0.5));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, BigDecimal.class, true), new BigDecimal("0.5"));
-        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, BigInteger.class, true), BigInteger.ZERO);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(r, RationalNumber.class) == r);
+        assertTrue(BeansWrapper.forceUnwrappedNumberToType(r, Number.class) == r);
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, Double.class), Double.valueOf(0.5));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, BigDecimal.class), new BigDecimal("0.5"));
+        assertEquals(BeansWrapper.forceUnwrappedNumberToType(r, BigInteger.class), BigInteger.ZERO);
     }
     
     @SuppressWarnings("boxing")
     public void testForceNumberArgumentsToParameterTypes() {
-        OverloadedMethodsSubset oms
-                = new OverloadedFixArgsMethods(new BeansWrapper(Configuration.VERSION_2_3_21).is2321Bugfixed());
+        OverloadedMethodsSubset oms = new OverloadedFixArgsMethods();
         Class[] paramTypes = new Class[] { Short.TYPE, Short.class, Double.TYPE, BigDecimal.class, BigInteger.class };
         Object[] args;
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java
index c460df6..2f179e9 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/ModelCacheTest.java
@@ -19,12 +19,13 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
@@ -34,8 +35,8 @@ public class ModelCacheTest {
     
     @Test
     public void modelCacheOff() throws Exception {
-        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
-        assertFalse(bw.getUseCache());  // default is off
+        BeansWrapper bw = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
+        assertFalse(bw.getUseModelCache());  // default is off
         
         String s = "foo";
         assertNotSame(bw.wrap(s), bw.wrap(s));
@@ -46,9 +47,9 @@ public class ModelCacheTest {
     
     @Test
     public void modelCacheOn() throws Exception {
-        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_2_3_21);
-        bw.setUseCache(true);
-        assertTrue(bw.getUseCache());
+        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0);
+        bw.setUseModelCache(true);
+        assertTrue(bw.getUseModelCache());
         
         String s = "foo";
         assertSame(bw.wrap(s), bw.wrap(s));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java
index 9d4b3eb..596b3e7 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/ParameterListPreferabilityTest.java
@@ -27,8 +27,6 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.TreeMap;
 
-import org.apache.freemarker.core.model.impl.beans.ArgumentTypes;
-import org.apache.freemarker.core.model.impl.beans.OverloadedNumberUtil;
 import org.apache.freemarker.core.util._NumberUtil;
 
 import junit.framework.TestCase;
@@ -397,7 +395,7 @@ public class ParameterListPreferabilityTest extends TestCase {
                 true);
         
         
-        // Different fixed prefix length; in the case of ambiguity, the one with higher fixed param count wins.
+        // Different oms prefix length; in the case of ambiguity, the one with higher oms param count wins.
         testAllCmpPermutationsInc(
                 new Class[][] {
                     new Class[] { String.class, int.class, int.class, int[].class },
@@ -420,7 +418,7 @@ public class ParameterListPreferabilityTest extends TestCase {
      * @param sortedSignatures method signatures sorted by decreasing specificity
      */
     private void testAllCmpPermutationsInc(Class[][] sortedSignatures, Object[] args, boolean varargs) {
-        final ArgumentTypes argTs = new ArgumentTypes(args, true);
+        final ArgumentTypes argTs = new ArgumentTypes(args);
         for (int i = 0; i < sortedSignatures.length; i++) {
             for (int j = 0; j < sortedSignatures.length; j++) {
                 assertEquals("sortedSignatures[" + i + "] <==> sortedSignatures [" + j + "]",
@@ -434,7 +432,7 @@ public class ParameterListPreferabilityTest extends TestCase {
     }
 
     private void testAllCmpPermutationsEqu(Class[][] signatures, Object[] args) {
-        final ArgumentTypes argTs = new ArgumentTypes(args, true);
+        final ArgumentTypes argTs = new ArgumentTypes(args);
         for (int i = 0; i < signatures.length; i++) {
             for (int j = 0; j < signatures.length; j++) {
                 assertEquals("sortedSignatures[" + i + "] <==> sortedSignatures [" + j + "]",

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java
index 3db26a0..a6b82b6 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/StaticModelsTest.java
@@ -19,8 +19,14 @@
 
 package org.apache.freemarker.core.model.impl.beans;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 
@@ -30,7 +36,6 @@ import org.apache.freemarker.core.model.TemplateMethodModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
@@ -40,7 +45,7 @@ public class StaticModelsTest {
 
     @Test
     public void modelCaching() throws Exception {
-        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_2_3_21);
+        BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0);
         TemplateHashModel statics = bw.getStaticModels();
         TemplateHashModel s = (TemplateHashModel) statics.get(S.class.getName());
         assertNotNull(s);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java b/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java
index 0730b3a..301e08f 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/TypeFlagsTest.java
@@ -35,12 +35,6 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
-import org.apache.freemarker.core.model.impl.beans.OverloadedFixArgsMethods;
-import org.apache.freemarker.core.model.impl.beans.OverloadedMethodsSubset;
-import org.apache.freemarker.core.model.impl.beans.OverloadedVarArgsMethods;
-import org.apache.freemarker.core.model.impl.beans.ReflectionCallableMemberDescriptor;
-import org.apache.freemarker.core.model.impl.beans.TypeFlags;
 
 import junit.framework.TestCase;
 
@@ -50,7 +44,7 @@ public class TypeFlagsTest extends TestCase {
         super(name);
     }
     
-    private final BeansWrapper bw = new BeansWrapper(Configuration.VERSION_2_3_21); 
+    private final BeansWrapper bw = new BeansWrapper(Configuration.VERSION_3_0_0); 
 
     public void testSingleNumType() {
         checkTypeFlags(SingleNumTypeC.class, "mInt",
@@ -641,7 +635,7 @@ public class TypeFlagsTest extends TestCase {
         });
         
         final OverloadedMethodsSubset oms = cl.getName().indexOf("VarArgs") == -1
-                ? new OverloadedFixArgsMethods(bw.is2321Bugfixed()) : new OverloadedVarArgsMethods(bw.is2321Bugfixed());
+                ? new OverloadedFixArgsMethods() : new OverloadedVarArgsMethods();
         for (Method m : filteredMethods) {
             oms.addCallableMemberDescriptor(new ReflectionCallableMemberDescriptor(m, m.getParameterTypes()));
         }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java b/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
index 0660228..a604b33 100644
--- a/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
+++ b/src/test/java/org/apache/freemarker/core/templateresolver/DefaultTemplateResolverTest.java
@@ -35,6 +35,7 @@ import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateNotFoundException;
 import org.apache.freemarker.core.ast.ParseException;
+import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateLookupStrategy;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateNameFormat;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateResolver;
 import org.apache.freemarker.core.templateresolver.impl.StringTemplateLoader;
@@ -54,7 +55,9 @@ public class DefaultTemplateResolverTest {
     public void testCachedException() throws Exception {
         MockTemplateLoader loader = new MockTemplateLoader();
         DefaultTemplateResolver tr = new DefaultTemplateResolver(
-                loader, new StrongCacheStorage(), new Configuration(Configuration.VERSION_3_0_0));
+                loader, new StrongCacheStorage(),
+                DefaultTemplateLookupStrategy.INSTANCE, DefaultTemplateNameFormat.INSTANCE,
+                new Configuration(Configuration.VERSION_3_0_0));
         tr.setTemplateUpdateDelayMilliseconds(1000L);
         loader.setThrowException(true);
         try {
@@ -89,7 +92,9 @@ public class DefaultTemplateResolverTest {
     @Test
     public void testCachedNotFound() throws Exception {
         MockTemplateLoader loader = new MockTemplateLoader();
-        DefaultTemplateResolver cache = new DefaultTemplateResolver(loader, new StrongCacheStorage(), new Configuration());
+        DefaultTemplateResolver cache = new DefaultTemplateResolver(
+                loader, new StrongCacheStorage(), DefaultTemplateLookupStrategy.INSTANCE,
+                DefaultTemplateNameFormat.INSTANCE, new Configuration());
         cache.setTemplateUpdateDelayMilliseconds(1000L);
         cache.setLocalizedLookup(false);
         assertNull(cache.getTemplate("t", Locale.getDefault(), null, "", true).getTemplate());
@@ -273,7 +278,7 @@ public class DefaultTemplateResolverTest {
     
     @Test
     public void testWrongEncodingReload() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setLocale(Locale.US);
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
@@ -337,7 +342,7 @@ public class DefaultTemplateResolverTest {
 
     @Test
     public void testNoWrongEncodingForTemplateLoader2WithReader() throws IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setLocale(Locale.US);
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
@@ -384,7 +389,7 @@ public class DefaultTemplateResolverTest {
     public void testEncodingSelection() throws IOException {
         Locale hungary = new Locale("hu", "HU"); 
                 
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setDefaultEncoding("utf-8");
         
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
@@ -452,28 +457,23 @@ public class DefaultTemplateResolverTest {
     }
     
     @Test
-    public void testTemplateNameFormatExceptionAndBackwardCompatibility() throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
-        
-        assertNull(cfg.getTemplate("../x", null, null, null, true, true));
+    public void testTemplateNameFormatException() throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException {
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
+        cfg.setTemplateNameFormat(DefaultTemplateNameFormat.INSTANCE);
         try {
-            cfg.getTemplate("../x");
+            cfg.getTemplate("../x", null, null, null, true, true);
             fail();
-        } catch (TemplateNotFoundException e) {
+        } catch (MalformedTemplateNameException e) {
             // expected
         }
-        
-        // [2.4] Test it with IcI 2.4
-        
-        cfg.setTemplateNameFormat(DefaultTemplateNameFormat.INSTANCE);
         try {
-            cfg.getTemplate("../x", null, null, null, true, true);
+            cfg.getTemplate("../x");
             fail();
         } catch (MalformedTemplateNameException e) {
             // expected
         }
         try {
-            cfg.getTemplate("../x");
+            cfg.getTemplate("\\x");
             fail();
         } catch (MalformedTemplateNameException e) {
             // expected

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java b/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java
index 34a4a99..b11e0c7 100644
--- a/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java
+++ b/src/test/java/org/apache/freemarker/core/templateresolver/FileTemplateLoaderTest.java
@@ -18,8 +18,12 @@
  */
 package org.apache.freemarker.core.templateresolver;
 
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.io.IOException;
@@ -39,7 +43,7 @@ public class FileTemplateLoaderTest {
     
     private File templateRootDir;
     
-    Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
+    private Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
     
     @Before
     public void setup() throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java b/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java
index 1401781..84a88d1 100644
--- a/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java
+++ b/src/test/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactoryTest.java
@@ -31,19 +31,11 @@ import java.util.List;
 
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.ast.TemplateConfiguration;
-import org.apache.freemarker.core.templateresolver.ConditionalTemplateConfigurationFactory;
-import org.apache.freemarker.core.templateresolver.FileNameGlobMatcher;
-import org.apache.freemarker.core.templateresolver.FirstMatchTemplateConfigurationFactory;
-import org.apache.freemarker.core.templateresolver.MergingTemplateConfigurationFactory;
-import org.apache.freemarker.core.templateresolver.PathGlobMatcher;
-import org.apache.freemarker.core.templateresolver.TemplateConfigurationFactory;
-import org.apache.freemarker.core.templateresolver.TemplateConfigurationFactoryException;
-import org.apache.freemarker.core.templateresolver.TemplateLoadingSource;
 import org.junit.Test;
 
 public class TemplateConfigurationFactoryTest {
     
-    private Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+    private Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
     @Test
     public void testCondition1() throws IOException, TemplateConfigurationFactoryException {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java b/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java
index 9ad98e7..611f8b2 100644
--- a/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java
+++ b/src/test/java/org/apache/freemarker/core/templateresolver/TemplateNameFormatTest.java
@@ -32,6 +32,7 @@ import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateNotFoundException;
 import org.apache.freemarker.core.ast.ParseException;
+import org.apache.freemarker.core.templateresolver.impl.ByteArrayTemplateLoader;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateNameFormat;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateNameFormatFM2;
 import org.apache.freemarker.test.MonitoredTemplateLoader;
@@ -226,7 +227,7 @@ public class TemplateNameFormatTest {
     
     @Test
     public void assertBackslashNotSpecialWith23() throws MalformedTemplateNameException, ParseException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
 
         MonitoredTemplateLoader tl = new MonitoredTemplateLoader();
         tl.putTextTemplate("foo\\bar.ftl", "");
@@ -275,8 +276,9 @@ public class TemplateNameFormatTest {
     }
 
     @Test
-    public void assertBackslashNotAllowedWith24() throws MalformedTemplateNameException, ParseException, IOException {
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+    public void assertBackslashNotAllowed() throws MalformedTemplateNameException, ParseException, IOException {
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
+        cfg.setTemplateLoader(new ByteArrayTemplateLoader());
         cfg.setTemplateNameFormat(DefaultTemplateNameFormat.INSTANCE);
         try {
             cfg.getTemplate("././foo\\bar.ftl", Locale.US);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java b/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java
index aa55c8d..7599b79 100644
--- a/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java
+++ b/src/test/java/org/apache/freemarker/manualtest/GettingStartedExample.java
@@ -36,7 +36,7 @@ public class GettingStartedExample {
         /* You should do this ONLY ONCE in the whole application life-cycle:        */    
     
         /* Create and adjust the configuration singleton */
-        Configuration cfg = new Configuration(Configuration.VERSION_2_3_24);
+        Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
         cfg.setClassForTemplateLoading(GettingStartedExample.class, "");
         cfg.setDefaultEncoding("UTF-8");
         cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java b/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java
index 413f05d..1a7830b 100644
--- a/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java
+++ b/src/test/java/org/apache/freemarker/servlet/FreemarkerServletTest.java
@@ -52,7 +52,6 @@ import org.apache.freemarker.core.templateresolver.FileNameGlobMatcher;
 import org.apache.freemarker.core.templateresolver.FirstMatchTemplateConfigurationFactory;
 import org.apache.freemarker.core.templateresolver.TemplateLoader;
 import org.apache.freemarker.core.templateresolver.impl.ByteArrayTemplateLoader;
-import org.apache.freemarker.servlet.FreemarkerServlet;
 import org.junit.Before;
 import org.junit.Test;
 import org.springframework.mock.web.MockHttpServletRequest;
@@ -547,7 +546,7 @@ public class FreemarkerServletTest {
         protected Configuration createConfiguration() {
             Configuration cfg = super.createConfiguration();
             // Needed for the TemplateConfiguration that sets outputEncoding:
-            cfg.setIncompatibleImprovements(Configuration.VERSION_2_3_22);
+            cfg.setIncompatibleImprovements(Configuration.VERSION_3_0_0);
 
             // Set a test runner environment independent default locale:
             cfg.setLocale(DEFAULT_LOCALE);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java b/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java
index 8cfdf57..808fec4 100644
--- a/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java
+++ b/src/test/java/org/apache/freemarker/servlet/jsp/RealServletContainertTest.java
@@ -19,7 +19,10 @@
 
 package org.apache.freemarker.servlet.jsp;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.util.AbstractList;
@@ -32,7 +35,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import java.util.regex.Pattern;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -54,7 +56,6 @@ import org.apache.freemarker.test.servlet.WebAppTestCase;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -96,19 +97,10 @@ public class RealServletContainertTest extends WebAppTestCase {
                 + "&view=attributes.ftl");
 
         restartWebAppIfStarted(WEBAPP_BASIC);  // To clear the application scope attributes
-        assertExpectedEqualsOutput(WEBAPP_BASIC, "attributes-2.3.22-future.txt", "tester"
+        assertExpectedEqualsOutput(WEBAPP_BASIC, "attributes-modernModels.txt", "tester"
                 + "?action=" + AllKindOfContainersModel2Action.class.getName()
-                + "&view=attributes.ftl&viewServlet=freemarker-2.3.22-future");
-        
-        restartWebAppIfStarted(WEBAPP_BASIC);  // To clear the application scope attributes
-        assertExpectedEqualsOutput(WEBAPP_BASIC, "attributes-2.3.0.txt", "tester"
-                + "?action=" + AllKindOfContainersModel2Action.class.getName()
-                + "&view=attributes.ftl&viewServlet=freemarker-2.3.0",
-                true,
-                ImmutableList.<Pattern>of(
-                        Pattern.compile("(?<=^Date-time: ).*", Pattern.MULTILINE), // Uses Date.toString, so plat. dep.
-                        Pattern.compile("(?<=^MyMap: ).*", Pattern.MULTILINE)  // Uses HashMap, so order unknown
-                        ));
+                + "&view=attributes.ftl&viewServlet=freemarker-modernModels");
+        // [FM3] Won't need the "modern" servlet as soon as DOW defaults change to recommended values
     }
 
     @Test
@@ -273,8 +265,6 @@ public class RealServletContainertTest extends WebAppTestCase {
         assertEquals(200, getResponseStatusCode(WEBAPP_CONFIG,
                 "tester?view=test.ftl&viewServlet=freemarker-assertDefaultsFreemarkerServlet"));
         assertEquals(200, getResponseStatusCode(WEBAPP_CONFIG,
-                "tester?view=test.ftl&viewServlet=freemarker-assertDefaultsIcI2322FreemarkerServlet"));
-        assertEquals(200, getResponseStatusCode(WEBAPP_CONFIG,
                 "tester?view=test.ftl&viewServlet=freemarker-assertCustomizedDefaultsFreemarkerServlet"));
         assertEquals(200, getResponseStatusCode(WEBAPP_CONFIG,
                 "tester?view=test.ftl&viewServlet=freemarker-assertObjectWrapperDefaults1FreemarkerServlet"));
@@ -395,7 +385,7 @@ public class RealServletContainertTest extends WebAppTestCase {
 
         @Override
         protected void doAssertions(Configuration cfg) {
-            assertEquals(Configuration.VERSION_2_3_22, cfg.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, cfg.getIncompatibleImprovements());
             
             assertSame(cfg.getTemplateExceptionHandler(), TemplateExceptionHandler.HTML_DEBUG_HANDLER);
             
@@ -404,7 +394,7 @@ public class RealServletContainertTest extends WebAppTestCase {
             {
                 ObjectWrapper ow = cfg.getObjectWrapper();
                 assertTrue(ow instanceof DefaultObjectWrapper);
-                assertEquals(Configuration.VERSION_2_3_22, ((DefaultObjectWrapper) ow).getIncompatibleImprovements());
+                assertEquals(Configuration.VERSION_3_0_0, ((DefaultObjectWrapper) ow).getIncompatibleImprovements());
             }
             
             {
@@ -416,32 +406,24 @@ public class RealServletContainertTest extends WebAppTestCase {
         }
         
     }
-
-    public static class AssertDefaultsIcI2322FreemarkerServlet extends AssertDefaultsFreemarkerServlet {
-
-        @Override
-        protected Configuration createConfiguration() {
-            Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
-            return cfg;
-        }
-        
-    }
     
     public static class AssertCustomizedDefaultsFreemarkerServlet extends AssertingFreemarkerServlet {
 
         @Override
         protected Configuration createConfiguration() {
-            Configuration cfg = new Configuration(Configuration.VERSION_2_3_20);
+            Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
             cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
             cfg.setLogTemplateExceptions(true);
-            cfg.setObjectWrapper(new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build());
+            BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
+            bwb.setUseModelCache(true);
+            cfg.setObjectWrapper(bwb.build());
             cfg.setTemplateLoader(new WebAppTemplateLoader(getServletContext()));
             return cfg;
         }
 
         @Override
         protected void doAssertions(Configuration cfg) {
-            assertEquals(Configuration.VERSION_2_3_20, cfg.getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, cfg.getIncompatibleImprovements());
             
             assertSame(cfg.getTemplateExceptionHandler(), TemplateExceptionHandler.RETHROW_HANDLER);
             
@@ -450,7 +432,8 @@ public class RealServletContainertTest extends WebAppTestCase {
             {
                 ObjectWrapper ow = cfg.getObjectWrapper();
                 assertSame(BeansWrapper.class, ow.getClass());
-                assertEquals(Configuration.VERSION_2_3_21, ((BeansWrapper) ow).getIncompatibleImprovements());
+                assertTrue(((BeansWrapper) ow).getUseModelCache());
+                assertEquals(Configuration.VERSION_3_0_0, ((BeansWrapper) ow).getIncompatibleImprovements());
             }
             
             {
@@ -468,12 +451,15 @@ public class RealServletContainertTest extends WebAppTestCase {
         protected void doAssertions(Configuration cfg) throws Exception {
             ObjectWrapper ow = cfg.getObjectWrapper();
             assertSame(BeansWrapper.class, ow.getClass());
-            assertEquals(Configuration.VERSION_2_3_21, ((BeansWrapper) ow).getIncompatibleImprovements());
+            assertTrue(((BeansWrapper) ow).getUseModelCache());
         }
 
         @Override
         protected ObjectWrapper createDefaultObjectWrapper() {
-            return new BeansWrapperBuilder(Configuration.VERSION_2_3_21).build();
+            BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
+            bwb.setUseModelCache(true);
+            assertEquals(Configuration.VERSION_3_0_0, bwb.getIncompatibleImprovements());
+            return bwb.build();
         }
         
     }
@@ -483,8 +469,8 @@ public class RealServletContainertTest extends WebAppTestCase {
 
         @Override
         protected Configuration createConfiguration() {
-            Configuration cfg = new Configuration(Configuration.VERSION_2_3_20);
-            cfg.setObjectWrapper(new SimpleObjectWrapper(Configuration.VERSION_2_3_22));
+            Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
+            cfg.setObjectWrapper(new SimpleObjectWrapper(Configuration.VERSION_3_0_0));
             return cfg;
         }
         
@@ -492,7 +478,7 @@ public class RealServletContainertTest extends WebAppTestCase {
         protected void doAssertions(Configuration cfg) throws Exception {
             ObjectWrapper ow = cfg.getObjectWrapper();
             assertSame(SimpleObjectWrapper.class, ow.getClass());
-            assertEquals(Configuration.VERSION_2_3_22, ((BeansWrapper) ow).getIncompatibleImprovements());
+            assertEquals(Configuration.VERSION_3_0_0, ((BeansWrapper) ow).getIncompatibleImprovements());
         }
         
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java b/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
index 5825a56..bef3042 100644
--- a/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
+++ b/src/test/java/org/apache/freemarker/servlet/jsp/TLDParsingTest.java
@@ -19,7 +19,9 @@
 
 package org.apache.freemarker.servlet.jsp;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.InputStream;
 import java.net.URL;
@@ -32,15 +34,13 @@ import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.TagSupport;
 import javax.xml.parsers.SAXParserFactory;
 
-import org.apache.freemarker.core.Version;
+import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.model.TemplateMethodModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.model.impl.SimpleScalar;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 import org.apache.freemarker.core.model.impl.beans.BeansWrapperBuilder;
-import org.apache.freemarker.servlet.jsp.JspTagModelBase;
-import org.apache.freemarker.servlet.jsp.TaglibFactory;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -55,8 +55,7 @@ public class TLDParsingTest {
 
     @Before
     public void before() throws Exception {
-        BeansWrapperBuilder builder = new BeansWrapperBuilder(new Version("2.3"));
-        wrapper = builder.build();
+        wrapper = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/TemplateTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/TemplateTest.java b/src/test/java/org/apache/freemarker/test/TemplateTest.java
index 61ff22e..f4e74ec 100644
--- a/src/test/java/org/apache/freemarker/test/TemplateTest.java
+++ b/src/test/java/org/apache/freemarker/test/TemplateTest.java
@@ -135,7 +135,7 @@ public abstract class TemplateTest {
     }
     
     protected Configuration createConfiguration() throws Exception {
-        return new Configuration(Configuration.VERSION_2_3_0);
+        return new Configuration(Configuration.VERSION_3_0_0);
     }
     
     protected void addCommonTemplates() {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java b/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
index 720dd27..19c9531 100644
--- a/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
+++ b/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
@@ -185,8 +185,12 @@ public class WebAppTestCase {
         final String expected;
         {
             ClassPathResource cpResource = findWebAppDirectoryResource(webAppName);
+            String expectedResource = cpResource.path + EXPECTED_DIR + expectedFileName;
             final InputStream in = cpResource.resolverClass.getResourceAsStream(
-                    cpResource.path + EXPECTED_DIR + expectedFileName);
+                    expectedResource);
+            if (in == null) {
+                throw new IOException("Test resource not found: " + expectedResource);
+            }
             try {
                 expected = TestUtil.removeTxtCopyrightComment(normalizeWS(IOUtils.toString(in, "utf-8"), compressWS));
             } finally {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/servlet/web.xml
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/servlet/web.xml b/src/test/java/org/apache/freemarker/test/servlet/web.xml
deleted file mode 100644
index 621472f..0000000
--- a/src/test/java/org/apache/freemarker/test/servlet/web.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!--
-  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.
--->
-
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
-	version="2.4">
-
-	<servlet>
-		<servlet-name>controller</servlet-name>
-		<servlet-class>com.example.Model2ControllerServlet</servlet-class>
-	</servlet>
-
-	<servlet-mapping>
-		<servlet-name>controller</servlet-name>
-		<url-pattern>*.c</url-pattern>
-    </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>controller</servlet-name>
-        <url-pattern>/</url-pattern>
-	</servlet-mapping>
-
-	<servlet>
-		<servlet-name>freemarker</servlet-name>
-		<servlet-class>org.apache.freemarker.servlet.FreemarkerServlet</servlet-class>
-
-		<!-- FreemarkerServlet settings: -->
-		<init-param>
-			<param-name>TemplatePath</param-name>
-			<param-value>/</param-value>
-		</init-param>
-		<init-param>
-			<param-name>NoCache</param-name>
-			<param-value>true</param-value>
-		</init-param>
-		<init-param>
-			<param-name>ContentType</param-name>
-			<param-value>text/html; charset=UTF-8</param-value> <!-- Forces UTF-8 output encoding! -->
-		</init-param>
-
-		<!-- FreeMarker settings: -->
-		<init-param>
-			<param-name>incompatible_improvements</param-name>
-			<param-value>2.3.21</param-value>
-		</init-param>
-		<init-param>
-			<param-name>template_exception_handler</param-name>
-			<!-- Some may prefer "html_debug" for development. -->
-			<param-value>rethrow</param-value>
-		</init-param>
-		<init-param>
-			<param-name>template_update_delay</param-name>
-			<param-value>0</param-value> <!-- 0 is for development only! Use higher value otherwise. -->
-		</init-param>
-		<init-param>
-			<param-name>default_encoding</param-name>
-			<param-value>UTF-8</param-value> <!-- The encoding of the template files. -->
-		</init-param>
-		<init-param>
-			<param-name>number_format</param-name>
-			<param-value>0.##########</param-value>
-		</init-param>
-
-		<load-on-startup>1</load-on-startup>
-	</servlet>
-
-	<servlet-mapping>
-		<servlet-name>freemarker</servlet-name>
-		<url-pattern>*.ftl</url-pattern>
-	</servlet-mapping>
-
-	<!-- Prevent the visiting of MVC Views from outside the servlet container. 
-		RequestDispatcher.forward/include should and will still work. Removing this 
-		may open security holes! -->
-	<security-constraint>
-		<web-resource-collection>
-			<web-resource-name>FreeMarker MVC Views</web-resource-name>
-			<url-pattern>*.ftl</url-pattern>
-		</web-resource-collection>
-		<auth-constraint>
-			<!-- Nobody is allowed to visit these -->
-		</auth-constraint>
-	</security-constraint>
-
-</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
index 8284f7d..c210728 100644
--- a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
+++ b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
@@ -46,7 +46,6 @@ import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.Version;
-import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.ast.ASTPrinter;
 import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateDateModel;
@@ -80,7 +79,6 @@ import org.apache.freemarker.test.templatesuite.models.BooleanVsStringMethods;
 import org.apache.freemarker.test.templatesuite.models.JavaObjectInfo;
 import org.apache.freemarker.test.templatesuite.models.Listables;
 import org.apache.freemarker.test.templatesuite.models.MultiModel1;
-import org.apache.freemarker.test.templatesuite.models.OverloadedMethods;
 import org.apache.freemarker.test.templatesuite.models.OverloadedMethods2;
 import org.apache.freemarker.test.templatesuite.models.VarArgTestModel;
 import org.apache.freemarker.test.util.AssertDirective;
@@ -183,7 +181,7 @@ public class TemplateTestCase extends FileTestCase {
         conf.setTemplateLoader(new CopyrightCommentRemoverTemplateLoader(
                 new FileTemplateLoader(new File(getTestClassDirectory(), "templates"))));
         
-        BeansWrapper beansWrapper = new BeansWrapperBuilder(Configuration.VERSION_2_3_0).build();
+        BeansWrapper beansWrapper = new BeansWrapperBuilder(Configuration.VERSION_3_0_0).build();
         
         dataModel.put(ASSERT_VAR_NAME, AssertDirective.INSTANCE);
         dataModel.put(ASSERT_EQUALS_VAR_NAME, AssertEqualsDirective.INSTANCE);
@@ -407,8 +405,6 @@ public class TemplateTestCase extends FileTestCase {
           dataModel.put("bigDecimal", new BigDecimal("1305575275539.5"));
         } else if (simpleTestName.equals("varargs")) {
           dataModel.put("m", new VarArgTestModel());
-        } else if (simpleTestName.startsWith("overloaded-methods-") && !simpleTestName.startsWith("overloaded-methods-2-")) {
-          dataModel.put("obj", new OverloadedMethods());
         } else if (simpleTestName.startsWith("boolean-formatting")) {
           dataModel.put("beansBoolean", new BooleanModel(Boolean.TRUE, (BeansWrapper) conf.getObjectWrapper()));
           dataModel.put("booleanAndString", new BooleanAndStringTemplateModel());
@@ -436,13 +432,10 @@ public class TemplateTestCase extends FileTestCase {
             dataModel.put("bp", Byte.valueOf((byte) 5));
             dataModel.put("bip", BigInteger.valueOf(5));
             dataModel.put("bdp", BigDecimal.valueOf(0.05));
-        } else if (simpleTestName.startsWith("overloaded-methods-2-")) {
+        } else if (simpleTestName.startsWith("overloaded-methods")) {
             dataModel.put("obj", new OverloadedMethods2());
             final boolean dow = conf.getObjectWrapper() instanceof DefaultObjectWrapper;
             dataModel.put("dow", dow);
-            dataModel.put("dowPre22", dow
-                    && ((DefaultObjectWrapper) conf.getObjectWrapper()).getIncompatibleImprovements()
-                            .intValue() < _TemplateAPI.VERSION_INT_2_3_22);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
index 4ec5e15..e5be937 100644
--- a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
+++ b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
@@ -32,8 +32,6 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
-import junit.framework.TestSuite;
-
 import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core.model.impl.dom.NodeModel;
@@ -46,6 +44,8 @@ import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 
+import junit.framework.TestSuite;
+
 /**
  * Test suite where the test cases are defined in testcases.xml, and usually process
  * templates and compare their output with the expected output.
@@ -274,7 +274,7 @@ public class TemplateTestSuite extends TestSuite {
     }
 
     private Version getMinIcIVersion() {
-        return Configuration.VERSION_2_3_0;
+        return Configuration.VERSION_3_0_0;
     }
 
     private Map<String, String> getCaseFMSettings(Element e) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java b/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
index 6e4ffbf..d8a337e 100644
--- a/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
+++ b/src/test/java/org/apache/freemarker/test/templatesuite/models/Listables.java
@@ -37,6 +37,7 @@ import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.WrappingTemplateModel;
 import org.apache.freemarker.core.model.impl.DefaultMapAdapter;
+import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
 import org.apache.freemarker.core.model.impl.DefaultObjectWrapperBuilder;
 import org.apache.freemarker.core.model.impl.SimpleCollection;
 import org.apache.freemarker.core.model.impl.SimpleHash;
@@ -128,7 +129,7 @@ public class Listables {
     public List<? extends TemplateHashModelEx> getEmptyHashes() throws TemplateModelException {
         List<TemplateHashModelEx> emptyMaps = new ArrayList<>();
         emptyMaps.addAll(getMapsWrappedAsEx2(Collections.emptyMap()));
-        emptyMaps.add((TemplateHashModelEx) new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_24).build()
+        emptyMaps.add((TemplateHashModelEx) new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0).build()
                 .wrap(Collections.emptyMap()));
         return emptyMaps;
     }
@@ -139,11 +140,11 @@ public class Listables {
     private List<TemplateHashModelEx2> getMapsWrappedAsEx2(Map<?, ?> map) throws TemplateModelException {
         List<TemplateHashModelEx2> maps = new ArrayList<>();
         
-        maps.add((SimpleHash) new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_0).build().wrap(map));
+        DefaultObjectWrapper ow = new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0).build();
+        maps.add(new SimpleHash(map, ow));
+        maps.add((DefaultMapAdapter) ow.wrap(map));
         
-        maps.add((DefaultMapAdapter) new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_24).build().wrap(map));
-        
-        BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_2_3_24);
+        BeansWrapperBuilder bwb = new BeansWrapperBuilder(Configuration.VERSION_3_0_0);
         bwb.setSimpleMapWrapper(true);
         maps.add((TemplateHashModelEx2) bwb.build().wrap(map));
 
@@ -152,7 +153,7 @@ public class Listables {
     
     public TemplateHashModelEx getHashNonEx2() {
         return new NonEx2MapAdapter(ImmutableMap.of("k1", 11, "k2", 22),
-                new DefaultObjectWrapperBuilder(Configuration.VERSION_2_3_24).build());
+                new DefaultObjectWrapperBuilder(Configuration.VERSION_3_0_0).build());
     }
     
     public static class NonEx2MapAdapter extends WrappingTemplateModel implements TemplateHashModelEx {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/8ba7883e/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
new file mode 100644
index 0000000..66f36de
--- /dev/null
+++ b/src/test/java/org/apache/freemarker/test/util/SimpleMapAndCollectionObjectWrapper.java
@@ -0,0 +1,41 @@
+package org.apache.freemarker.test.util;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.freemarker.core.Version;
+import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.model.TemplateModelException;
+import org.apache.freemarker.core.model.impl.DefaultObjectWrapper;
+import org.apache.freemarker.core.model.impl.SimpleHash;
+import org.apache.freemarker.core.model.impl.SimpleSequence;
+
+/**
+ * Forces using "simple" models for {@link Map}-s, {@link Collection}-s and arrays. This is mostly useful for template
+ * test cases that wish to test with these models, but otherwise need to able to wrap beans and such. 
+ */
+public class SimpleMapAndCollectionObjectWrapper extends DefaultObjectWrapper {
+
+    public SimpleMapAndCollectionObjectWrapper(Version incompatibleImprovements) {
+        super(incompatibleImprovements);
+    }
+
+    @Override
+    public TemplateModel wrap(Object obj) throws TemplateModelException {
+        if (obj == null) {
+            return super.wrap(null);
+        }        
+        if (obj.getClass().isArray()) {
+            obj = convertArray(obj);
+        }
+        if (obj instanceof Collection) {
+            return new SimpleSequence((Collection<?>) obj, this);
+        }
+        if (obj instanceof Map) {
+            return new SimpleHash((Map<?, ?>) obj, this);
+        }
+        
+        return super.wrap(obj);
+    }
+
+}