commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: svn commit: r549986 - /jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java
Date Sat, 23 Jun 2007 03:20:54 GMT
On 6/23/07, Martin van den Bemt <mllist@mvdb.net> wrote:
> Noticed the call of toString() on a String during the huntdown of what in beanutils broke
the
> betwixt tests. (in the TestObjectStringConverters)
> The commit was a bit premature probably, although this is most (read most, so not all)
of the time
> faster that calling toString() on a String. Will revert it (after some sleep) if that
is what you
> are asking (code is more readable without the addition, agreed).

Sorry was grmupy earlier - I leave it up to you.

> Another questions (probably related to BEANUTILS-258) : The failing gump of betwixt is
related to
> the changes you made to ConvertUtilsBean.convert(Object). In beanutils 1.7 a default
lookup is done
> for the type String.class and in the new code this is just the case when no converter
can be found
> for the sourcetype, which makes the new beanutils code not a drop in replacement of the
old one and
> not backward compatible. I will see if I can run the beanutils 1.7 testcases against
trunk tomorrow
> (they should pass, or am I being simplistic here?)
>
> Was this breakage intended and what are your thoughts on how to handle this ?

I'm not familiar with betwixt - but I will look at this - hopefully
sometme this weekend.

Niall

>
> Mvgr,
> Martin
>
> Niall Pemberton wrote:
> > Is there a reason for this change? AFAIK calling toString() on a
> > String object just returns a reference to itself - so this just seems
> > to add clutter in my mind. Also there was discussion on this (i.e.
> > calling toString() on a String) for this very bit of code in the
> > following issue ticket - would have been nice to comment before
> > arbitarily making the change
> >
> > http://issues.apache.org/jira/browse/BEANUTILS-283
> >
> > Niall
> >
> > On 6/23/07, mvdb@apache.org <mvdb@apache.org> wrote:
> >> Author: mvdb
> >> Date: Fri Jun 22 17:58:02 2007
> >> New Revision: 549986
> >>
> >> URL: http://svn.apache.org/viewvc?view=rev&rev=549986
> >> Log:
> >> Prevent calling toString on a String.
> >>
> >> Modified:
> >>
> >> jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java
> >>
> >>
> >> Modified:
> >> jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java
> >>
> >> URL:
> >> http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java?view=diff&rev=549986&r1=549985&r2=549986
> >>
> >> ==============================================================================
> >>
> >> ---
> >> jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java
> >> (original)
> >> +++
> >> jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java
> >> Fri Jun 22 17:58:02 2007
> >> @@ -542,7 +542,8 @@
> >>              }
> >>              converted = converter.convert(targetType, value);
> >>          }
> >> -        if (targetType == String.class && converted != null) {
> >> +        if (targetType == String.class && converted != null &&
> >> +                !(converted instanceof String)) {
> >>              converted = converted.toString();
> >>          }
> >>          return converted;
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> >
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message