commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [Lang] ClassUtils getShortClassName != Class getSimpleName
Date Thu, 21 Apr 2011 19:01:55 GMT
On Thu, Apr 21, 2011 at 2:38 PM, Henri Yandell <flamefew@gmail.com> wrote:

> On Thu, Apr 21, 2011 at 8:31 AM, Gary Gregory <garydgregory@gmail.com>
> wrote:
> > On Mon, Apr 11, 2011 at 7:19 PM, Henri Yandell <flamefew@gmail.com>
> wrote:
> >>
> >> On Mon, Apr 11, 2011 at 3:43 PM, Gary Gregory <garydgregory@gmail.com>
> >> wrote:
> >> > On Mon, Apr 11, 2011 at 4:26 PM, Henri Yandell <flamefew@gmail.com>
> >> > wrote:
> >> >>
> >> >> +1 to rename getShortClassName to getSimpleName; sitting on top of
> the
> >> >> JDK getSimpleName and providing null safety and whatever other
> >> >> features are needed (for example array encoding).
> >> >
> >> > You must mean deprecate getShortClassName (to remove in 4.0) and add
> >> > getSimpleName. Right?
> >>
> >> Nope. Remove getShortClassName and add getSimpleName. We're not
> >> released yet so we can (and should) still make backwards compat
> >> changes.
> >>
> >> Hen
> >
> > getShortClassName is in 2.6.
>
> So? It can be removed in 3.0 if it's pointless and replaced by
> getSimpleName.
>

Yes, that's true. I thought it would be polite to deprecate the method first
but I suppose there is no rule that says we have to do it that way.

I was just surprised by methods disappearing in WSS4J 1.6 from 1.5.x without
deprecation in 1.5.x.

Because major releases can break things, I now understand it is permitted to
do this kind of change.

We now two new methods:

org.apache.commons.lang3.ClassUtils.getSimpleName(Class<?>)
org.apache.commons.lang3.ClassUtils.getSimpleName(Object, String)

Which should replace:

getShortClassName(Class<?>)
getShortClassName(Object, String)

The question is, what do we do about:

org.apache.commons.lang3.ClassUtils.getShortClassName(String)

Changing the impl to call getSimpleName(Class<?>) with the result of
Class.forName() smells wrong.

Gary



Gary


>
> Hen
>



-- 
Thank you,
Gary

http://garygregory.wordpress.com/
http://garygregory.com/
http://people.apache.org/~ggregory/
http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message