On 2012/05/15 19:31:41, skybrian wrote:
More naive questions:

It seems like instead of having EntityProxy.equals() work in two
different ways,
we should inline AutoBeanUtils.diff() and simplify it to do exactly
what we want
for this case, without relying on Object.equals() if possible? We
don't care
what the diffs are and can return early as soon as we find one, so
AutoBeanUtils.diff() does too much work in any case. (And maybe we can
order the
comparisons to do the cheap ones first?)

I guess we could do it yes, though I'm nor sure it's that easy (re.
collections and ValueProxies).
It'd be more of an optimization thing (and AutoBeanUtils can be probably
be optimized a bit too) so how about simply adding a TODO for now? (as
I'm not sure that alternative will be done in time for 2.5)

This would get rid of the "diffing" flag and the spooky action at a
distance
based on a magic flag.

I also wonder if the equals() check is just a mistake. The beginning
of
AutoBeansUtils.diff() looks like this:

     // Fast check for comparing an object to itself
     if (a.equals(b)) {
       return Collections.emptyMap();
     }

If we wanted a "fast check", shouldn't this be a==b, not a.equals(b)?
I suppose
it was written assuming that a Category wouldn't be used to override
equals().

That's not our issue here (equals() is used when comparing property
values), but yes, I suppose that one's a mistake (and note that
sameOrEquals uses ==).

http://gwt-code-reviews.appspot.com/1601806/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to