Parent Directory | Revision Log | Patch
--- cocoon/trunk/src/java/org/apache/cocoon/util/NetUtils.java 2005/05/04 01:47:09 168042 +++ cocoon/trunk/src/java/org/apache/cocoon/util/NetUtils.java 2005/05/04 01:49:38 168043 @@ -270,7 +270,7 @@ public class NetUtils { 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 @@ public class NetUtils { 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("../"); }
infrastructure at apache.org | ViewVC Help |
Powered by ViewVC 1.1.26 |