Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 89762 invoked from network); 25 Oct 2009 12:31:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Oct 2009 12:31:52 -0000 Received: (qmail 12162 invoked by uid 500); 25 Oct 2009 12:31:51 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 12027 invoked by uid 500); 25 Oct 2009 12:31:51 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 12017 invoked by uid 99); 25 Oct 2009 12:31:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Oct 2009 12:31:51 +0000 X-ASF-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.219.228 as permitted sender) Received: from [209.85.219.228] (HELO mail-ew0-f228.google.com) (209.85.219.228) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Oct 2009 12:31:48 +0000 Received: by ewy28 with SMTP id 28so4307297ewy.42 for ; Sun, 25 Oct 2009 05:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=4AAHTDwznma34j9iZUDOHJ6fZnZOltwd0d1AXpzBmo4=; b=utg/32Apj6+lvOp3VCDVdKYJmWybEuDnqqRelW8+OeAz/xwNrmNuIqXn+Te67zInr8 nFYukkGVCW0/MJ0aHBJFGxEg9ZI7x0MdavuLOcqBpsaSSTb8zciXasbsd5YmSQvZIFhN bRL61pPncATDRKrvROttceqoqkC2SYjvblAak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qHgK87grpO9L7nxaD46oS7bWDiV2pg0pT4drocuGhxHNMHzuygr9+xO6G/PvkAi4xU cfZSZiJ3AjsyXoRug5eB9DkUv+GGW6QESCfZZSrJqYSxBJuZHa/GWPM/W6EaHufSDrph gvnsdM9DD3Jrx+htPxsi9z332LkDCfjfXOdJo= MIME-Version: 1.0 Received: by 10.216.90.1 with SMTP id d1mr585132wef.136.1256473887655; Sun, 25 Oct 2009 05:31:27 -0700 (PDT) In-Reply-To: <4AE2F2F8.4000907@btopenworld.com> References: <20090515073303.0B8D623888A6@eris.apache.org> <4AE2F2F8.4000907@btopenworld.com> Date: Sun, 25 Oct 2009 12:31:27 +0000 Message-ID: <25aac9fc0910250531n790c2ab7x66877be33c24f35a@mail.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/ From: sebb To: Commons Developers List Content-Type: text/plain; charset=ISO-8859-1 On 24/10/2009, Stephen Colebourne 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 extends ToStringBuilder { > > > > > > > -public class ToStringBuilder { > > +public class ToStringBuilder { > > > > > > 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() > .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