freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [1/5] incubator-freemarker git commit: Increased version number to 3.0.0 (nightly)
Date Fri, 20 Jan 2017 16:50:47 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 [created] 1588a7f5a


Increased version number to 3.0.0 (nightly)


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

Branch: refs/heads/3
Commit: 7f9ff74af7e4135e0ccc7de655e46bf90b0a9447
Parents: 7418c10
Author: ddekany <ddekany@apache.org>
Authored: Fri Jan 20 13:41:01 2017 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Fri Jan 20 13:41:01 2017 +0100

----------------------------------------------------------------------
 build.xml                                       |  2 +-
 .../java/freemarker/ext/beans/BeansWrapper.java |  7 ++++-
 .../java/freemarker/template/Configuration.java |  3 ++
 .../resources/freemarker/version.properties     |  8 +++---
 .../template/DefaultObjectWrapperTest.java      | 29 ++++++++++++++++----
 5 files changed, 38 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7f9ff74a/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index f42815a..dd0be33 100644
--- a/build.xml
+++ b/build.xml
@@ -37,7 +37,7 @@
   <!-- Ivy project coordinates: -->
   <property name="moduleOrg" value="org.freemarker" />
   <property name="moduleName" value="freemarker" />
-  <property name="moduleBranch" value="2.3" />
+  <property name="moduleBranch" value="3" />
 
   <!-- Will be overidden on the Continous Integration server: -->
   <property name="server.ivy.repo.root" value="${basedir}/build/dummy-server-ivy-repo"
/>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7f9ff74a/src/main/java/freemarker/ext/beans/BeansWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/beans/BeansWrapper.java b/src/main/java/freemarker/ext/beans/BeansWrapper.java
index 8b51238..f840c95 100644
--- a/src/main/java/freemarker/ext/beans/BeansWrapper.java
+++ b/src/main/java/freemarker/ext/beans/BeansWrapper.java
@@ -808,6 +808,10 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable
{
     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.
@@ -818,7 +822,8 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable
{
         if (incompatibleImprovements.intValue() < _TemplateAPI.VERSION_INT_2_3_0) {
             throw new IllegalArgumentException("Version must be at least 2.3.0.");
         }
-        return is2324Bugfixed(incompatibleImprovements) ? Configuration.VERSION_2_3_24
+        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;
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7f9ff74a/src/main/java/freemarker/template/Configuration.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/Configuration.java b/src/main/java/freemarker/template/Configuration.java
index 2b88bde..368ce23 100644
--- a/src/main/java/freemarker/template/Configuration.java
+++ b/src/main/java/freemarker/template/Configuration.java
@@ -413,6 +413,9 @@ public class Configuration extends Configurable implements Cloneable,
ParserConf
     /** 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;
     /** @deprecated Use {@link #DEFAULT_INCOMPATIBLE_IMPROVEMENTS} instead. */

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7f9ff74a/src/main/resources/freemarker/version.properties
----------------------------------------------------------------------
diff --git a/src/main/resources/freemarker/version.properties b/src/main/resources/freemarker/version.properties
index 98ae1ad..029f2b5 100644
--- a/src/main/resources/freemarker/version.properties
+++ b/src/main/resources/freemarker/version.properties
@@ -58,12 +58,12 @@
 # - When the major version number is increased, major backward
 #   compatibility violations are allowed, but still should be avoided.
 # During Apache Incubation, "-incubating" is added to this string.
-version=2.3.26-nightly-incubating
+version=3.0.0-nightly-incubating
 # This exists as oss.sonatype only allows SNAPSHOT and final releases,
 # so instead 2.3.21-rc01 and such we have to use 2.3.21-SNAPSHOT there.
 # For final releases it's the same as "version".
 # During Apache Incubation, "-incubating" is added to this string.
-mavenVersion=2.3.26-SNAPSHOT-incubating
+mavenVersion=3.0.0-SNAPSHOT-incubating
 
 # Version string that conforms to OSGi
 # ------------------------------------
@@ -77,7 +77,7 @@ mavenVersion=2.3.26-SNAPSHOT-incubating
 #   2.4.0.pre01
 #   2.4.0.nightly_@timestampInVersion@
 # During Apache Incubation, "-incubating" is added to this string.
-versionForOSGi=2.3.26.nightly_@timestampInVersion@-incubating
+versionForOSGi=3.0.0.nightly_@timestampInVersion@-incubating
 
 # Version string that conforms to legacy MF
 # -----------------------------------------
@@ -95,7 +95,7 @@ versionForOSGi=2.3.26.nightly_@timestampInVersion@-incubating
 # "97 denotes "nightly", 98 denotes "pre", 99 denotes "rc" build.
 # In general, for the nightly/preview/rc Y of version 2.X, the versionForMf is
 # 2.X-1.(99|98).Y. Note the X-1.
-versionForMf=2.3.25.97
+versionForMf=2.99.97
 
 # The date of the build.
 # This should be automatically filled by the building tool (Ant).

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7f9ff74a/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/template/DefaultObjectWrapperTest.java b/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
index 77d513d..5bb9152 100644
--- a/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
+++ b/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
@@ -19,9 +19,18 @@
 
 package freemarker.template;
 
-import static freemarker.test.hamcerst.Matchers.*;
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static freemarker.test.hamcerst.Matchers.containsStringIgnoringCase;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.Matchers.not;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+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.io.IOException;
 import java.io.StringReader;
@@ -55,7 +64,6 @@ import com.google.common.collect.ImmutableMap;
 import freemarker.ext.beans.BeansWrapper;
 import freemarker.ext.beans.HashAdapter;
 import freemarker.ext.util.WrapperTemplateModel;
-import freemarker.test.templatesuite.models.Listables;
 
 public class DefaultObjectWrapperTest {
 
@@ -79,6 +87,8 @@ public class DefaultObjectWrapperTest {
     static {
         OW22IS.setIterableSupport(true);
     }
+
+    private final static Version LAST_2_3_VERSION = Configuration.VERSION_2_3_26;
     
     @Test
     public void testIncompatibleImprovementsVersionBreakPoints() throws Exception {
@@ -92,19 +102,28 @@ public class DefaultObjectWrapperTest {
         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<Version>();
-        for (int i = _TemplateAPI.VERSION_INT_2_3_0; i <= Configuration.getVersion().intValue();
i++) {
+        int i = _TemplateAPI.VERSION_INT_2_3_0;
+        while (i <= Configuration.getVersion().intValue()) {
             int major = i / 1000000;
             int minor = i % 1000000 / 1000;
             int micro = i % 1000;
             final Version version = new Version(major, minor, micro);
+            
             final Version normalizedVersion = DefaultObjectWrapper.normalizeIncompatibleImprovementsVersion(version);
             actual.add(normalizedVersion);
 
             final DefaultObjectWrapperBuilder builder = new DefaultObjectWrapperBuilder(version);
             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++;
+            }
         }
 
         assertEquals(expected, actual);


Mime
View raw message