commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier Pernet" <>
Subject [BeanUtils] Error-checking BeanUtils.copyProperties() using Levensthein distance
Date Tue, 21 Nov 2006 23:06:15 GMT

I'm considering using BeanUtils.copyProperties() to transfer data to
and from DTOs, in a Web application. But I'm afraid that this would be
quite error-prone, as misspelled property names would be ignored.
So, I thought of overriding the copyProperties() method by computing
the Levenshtein distance (implemented in Commons Lang) between
property names, and logging warnings when this goes below some
appropriate threshold. But that would obviously be much slower, and
would be used for testing only, probably.
What do you think of the idea ? Would you consider adding it to the
BeanUtils class ?

How do you cope with that in your applications ? I was quite surprised
by not finding anything about that on Google - there must be quite a
lot of bugs created this way.

Olivier Pernet

We are the knights who say
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq'|dc

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message