From 887e246785056b972a725b5ef8457980325216fb Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Fri, 22 Oct 2010 07:03:51 +0000
Subject: [PATCH] Sync commits from boli Added unmodifiable and copyOf response factories. Made LinkedHashMapEntry copy constructor perform a deep copy of attributes.

---
 sdk/src/org/opends/sdk/responses/PasswordModifyExtendedResultImpl.java |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/sdk/src/org/opends/sdk/responses/PasswordModifyExtendedResultImpl.java b/sdk/src/org/opends/sdk/responses/PasswordModifyExtendedResultImpl.java
index 5a1e4a2..f7069cf 100644
--- a/sdk/src/org/opends/sdk/responses/PasswordModifyExtendedResultImpl.java
+++ b/sdk/src/org/opends/sdk/responses/PasswordModifyExtendedResultImpl.java
@@ -43,7 +43,7 @@
  * Password modify extended result implementation.
  */
 final class PasswordModifyExtendedResultImpl extends
-    AbstractExtendedResult<PasswordModifyExtendedResult> implements
+    AbstractExtendedResultImpl<PasswordModifyExtendedResult> implements
     PasswordModifyExtendedResult
 {
   private ByteString password;
@@ -52,7 +52,8 @@
    * The ASN.1 element type that will be used to encode the genPasswd component
    * in a password modify extended response.
    */
-  private static final byte TYPE_PASSWORD_MODIFY_GENERATED_PASSWORD = (byte) 0x80;
+  private static final byte TYPE_PASSWORD_MODIFY_GENERATED_PASSWORD =
+      (byte) 0x80;
 
 
 
@@ -65,6 +66,25 @@
 
 
   /**
+   * Creates a new password modify extended result that is an exact copy of the
+   * provided result.
+   *
+   * @param passwordModifyExtendedResult
+   *          The password modify extended result to be copied.
+   * @throws NullPointerException
+   *           If {@code passwordModifyExtendedResult} was {@code null} .
+   */
+  PasswordModifyExtendedResultImpl(
+      final PasswordModifyExtendedResult passwordModifyExtendedResult)
+      throws NullPointerException
+  {
+    super(passwordModifyExtendedResult);
+    this.password = passwordModifyExtendedResult.getGeneratedPassword();
+  }
+
+
+
+  /**
    * {@inheritDoc}
    */
   public ByteString getGeneratedPassword()
@@ -142,7 +162,7 @@
    * {@inheritDoc}
    */
   public PasswordModifyExtendedResult setGeneratedPassword(
-      final ByteString password)
+      final ByteString password) throws UnsupportedOperationException
   {
     this.password = password;
     return this;
@@ -153,7 +173,8 @@
   /**
    * {@inheritDoc}
    */
-  public PasswordModifyExtendedResult setGeneratedPassword(final String password)
+  public PasswordModifyExtendedResult setGeneratedPassword(
+      final String password) throws UnsupportedOperationException
   {
     this.password = (password != null) ? ByteString.valueOf(password) : null;
     return this;

--
Gitblit v1.10.0