Return-Path: Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 41876 invoked by uid 500); 14 Aug 2003 00:10:27 -0000 Received: (qmail 41872 invoked from network); 14 Aug 2003 00:10:27 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 14 Aug 2003 00:10:27 -0000 Received: (qmail 92942 invoked by uid 1529); 14 Aug 2003 00:10:42 -0000 Date: 14 Aug 2003 00:10:42 -0000 Message-ID: <20030814001042.92941.qmail@minotaur.apache.org> From: scolebourne@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder ToStringStyle.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N scolebourne 2003/08/13 17:10:42 Modified: lang/src/java/org/apache/commons/lang/builder ToStringStyle.java Log: Use ClassUtils to get the short class name suggested by Pete Gieser Revision Changes Path 1.22 +3 -7 jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ToStringStyle.java Index: ToStringStyle.java =================================================================== RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ToStringStyle.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ToStringStyle.java 25 Jul 2003 23:04:24 -0000 1.21 +++ ToStringStyle.java 14 Aug 2003 00:10:42 -0000 1.22 @@ -58,6 +58,7 @@ import java.util.Collection; import java.util.Map; +import org.apache.commons.lang.ClassUtils; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.SystemUtils; @@ -1426,12 +1427,7 @@ * @return the short name */ protected String getShortClassName(Class cls) { - String name = cls.getName(); - int pos = name.lastIndexOf('.'); - if (pos == -1) { - return name; - } - return name.substring(pos + 1); + return ClassUtils.getShortClassName(cls); } // Setters and getters for the customizable parts of the style