cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r168042 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/NetUtils.java
Date Wed, 04 May 2005 01:47:10 GMT
Author: antonio
Date: Tue May  3 18:47:09 2005
New Revision: 168042

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

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/NetUtils.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/NetUtils.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/NetUtils.java?rev=168042&r1=168041&r2=168042&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/NetUtils.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/NetUtils.java Tue May  3
18:47:09 2005
@@ -273,7 +273,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('/');
@@ -311,7 +311,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