Re: More Struts Insanity

2008-03-05 Thread Dave Newton
--- Chris Pratt <[EMAIL PROTECTED]> wrote:
> Since they're both the same Class (though not the same instance) they
> definitely should be assignable, but Name implements Cloneable and
> Serializable, not Comparable so it shouldn't be calling compareTo.

You know, I'm looking at the OGNL source again and I'm not sure why I said
that stuff before. Probably because I've been up for 20 hours. I think I read
the code totally wrong.

That said, implementing Comparable fixed it for me with 2.6.11; I have the
source for 2.6.9 and it looks like it should work as it's written, but can't
get my Eclipse to cooperate with me at the moment and am unable to test under
2.6.9.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: More Struts Insanity

2008-03-05 Thread Chris Pratt
On Wed, Mar 5, 2008 at 10:20 PM, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- Chris Pratt <[EMAIL PROTECTED]> wrote:
>  > Notice that the last statement (using the OGNL == operator) doesn't
>  > return anything at all, which makes it useless in a  test.
>
>  OGNL actually checks for isAssignableFrom; if either class isAssignableFrom
>  the other it checks for Comparable and calls compareTo, which is most likely
>  what's happening in your case. Only if neither class isAssignableFrom will it
>  call the instance's equals method.
>

Since they're both the same Class (though not the same instance) they
definitely should be assignable, but Name implements Cloneable and
Serializable, not Comparable so it shouldn't be calling compareTo.
  (*Chris*)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: More Struts Insanity

2008-03-05 Thread Dave Newton
--- Chris Pratt <[EMAIL PROTECTED]> wrote:
> Notice that the last statement (using the OGNL == operator) doesn't
> return anything at all, which makes it useless in a  test.

OGNL actually checks for isAssignableFrom; if either class isAssignableFrom
the other it checks for Comparable and calls compareTo, which is most likely
what's happening in your case. Only if neither class isAssignableFrom will it
call the instance's equals method.

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]