[cp-patches] Fix for Class.getSimpleName()

Sebastian Mancke s.mancke at tarent.de
Wed Apr 16 08:58:13 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Christian Thalinger schrieb:
> On Tue, 2008-04-15 at 23:28 +0200, Sebastian Mancke wrote:
>> Hi,
>>
>> attached is a fix for the method Class.getSimpleName(), together with a
>> small testcase. The old implementation failed on usual class names, as
>> well as on inner classes.
>>
>> Please comment/commit.
> 
> This reminds me of this patch:
> 
> http://www.mail-archive.com/classpath-patches@gnu.org/msg10378.html
> 
> And I think your changes will break it (but I haven't tested).

I saw this patch and think it broke the behaviour, because of the wrong
usage of fullName.lastIndexOf(".", pos): The pos argument, counted from
left makes no sense in this method.

Also, I think, that advancing 'pos', dependent on
Character.isDigit(fullName.charAt(pos)) make no sense, because we return
"" for anonymous classes already.

- --Sebastian


- --
tarent Gesellschaft für Softwareentwicklung und IT-Beratung mbH

Heilsbachstr. 24, 53123 Bonn    | Poststr. 4-5, 10178 Berlin
fon: +49(228) / 52675-0         | fon: +49(30) / 27594853
fax: +49(228) / 52675-25        | fax: +49(30) / 78709617
durchwahl: +49(228) / 52675-17  | mobil: +49(171) / 7673249

Geschäftsführer:
Boris Esser, Elmar Geese, Thomas Müller-Ackermann
HRB AG Bonn 5168
Ust-ID: DE122264941
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIBb+lsMJ2Yk81wE0RAjE8AJ9FsNX2ApT6kU3eZz3RLdYWFasZDACg9vhk
4aiBh4P6d5bce9jFqisJ5mU=
=aKq8
-----END PGP SIGNATURE-----



More information about the Classpath-patches mailing list