commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <>
Subject Re: svn commit: r775045 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/builder/ test/org/apache/commons/lang/builder/
Date Sat, 24 Oct 2009 12:28:40 GMT wrote:
> URL:
> 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.

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()

new ToStringBuilder<Person>()

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().


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message