Feedback on the implementation of StringJoiner

Remi Forax forax at univ-mlv.fr
Thu Dec 13 01:37:44 PST 2012


Hi Henry,
if we don't change the implementation of StringJoiner now (see my mail 
about my inability to test the stream pipeline),
there are at least two things that can be changed in your current 
implementation.

All the static final String can be removed because the string are 
interned so there is no need to store then in a static fields.
Even if you think the code is more clear with that and you may be right, 
it's not a standard practice, the only code that does that is 
String.java (as far as I know).

You don't need the field 'somethingAdded' because you can test the 
length of the StringBuilder (value).

cheers,
Rémi



More information about the lambda-dev mailing list