You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by cb...@apache.org on 2015/09/28 11:26:55 UTC

svn commit: r1705631 - in /velocity/engine/trunk/velocity-engine-core/src: main/java/org/apache/velocity/runtime/parser/node/ASTReference.java test/java/org/apache/velocity/test/issues/StackOverflow32805217TestCase.java

Author: cbrisson
Date: Mon Sep 28 09:26:55 2015
New Revision: 1705631

URL: http://svn.apache.org/viewvc?rev=1705631&view=rev
Log:
bugfix for StackOverflow 32805217

Added:
    velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/StackOverflow32805217TestCase.java   (with props)
Modified:
    velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTReference.java

Modified: velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTReference.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTReference.java?rev=1705631&r1=1705630&r2=1705631&view=diff
==============================================================================
--- velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTReference.java (original)
+++ velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTReference.java Mon Sep 28 09:26:55 2015
@@ -341,7 +341,7 @@ public class ASTReference extends Simple
     {
         if (referenceType == RUNT)
         {
-            writer.write(rootString);
+            writer.write(literal);
             return true;
         }
 

Added: velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/StackOverflow32805217TestCase.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/StackOverflow32805217TestCase.java?rev=1705631&view=auto
==============================================================================
--- velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/StackOverflow32805217TestCase.java (added)
+++ velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/StackOverflow32805217TestCase.java Mon Sep 28 09:26:55 2015
@@ -0,0 +1,39 @@
+package org.apache.velocity.test.issues;
+
+/*
+ * 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.
+ */
+
+import org.apache.velocity.test.BaseTestCase;
+
+/**
+ * This class tests bugfix for http://stackoverflow.com/questions/32805217/bug-or-hidden-feature-in-apache-velocity
+ */
+public class StackOverflow32805217TestCase extends BaseTestCase
+{
+    public StackOverflow32805217TestCase(String name)
+    {
+       super(name);
+    }
+
+    public void testIt()
+    {
+        assertEvalEquals("$map{value}", "$map{value}");
+    }
+
+}

Propchange: velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/StackOverflow32805217TestCase.java
------------------------------------------------------------------------------
    svn:executable = *