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 19781] - PropertyUtils.copyProperties throws exceptions contrary to documentation
Date Fri, 09 May 2003 17:37:46 GMT
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-09 17:37 -------
It appears, therefore, that an IllegalAccessException is never thrown, and 
that a NoSuchMethodException is only thrown when an IllegalAccess is 
attempted. My suggestions:

A) Modify so that the absense of an accessible method is treated like the 
absense of a method (e.g. the property is not retreived or updated).  Do NOT 
throw a NoSuchMethodException in this case.  

B) Add a try catch loop for the IllegalAccessException and the 
NoSuchMethodException.  After A, neither of these two exceptions will actually 
be thrown, so the catch is there just to prevent propagation of those declared 
errors.  The copyProperties method will no longer throw these errors.  

C) If a property of the same name but of different type exists on both beans, 
also treat the property as a non-copied property - it isn't the same unless it 
has the same type.  

Just suggestions....  I can make these changes and supply a patch if 
appropriate, but I'm not sure what other impacts this might have, so I'll wait 
before doing the work.

---------------------------------------------------------------------
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