I'm a little confused. On a quick glance of the method ... it appears the
method setProperty should be returning true if it did something, and false
if not. This would mean the cast is not needed (actually wrong). The fact
that the method did NOT throw an exception should mean that we should return
true. So we end up with:

    setPropertyMethodBool.invoke(o, params);
    return true;

-Tim

On Wed, Oct 5, 2011 at 11:44 AM, <kkoli...@apache.org> wrote:

> Author: kkolinko
> Date: Wed Oct  5 15:44:58 2011
> New Revision: 1179274
>
> URL: http://svn.apache.org/viewvc?rev=1179274&view=rev
> Log:
> Resolve a warning about unboxing operation. Perform unboxing explicitly.
>
> Modified:
>    tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
>
> Modified: tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
> URL:
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java?rev=1179274&r1=1179273&r2=1179274&view=diff
>
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
> (original)
> +++ tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java Wed
> Oct  5 15:44:58 2011
> @@ -359,7 +359,8 @@ public final class IntrospectionUtils {
>                 params[1] = value;
>                 if (setPropertyMethodBool != null) {
>                     try {
> -                        return (Boolean) setPropertyMethodBool.invoke(o,
> params);
> +                        return ((Boolean) setPropertyMethodBool.invoke(o,
> +                                params)).booleanValue();
>                     }catch (IllegalArgumentException biae) {
>                         //the boolean method had the wrong
>                         //parameter types. lets try the other
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

Reply via email to