On Sun, 2 Feb 2003 dion@multitask.com.au wrote: > Date: Sun, 2 Feb 2003 19:32:42 +1100 > From: dion@multitask.com.au > Reply-To: Jakarta Commons Developers List > To: Jakarta Commons Developers List > Subject: Re: [beanutils] 1.6 release breaks Maven and Jelly > > Hi Craig, > > thanks for the help, > > "Craig R. McClanahan" wrote on 02/02/2003 06:19:28 > PM: > > > > I've been attempting to get Maven up to the bean utils 1.6 over the > last > > > day or so, and have a problem that seems to have happened between the > > > 1.6-dev snapshot we took on 28-11-2002 and the release that has the > > > following symptoms: > > > > > > It appears that a converter (or beanutils, I can't tell which yet), > which > > > previously 'correctly' set a property of type java.lang.Object from an > > > instance of java.io.File, now converts the File to a String and then > sets > > > the Object property. > > > > > > Does this sound familiar to anyone? > > > > > > > There have been quite a large number of changes to beanutils since > > November 28, but the case you are describing sounds like it might > > *possibly* be a case of using the incorrect method of BeanUtils to > perform > > conversions for you. > > > > Could you quote a snippet of the Maven code that seems to be doing the > > wrong conversion, or point me at it, so I can help you resolve this? > > Yep, > > it's in > jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/TagScript.java > line 275. > OK, it looks like the real problem is in o.a.c.beanutils.ConvertingWrapDynaBean -- which is using BeanUtils.setProperty() to perform the copy+conversion. Unfortunately, setProperty() is specifically designed to deal with String->Object conversions, because it was originally there to support parsing bean settings out of HTTP request parameters for BeanUtils.populate(). As the JavaDocs say, this is probably not the method you normally want to use. However, BeanUtils.copyProperty() is designed to perform general object->object conversions via ConvertUtils, and that sounds like what you really want. I just checked in a change to this -- could you try with CVS HEAD of beanutils, or wait for tonight's nightly? If that fixes the problem, we can probably do a 1.6.1 bugfix release (once I add some unit tests for this class). > > > > Any ideas on a workaround? > -- > dIon Gillard, Multitask Consulting > Blog: http://www.freeroller.net/page/dion/Weblog > Work: http://www.multitask.com.au > Craig --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org