commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder ToStringStyle.java
Date Thu, 14 Aug 2003 00:10:42 GMT
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
  
  
  

Mime
View raw message