velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r686315 - /velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/VelocityCharStream.java
Date Fri, 15 Aug 2008 18:45:06 GMT
Author: nbubna
Date: Fri Aug 15 11:45:05 2008
New Revision: 686315

URL: http://svn.apache.org/viewvc?rev=686315&view=rev
Log:
VELOCITY-570 apply Jacob Mundt's patch to fix OOM errors caused by Ronald's fix

Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/VelocityCharStream.java

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/VelocityCharStream.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/VelocityCharStream.java?rev=686315&r1=686314&r2=686315&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/VelocityCharStream.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/VelocityCharStream.java
Fri Aug 15 11:45:05 2008
@@ -40,7 +40,7 @@
 {
     public static final boolean staticFlag = false;
     int bufsize;
-    private int nextBufExpand = 2048;
+    private int nextBufExpand;
     int available;
     int tokenBegin;
 
@@ -106,7 +106,7 @@
 
 
         bufsize += nextBufExpand;
-        nextBufExpand *= 2;
+        nextBufExpand = bufsize;
         available = bufsize;
         tokenBegin = 0;
     }
@@ -329,7 +329,7 @@
         line = startline;
         column = startcolumn - 1;
 
-        available = bufsize = buffersize;
+        available = bufsize = nextBufExpand = buffersize;
         buffer = new char[buffersize];
         bufline = new int[buffersize];
         bufcolumn = new int[buffersize];
@@ -360,7 +360,7 @@
 
         if (buffer == null || buffersize != buffer.length)
         {
-            available = bufsize = buffersize;
+            available = bufsize = nextBufExpand = buffersize;
             buffer = new char[buffersize];
             bufline = new int[buffersize];
             bufcolumn = new int[buffersize];



Mime
View raw message