joerg 2004/04/28 17:20:53
Modified: src/java/org/apache/cocoon/util NetUtils.java
Log:
when using our StringUtils again for splitting we can revert the extra
handling for empty string and charAt(0) == '/'
Revision Changes Path
1.13 +2 -12 cocoon-2.1/src/java/org/apache/cocoon/util/NetUtils.java
Index: NetUtils.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/util/NetUtils.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- NetUtils.java 28 Apr 2004 22:14:19 -0000 1.12
+++ NetUtils.java 29 Apr 2004 00:20:53 -0000 1.13
@@ -321,10 +321,7 @@
* @return The normalized uri
*/
public static String normalize(String uri) {
- if ("".equals(uri)) {
- return uri;
- }
- String[] dirty = StringUtils.split(uri, '/');
+ String[] dirty = org.apache.cocoon.util.StringUtils.split(uri, "/");
int length = dirty.length;
String[] clean = new String[length];
@@ -357,13 +354,6 @@
}
StringBuffer b = new StringBuffer(uri.length());
-
- // Added this check to satisfy NetUtilsTestCase. I cannot ascertain
whether
- // this is correct or not, since the description of this method is
not very
- // clear. [Ugo Cei <[EMAIL PROTECTED]> 2004-04-19]
- if (uri.charAt(0) == '/') {
- b.append('/');
- }
for (int i = 0; (i < length) && (clean[i] != null); i++) {
b.append(clean[i]);