commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Inger, Matthew" <in...@Synygy.com>
Subject RE: [Bug 22692] - StringUtils.split ignores empty items
Date Fri, 14 Nov 2003 21:30:16 GMT
checking for more than 1 delimiter or quote character would most likely
slow the implementation down significantly, and i'm not
sure we would want to do that.  

The rest of the suggestions  could easily be implemented.

-----Original Message-----
From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
Sent: Friday, November 14, 2003 4:18 PM
To: Jakarta Commons Developers List
Subject: Re: [Bug 22692] - StringUtils.split ignores empty items


Thank you for your submission. The implementation looks to have the basics
of what is needed for a StringTokenizer replacement. My suggestions:

1) The implementation is perhaps a little too CSV focussed at present. For
example, by default I would expect settings similar to StringTokenizer,
splitting on whitespace.

2) There is no ability to suport multiple delimiters or multiple quote
tokens. Related to #2.

3) There seems to be no way to ignore null/empty strings (ie. not return
them)

4) The coding style doesn't match the rest of [lang], ie. curly brackets
most noticeably

5) Implement java.util.Iterator to gives extra flexibility. (no need to
implement remove()) Keep nextToken() of course!

6) Maybe add nextTokenAsBoolean(), nextTokenAsInt() to handle the most
common conversions when reading a known format file like CSV.

I definitely want to see a Tokenizer in [lang], and this looks like a good
start. (I suggest Tokenizer is a sufficiently good name). We also need to
ensure that it performs well!
Thanks
Stephen

----- Original Message -----
From: "Inger, Matthew" <inger@Synygy.com>
> FYI:  I have submitted the DelimitedTokenizer class.
> Could one of the committers please review this defect,
> and commit the new files I have uploaded?  Or, i'd be
> open to being a committer myself, and just checking it
> in using cvs.
>
>
> -----Original Message-----
> From: bugzilla@apache.org [mailto:bugzilla@apache.org]
> Sent: Wednesday, November 12, 2003 10:00 AM
> To: commons-dev@jakarta.apache.org
> Subject: DO NOT REPLY [Bug 22692] - StringUtils.split ignores empty
> items
>
>
> DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
> RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
> <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22692>.
> ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
> INSERTED IN THE BUG DATABASE.
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22692
>
> StringUtils.split ignores empty items
>
>
>
>
>
> ------- Additional Comments From mattinger@yahoo.com  2003-11-12 14:59
> -------
> The attachment uploaded at 14:56 supercedes the one uploaded at 13:20
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message