From bfe98e63238f46f62ddd44f57200a39ad974814e Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 10 May 2016 08:09:33 +0000
Subject: [PATCH] LinkeAttribute: added javadocs to multipleValues field

---
 opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java |   30 +++++++++++++-----------------
 1 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java b/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java
index 1f98183..e512270 100644
--- a/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java
+++ b/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java
@@ -25,7 +25,6 @@
 import java.util.NoSuchElementException;
 
 import org.forgerock.i18n.LocalizedIllegalArgumentException;
-
 import org.forgerock.util.Reject;
 
 /**
@@ -121,21 +120,18 @@
                 public void remove() {
                     if (attribute.pimpl != expectedImpl) {
                         throw new ConcurrentModificationException();
-                    } else {
-                        iterator.remove();
-
-                        // Resize if we have removed the second to last value.
-                        if (attribute.multipleValues != null
-                                && attribute.multipleValues.size() == 1) {
-                            resize(attribute);
-                            iterator = attribute.pimpl.iterator(attribute);
-                        }
-
-                        // Always update since we may change to single or zero
-                        // value
-                        // impl.
-                        expectedImpl = attribute.pimpl;
                     }
+                    iterator.remove();
+
+                    // Resize if we have removed the second to last value.
+                    if (attribute.multipleValues != null
+                            && attribute.multipleValues.size() == 1) {
+                        resize(attribute);
+                        iterator = attribute.pimpl.iterator(attribute);
+                    }
+
+                    // Always update since we may change to single or zero value impl.
+                    expectedImpl = attribute.pimpl;
                 }
 
             };
@@ -249,9 +245,8 @@
         ByteString firstValue(final LinkedAttribute attribute) {
             if (attribute.singleValue != null) {
                 return attribute.singleValue;
-            } else {
-                throw new NoSuchElementException();
             }
+            throw new NoSuchElementException();
         }
 
         @Override
@@ -433,6 +428,7 @@
     private static final ZeroValueImpl ZERO_VALUE_IMPL = new ZeroValueImpl();
 
     private final AttributeDescription attributeDescription;
+    /** Map of normalized values to raw values. */
     private Map<ByteString, ByteString> multipleValues;
     private ByteString normalizedSingleValue;
     private Impl pimpl = ZERO_VALUE_IMPL;

--
Gitblit v1.10.0