Re: StringJoiner: detect or fix delimiter collision?

2014-02-06 Thread Philip Hodges
String is probably the most commonly used class in the whole of Java. Please please please do not pollute it with this dangerous new method. Your Java-is-cool example is ridiculously trivial, of no practical use whatsoever, and absolutely *not* cool. How about a proper test where you have to

Re: StringJoiner: detect or fix delimiter collision?

2014-01-31 Thread Ulf Zibis
Hi Philip, Am 27.01.2014 02:12, schrieb Philip Hodges: Please please please drop StringJoiner from Java 1.8 before it is too late. I have not seen any technical justifications whatsoever so far, just inexplicable enthusiasm. It is like giving young drivers a faster car with no seat belts.

Re: StringJoiner: detect or fix delimiter collision?

2014-01-30 Thread Philip Hodges
I did not predict that it would be a sprintf. It's not going to be consistently misused anything like so frequently. I compared it to the unescaped XML generation antipattern. I have not seen any technical justifications whatsoever so far, just inexplicable enthusiasm. It is like giving young

Re: StringJoiner: detect or fix delimiter collision?

2014-01-30 Thread Philip Hodges
Please please please drop StringJoiner from Java 1.8 before it is too late. It is not needed. It does not add value. It is an embarrassment. We did without it for years. It is not long long overdue. We do not need it now. It does not need to be in the very first Java 1.8 release. Try leaving it

Re: StringJoiner: detect or fix delimiter collision?

2014-01-30 Thread Henry Jen
On 01/27/2014 12:31 PM, Philip Hodges wrote: I did not predict that it would be a sprintf. It's not going to be consistently misused anything like so frequently. I compared it to the unescaped XML generation antipattern. I have not seen any technical justifications whatsoever so far, just

Re: StringJoiner: detect or fix delimiter collision?

2014-01-27 Thread Mike Duigou
On Jan 26 2014, at 17:12 , Philip Hodges philip.hod...@bluewin.ch wrote: Please please please drop StringJoiner from Java 1.8 before it is too late. It is well past too late. The API has been frozen since August for all but the most exceptional cases. At first I thought they were cool. Then

Re: StringJoiner: detect or fix delimiter collision?

2013-09-03 Thread Philip Hodges
I don't think my needs are in any way particular or unusual. This is the third attempt at a StringJoiner that has not stopped me having to roll my own. Arrays.toString and AbstractCollection.toString already meet logging needs and serve as simple useful examples for where people don't care

Re: StringJoiner: detect or fix delimiter collision?

2013-09-03 Thread Philip Hodges
Are we really going ahead with an implementation that: - checks even string literal parameters for null - does it again when String.join calls StringJoiner - makes defensive copies of just some of the arguments - creates a StringBuilder with only the default capacity People would be better off

Re: StringJoiner: detect or fix delimiter collision?

2013-08-31 Thread Mike Duigou
On Aug 30 2013, at 23:40 , Philip Hodges wrote: ... Why is there such a bandwagon rolling for this convenience feature? Perhaps others just don't agree with you. The choice of functionality offered in the JDK 8 StringJoiner was not arbitrary or haphazardly chosen. If it doesn't meet your

StringJoiner: detect or fix delimiter collision?

2013-07-23 Thread ph
didn't see delimiter collision mentioned anywhere - are you really offering an interface that only joins a list of entries without escaping or quoting or even checking for separators (or escape or quote sequences) that might occur in the entries? -- View this message in context:

Re: StringJoiner: detect or fix delimiter collision?

2013-07-23 Thread Mike Duigou
On Jul 23 2013, at 12:43 , ph wrote: didn't see delimiter collision mentioned anywhere - are you really offering an interface that only joins a list of entries without escaping or quoting or even checking for separators (or escape or quote sequences) that might occur in the entries?

Re: StringJoiner: detect or fix delimiter collision?

2013-07-23 Thread ph
The omission of that very complexity is a copious source of bugs that breaks applications in production, and is extremely useful and interesting to the black hat community. It should not be possible to call a joiner without escaping or quoting or catching an exception or explicitly waiving the

Re: StringJoiner: detect or fix delimiter collision?

2013-07-23 Thread Steven Schlansker
On Jul 23, 2013, at 1:37 PM, ph philip.hod...@bluewin.ch wrote: The omission of that very complexity is a copious source of bugs that breaks applications in production, and is extremely useful and interesting to the black hat community. It should not be possible to call a joiner without

Re: StringJoiner: detect or fix delimiter collision?

2013-07-23 Thread ph
Nothing against a simple joiner that forces users to catch or rule out a DelimiterCollisionException, and realise that simple is not good enough. Everything against a stupid joiner that silently assists users in creating bugs. Seems to work means not tested thoroughly. People will be tempted into

Re: StringJoiner: detect or fix delimiter collision?

2013-07-23 Thread Remi Forax
On 07/23/2013 11:57 PM, ph wrote: Nothing against a simple joiner that forces users to catch or rule out a DelimiterCollisionException, and realise that simple is not good enough. Everything against a stupid joiner that silently assists users in creating bugs. Seems to work means not tested