commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36208] - [beanutils] BeanUtils incorrectly determines class names for PropertyUtils.getPropertyDescriptors
Date Fri, 07 Oct 2005 22:25:11 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36208>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36208





------- Additional Comments From tomdz@apache.org  2005-10-08 00:25 -------
Instead of bashing Niall, please be a little bit more professional yourself and
check your source code sample before coming to conclusions. If you look closely,
you'll see the you invoke java.lang.Class.getName(). Now please, what could
BeanUtils possibly do about this name ?
The fact described by your sample is that your foo.class has an array property
whose component type is foobar. Now when you use something like (as Niall
pointed out):

(new foobar[0]).getClass().getName()

then you get the (ugly, you're right at that) [Lfoobar; thingie. This is the way
the Java VM specification defines how the class name for arrays has to look, and
there is nothing we can do about it except complaining with the VM people.

Btw, you should also be aware, that you cannot simply strip the [L and semicolon
away, because the property type is not foobar but foobar[] which is totally
different.
And you *can* use the "[Lfoobar;" string to create a new Class object (via
Class.forName or similar), but you obviously get the Class object for an array
of foobar instances, not the foobar Class object itself. But that's the correct
behaviour as after all the property type is "array of foobar", not "foobar".

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message