RE: ObjectStore help ...

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed May 25 2005 - 15:30:59 EDT

  • Next message: Cris Daniluk: "Re: ObjectStore help ..."

    Talking about crappily formatted emails... :-)

    >> That sure e-mailed crappily. Here's a better (?) formatted version:
    >>
    >> Iterator currentIt = currentSnapshot.entrySet().iterator();
    >> while (currentIt.hasNext()) {
    > I think you got to the cause of it. byte[] inherits its "equals"
    > implementation from Object, thus it only does "==" type comparison.
    >
    > I guess we need to change Util.nullSafeEquals() to make it similar to
    > ObjectId.equals that does "deep" comparison of primitive arrays. The
    > question is how to do it without too much overhead as "nullSafeEquals"
    > is used all over the place.
    >
    > Andrus
    >
    >
    >> Map.Entry entry = (Map.Entry) currentIt.next();
    >> Object newValue = entry.getValue();
    >> Object oldValue = committedSnapshot.get(entry.getKey());
    >> if (!Util.nullSafeEquals(oldValue, newValue)) {
    >> return true;
    >> }
    >> }
    >>
    >> and:
    >>
    >> oldValue
    >> (byte[]) [0, 0, 0, 0, 0, 0, 0, 34, 89, 45, -9, 74]
    >> newValue
    >> (byte[]) [0, 0, 0, 0, 0, 0, 0, 34, 89, 45, -9, 74]
    >> oldValue.equals(newValue)
    >> (boolean) false
    >> newValue.equals(oldValue)
    >> (boolean) false



    This archive was generated by hypermail 2.0.0 : Wed May 25 2005 - 15:31:00 EDT