Andre van Toly wrote:- return StringSplitter.split(getString(tag)); + // return StringSplitter.split(getString(tag)); + return Arrays.asList(getString(tag).split(","));
I tested it with some of my taglib templates and did not ran in any trouble.
Are you sure that is actually the same? IIRC StringSplitter will also 'trim' its elements. In other words "a, b, c" became ["a", "b", "c"] and now it will become ["a", " b", " c"] which is a different thing.
But then it would not be forbidden to code something like: <mm:list nodes="a, b ,c " ...> Can that be correct in your templates?
It should perhaps be split("\s*,\s*") then or so.
Sounds a bit silly, imho. But when spaces are not strictly disallowed, ... or maybe we should force them to be.
Indeed String.split is new in java 1.4, and StringSplitter was originally implemented with StringTokenizer (which was a bit cumbersome, and therefore someone came up with this StringSplitter util). I remember the introduction of 'split' in the implementaiont of StringSplitter, it caused that that "" becamee the list with one empty element rather then the empty list, which one on or two spot also gave surprizing results. It seems such a trivial task, isn't it :-)
Yep.
---Andr� -- Andr� van Toly http://www.toly.nl mobile +31(0)627233562 ------------------------------------------------------------------>><<-- _______________________________________________ Developers mailing list [email protected] http://lists.mmbase.org/mailman/listinfo/developers
