cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r168043 - /cocoon/trunk/src/java/org/apache/cocoon/util/NetUtils.java
Date Wed, 04 May 2005 01:49:39 GMT
Author: antonio
Date: Tue May  3 18:49:38 2005
New Revision: 168043

URL: http://svn.apache.org/viewcvs?rev=168043&view=rev
Log:
Init StringBuffers

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/util/NetUtils.java

Modified: cocoon/trunk/src/java/org/apache/cocoon/util/NetUtils.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/util/NetUtils.java?rev=168043&r1=168042&r2=168043&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/util/NetUtils.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/util/NetUtils.java Tue May  3 18:49:38 2005
@@ -270,7 +270,7 @@
 
         boolean slash = (path.charAt(path.length() - 1) == '/');
         
-        StringBuffer b = new StringBuffer();
+        StringBuffer b = new StringBuffer(path.length() + 1 + resource.length());
         b.append(path);
         if (!slash) {
             b.append('/');
@@ -308,7 +308,7 @@
             String pathDiff = path.substring(index);
             String resource = absoluteResource.substring(index);
             int levels = StringUtils.countMatches(pathDiff, "/");
-            StringBuffer b = new StringBuffer();
+            StringBuffer b = new StringBuffer(levels * 3 + resource.length());
             for (int i = 0; i < levels; i++) {
                 b.append("../");
             }



Mime
View raw message