commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r775045 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/builder/ test/org/apache/commons/lang/builder/
Date Sun, 25 Oct 2009 12:31:27 GMT
On 24/10/2009, Stephen Colebourne <scolebourne@btopenworld.com> wrote:
> bayard@apache.org wrote:
>
> > URL: http://svn.apache.org/viewvc?rev=775045&view=rev
> > Log:
> > Genericizing per LANG-336. Removed two lines in the test that were trying
> to build a to string up to a class that was not in the hierarchy. The
> compiler now protects against this.
> >
>  >
>
> > -public class ReflectionToStringBuilder extends ToStringBuilder {
> > +public class ReflectionToStringBuilder<T> extends ToStringBuilder<T>
{
> >
>  >
>
> > -public class ToStringBuilder {
> > +public class ToStringBuilder<T> {
> >
> >
>
>  I think these gnerics are unecessary and provide insufficient benefit.

I'm inclined to agree.

The same applies even more to StrLookup, whose Javadoc says:

"Lookup a String key to a String value."

Why does that need generification?

>  The use case for ToStringBuilder is a quick and easy way to produce a
> toString. Users shouldn't have to manually specify the class that they are
> building the toString for. Compare today vs generics:
>
>  new ToStringBuilder()
>   .append(.......)
>   .toString();
>
>  new ToStringBuilder<Person>()
>   .append(.......)
>   .toString();
>
>  The issue of blocking the input specifying an invalid super class can be
> handled by method level generics on the static factory and constructor, plus
> a safety runtime check in setUpToClass().
>
>  Stephen
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  For additional commands, e-mail: dev-help@commons.apache.org
>
>

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


Mime
View raw message