Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DEEAC3A09 for ; Thu, 28 Apr 2011 15:21:44 +0000 (UTC) Received: (qmail 92270 invoked by uid 500); 28 Apr 2011 15:21:44 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 92195 invoked by uid 500); 28 Apr 2011 15:21:44 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 92187 invoked by uid 99); 28 Apr 2011 15:21:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2011 15:21:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2011 15:21:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 366F7B8F8B for ; Thu, 28 Apr 2011 15:21:03 +0000 (UTC) Date: Thu, 28 Apr 2011 15:21:03 +0000 (UTC) From: "Matt Benson (JIRA)" To: issues@commons.apache.org Message-ID: <1853968332.9176.1304004063219.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1102083875.73608.1303399685738.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LANG-696) Deprecate ClassUtils getShortClassName in favor of Class getSimpleName MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026341#comment-13026341 ] Matt Benson commented on LANG-696: ---------------------------------- +1; however I think either of "Map.Entry" or "Map$Entry" is actually more useful than "Entry". I propose: * eliminate redundancy by renaming {{getShortClassName()}} to {{getShortName()}}, returning simple name all the way up to top-level class * add {{getSimpleName()}} for null-safe pass-through to {{Class.getSimpleName()}} * document the difference between the two, with examples * smile > Deprecate ClassUtils getShortClassName in favor of Class getSimpleName > ---------------------------------------------------------------------- > > Key: LANG-696 > URL: https://issues.apache.org/jira/browse/LANG-696 > Project: Commons Lang > Issue Type: New Feature > Components: lang.* > Affects Versions: 2.6 > Reporter: Gary D. Gregory > Assignee: Gary D. Gregory > Fix For: 3.0 > > > Added two null-safe ClassUtils.getSimpleName() APIs. > ---------- Forwarded message ---------- > From: Gary Gregory > Date: Mon, Apr 11, 2011 at 10:18 AM > Subject: [Lang] ClassUtils getShortClassName != Class getSimpleName > To: Commons Developers List > Hi All: > Should we deprecate ClassUtils getShortClassName in favor of Class getSimpleName? > The behavior of getShortClassName is undocumented for arrays in the Javadoc and is different from getSimpleName. > When I replace the guts of getShortClassName to call getSimpleName, one test fails: > junit.framework.ComparisonFailure: null expected:<[ToStringStyleTest.]Person[name=John Q. ...> but was:<[]Person[name=John Q. ...> > at junit.framework.Assert.assertEquals(Assert.java:81) > at junit.framework.Assert.assertEquals(Assert.java:87) > at org.apache.commons.lang3.builder.ShortPrefixToStringStyleTest.testPerson(ShortPrefixToStringStyleTest.java:86) > For now, I've made a note in the Javdoc to consider using getSimpleName. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira