Feedback on the implementation of StringJoiner

Roel Spilker r.spilker at gmail.com
Wed Dec 12 12:27:09 PST 2012


Well, a lot of code was removed, what is in my opinion always a good thing.

Apart from the comments already mentioned, I have one other point. The
JavaDoc of length(), charAt(int) and subSequence(int, int) still define
their behavior as being equivalent to the same operation on the toString()
result. However, the class isn't final. I don't think it is a promise that
should be made, because it puts quite a burden on a subclass. My preferred
solution would be to make the class final. However, I don't know if that is
an option.

Roel



On Tue, Dec 11, 2012 at 9:54 AM, Stephen Colebourne <scolebourne at joda.org>wrote:

> On 10 December 2012 16:26, Henry Jen <henry.jen at oracle.com> wrote:
> > I am doing some changes to adapt your feedbacks and trying to have
> minimum but enough APIs, latest proposed can be found at
> >
> > http://cr.openjdk.java.net/~henryjen/lambda/StringJoiner.1/webrev/
>
> StringJoiner
> Line 61 example - missing bracket )
>
> First line of some method descriptions starts with lower case rather than
> upper.
>
> Line 260 exception not listed in Javadoc
>
> As a general rule, I would try very hard to return a String, not a
> CharSequence. Accepting a CharSequence on input is OK, but returning
> it gives very few guarantees to callers. Think Postels law.
>
> Stephen
>
>


More information about the lambda-dev mailing list