You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Arun Thomas <Ar...@solidusnetworks.com> on 2003/05/22 01:21:08 UTC

[beanutils] - PropertyUtils.copyProperties throws exceptions contrary to documentation

I'd added a bug to bugzilla with an item which Robert suggested I move to the mailing list.  Ergo, here's my attempt at doing that.  My last comment, and the link to the bug for anyone interested in providing additional input, are in the mail below.  In short, PropertyUtils.copyProperties is documented as throwing four exceptions for specific reasons.  As the bug report details, the method actually sometimes never throws the exception, or throws it for reasons which, according to the documentation, should map to a different one of the four exceptions.  

I'd appreciate any input that people might have regarding the changes I proposed.  As I noted in the bug, I'm more than willing to modify and provide a patch, but I want to make sure that I don't do anything too awkward.  

Cheers, 
-AMT

-----Original Message-----
From: bugzilla@apache.org [mailto:bugzilla@apache.org] 
Sent: Wednesday, May 21, 2003 4:14 PM
To: commons-dev@jakarta.apache.org
Subject: DO NOT REPLY [Bug 19781] - PropertyUtils.copyProperties throws exceptions contrary to documentation


DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19781>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19781

PropertyUtils.copyProperties throws exceptions contrary to documentation





------- Additional Comments From apacheBugzilla@AMammenT.cotse.net  2003-05-21 23:13 ------- Hmmm.... Maybe I will move this to the mailing list.

Regarding the above comment on item (C)....  Actually I know that BeanUtils is 
meant to handle types which don't quite match, while PropertyUtils is not 
supposed to address those at all.  Since this bug is really with respect to 
PropertyUtils, I think the reason for my original comment remains valid - it's 
strange to throw an exception in this case.  Note, my original statement was 
probably a bit stronger than I intended - certainly, if a property property 
getter returns a type that is assignment compatible with the type of setter 
argument, it would be good to continue, but otherwise....  (Further, as I 
understand it - having not looking in detail at BeanUtils, BeanUtils first 
applies a converter to properties which don't match prior to trying to copy 
them - at the point of copying, aren't they then correctly typed?)

Regarding the most recent comment....  I'm completely confused - as far as I 
can see, there isn't any copyProperty method in PropertyUtils.  Are we still 
talking the same issue?  

(Ooops - regarding the copyright.  I'll attach an uncopyrighted version of the 
test case - that was eclipse templates doing it's job and me forgetting to 
clean it up.)

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


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