freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [10/13] incubator-freemarker git commit: Renaming as _significant for @@previous and @@next
Date Sun, 08 Jan 2017 21:20:29 GMT
Renaming as _significant for @@previous and @@next


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

Branch: refs/heads/2.3-gae
Commit: cd45f545851c7ae443f20eff8398a88ef42a203a
Parents: d40d29c
Author: Pradeep <pradeep_murugesan@trimble.com>
Authored: Sun Dec 13 14:13:49 2015 +0530
Committer: Pradeep <pradeep_murugesan@trimble.com>
Committed: Mon Jan 11 19:21:07 2016 +0530

----------------------------------------------------------------------
 src/main/java/freemarker/ext/dom/ElementModel.java |  4 ++--
 src/test/java/freemarker/core/SiblingTest.java     | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cd45f545/src/main/java/freemarker/ext/dom/ElementModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/dom/ElementModel.java b/src/main/java/freemarker/ext/dom/ElementModel.java
index 628430c..6fa29ba 100644
--- a/src/main/java/freemarker/ext/dom/ElementModel.java
+++ b/src/main/java/freemarker/ext/dom/ElementModel.java
@@ -91,7 +91,7 @@ class ElementModel extends NodeModel implements TemplateScalarModel {
                 nu.outputContent(node.getAttributes(), buf);
                 return new SimpleScalar(buf.toString().trim());
             }
-            if (key.equals("@@previous")) {
+            if (key.equals("@@previous_significant")) {
                 Node previousSibling = node.getPreviousSibling();
                 while(previousSibling != null && !this.isSignificantNode(previousSibling))
{
                     previousSibling = previousSibling.getPreviousSibling();
@@ -102,7 +102,7 @@ class ElementModel extends NodeModel implements TemplateScalarModel {
                     return wrap(previousSibling);
                 }
             }
-            if (key.equals("@@next")) {
+            if (key.equals("@@next_significant")) {
                 Node nextSibling = node.getNextSibling();
                 while(nextSibling != null && !this.isSignificantNode(nextSibling))
{
                     nextSibling = nextSibling.getNextSibling();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cd45f545/src/test/java/freemarker/core/SiblingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/core/SiblingTest.java b/src/test/java/freemarker/core/SiblingTest.java
index 81158c8..e646782 100644
--- a/src/test/java/freemarker/core/SiblingTest.java
+++ b/src/test/java/freemarker/core/SiblingTest.java
@@ -84,20 +84,20 @@ public class SiblingTest extends TemplateTest {
 
     @Test
     public void testSignificantPreviousSibling() throws IOException, TemplateException {
-        String ftl = "${doc.person.name.@@previous}";
+        String ftl = "${doc.person.name.@@previous_significant}";
         assertOutput(ftl, "male");
     }
 
 
     @Test
     public void testSignificantNextSibling() throws IOException, TemplateException {
-        String ftl = "${doc.person.name.@@next}";
+        String ftl = "${doc.person.name.@@next_significant}";
         assertOutput(ftl, "12th August");
     }
 
     @Test
     public void testNullSignificantPreviousSibling() throws IOException, TemplateException
{
-        String ftl = "<#if doc.person.phone.@@next?size == 0>" +
+        String ftl = "<#if doc.person.phone.@@next_significant?size == 0>" +
                 "Next is null" +
                 "<#else>" +
                 "Next is not null" +
@@ -108,19 +108,19 @@ public class SiblingTest extends TemplateTest {
 
     @Test
     public void testSkippingCommentNode() throws IOException, TemplateException {
-        String ftl = "${doc.person.profession.@@previous}";
+        String ftl = "${doc.person.profession.@@previous_significant}";
         assertOutput(ftl, "Chennai, India");
     }
 
     @Test
     public void testSkippingEmptyCdataNode() throws IOException, TemplateException {
-        String ftl = "${doc.person.hobby.@@previous}";
+        String ftl = "${doc.person.hobby.@@previous_significant}";
         assertOutput(ftl, "Software Engineer");
     }
 
     @Test
     public void testValidCdataNode() throws IOException, TemplateException {
-        String ftl = "${doc.person.phone.@@previous}";
+        String ftl = "${doc.person.phone.@@previous_significant}";
         assertOutput(ftl, "\n    this is a valid cdata\n    ");
     }
 }


Mime
View raw message