-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Bug in JDK Introspector.decapitalise
PostPosted: Mon Feb 02, 2004 7:40 pm 
Newbie

Joined: Mon Feb 02, 2004 7:20 pm
Posts: 2
There is a bug in the JDK method Introspector.decapitalise() which causes the getSetter and getGetter methods in BasicPropertyAccessor to fail in certain esoteric situations. Consider:

propertyName = ABcd
Introspector.decapitalise() returns "ABcd" but should return "aBcd"

This is because decapitalise() tries to return property names like URL as "URL" and not "uRL". However, to make this decision, it incorrectly just checks the first 2 characters of the property name to see if the are capitalised and in so doing misses the case described above.

There are only 3 places in Hibernate that call this JDK method - all are in BasicPropertyAccessor. I have fixed the decapitalise() method to remove the bug and have added this revised method to the BasicPropertyAccessor class.

Would the Hibernate project consider accepting this patch so that getSetter() and getGetter() work properly for all cases?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 7:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Probably this applies: http://www.hibernate.org/116.html#A30


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2004 2:10 am 
Newbie

Joined: Mon Feb 02, 2004 7:20 pm
Posts: 2
gloeglm wrote:


Thanks for your reply.
I saw this other message this after I had made my post and so realise that I asked a stupid question :-(
I just changed the property names as suggested and everything works.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2004 5:25 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Actually that is not a bug - it is simply how the spec want's it...more then one capital generates it all in capitals.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.