cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject NetUtils / StringUtils / Tokenizer
Date Thu, 29 Apr 2004 00:48:48 GMT
After Cheche's bug report I had a look at NetUtils. Though Ugo fixed it 
with a quick fix, it does not really solve the problem as a test with 
the updated NetUtilsTestCase and the NetUtils before my latest commit 
can easily show.

My problem is that there are many problems in different places in the code:

1. o.a.commons.lang.StringUtils.split() behaves strange in that way that"", "/") return an empty String[]
o.a.coc.u.SU.split("", "/") returns String[] {""} which is what I would 
Also"/", "/") returns empty String[].
This means the iteration over the string array can never really work 
with o.a.commons.lang.StringUtils.

=> reverted that change.

2. our Tokenizer behaves strange in one case:

o.a.coc.u.SU.split("/", "/")
=> new Tokenizer("/", "/", false)
=> tokenizer.countTokens() = 2
=> but tokenizer.hasMoreTokens() returns true only once
=> leads to String[] {"", null} while it should be String[] {"", ""}

3. while the Tokenizer correctly works on "/../" the 
NetUtils.normalize() method has a problem with it:

result of split/tokenize: String[] {"", "..", ""}
result of normalize(): ""


View raw message