[
https://issues.apache.org/jira/browse/LANG-696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory updated LANG-696:
---------------------------------
Summary: Update documentation and tests related to ClassUtils
getShortClassName and getSimpleName (was: Deprecate ClassUtils
getShortClassName in favor of Class getSimpleName)
> Update documentation and tests related to ClassUtils getShortClassName and
> 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
> Priority: Major
> Fix For: 3.10
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Added two null-safe ClassUtils.getSimpleName() APIs.
> ---------- Forwarded message ----------
> From: Gary Gregory <[email protected]>
> Date: Mon, Apr 11, 2011 at 10:18 AM
> Subject: [Lang] ClassUtils getShortClassName != Class getSimpleName
> To: Commons Developers List <[email protected]>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)