mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
08.27.2010 abc393ac83897bdabff446a0ddf70a115029ca17
Fix for CR 6958527: SearchResultEntryImpl does not implement an equals method and thus does not respect Entry interface.

Since the SearchResultEntryImpl is just a wrapper on an Entry object, use the equals and hashCode methods of the Entry object to implement the equals and hashCode methods of SearchResultEntryImpl.
2 files modified
40 ■■■■■ changed files
sdk/src/org/opends/sdk/requests/AddRequestImpl.java 20 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/responses/SearchResultEntryImpl.java 20 ●●●●● patch | view | raw | blame | history
sdk/src/org/opends/sdk/requests/AddRequestImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2009-2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.requests;
@@ -333,4 +333,22 @@
    return this;
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public int hashCode()
  {
    return entry.hashCode();
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public boolean equals(final Object object)
  {
    return entry.equals(object);
  }
}
sdk/src/org/opends/sdk/responses/SearchResultEntryImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2009-2010 Sun Microsystems, Inc.
 */
package org.opends.sdk.responses;
@@ -321,4 +321,22 @@
    return this;
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public int hashCode()
  {
    return entry.hashCode();
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public boolean equals(final Object object)
  {
    return entry.equals(object);
  }
}