From 9ddd1c3c61e88d6b0eaac1394b95f0fafa07a216 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 13 Jul 2015 09:59:22 +0000
Subject: [PATCH] Used CollectionUtils.newArrayList() and newLinkedList().
---
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java
index 53af3b0..77e1a18 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/EntryHistorical.java
@@ -27,6 +27,7 @@
package org.opends.server.replication.plugin;
import static org.opends.messages.ReplicationMessages.*;
+import static org.opends.server.util.CollectionUtils.*;
import java.util.*;
@@ -181,17 +182,14 @@
List<Modification> mods = modifyOperation.getModifications();
CSN modOpCSN = OperationContext.getCSN(modifyOperation);
- for (Iterator<Modification> modsIterator = mods.iterator();
- modsIterator.hasNext(); )
+ for (Iterator<Modification> it = mods.iterator(); it.hasNext(); )
{
- // Traverse the mods of this MOD operation
- Modification m = modsIterator.next();
+ Modification m = it.next();
// Read or create the attr historical for the attribute type and option
// contained in the mod
AttrHistorical attrHist = getOrCreateAttrHistorical(m);
-
- if (attrHist.replayOperation(modsIterator, modOpCSN, modifiedEntry, m))
+ if (attrHist.replayOperation(it, modOpCSN, modifiedEntry, m))
{
bConflict = true;
}
@@ -323,9 +321,7 @@
Attribute attr = Attributes.create(historicalAttrType, attrValue);
// Set the created attribute to the operation
- List<Attribute> attrList = new LinkedList<>();
- attrList.add(attr);
- addOperation.setAttribute(historicalAttrType, attrList);
+ addOperation.setAttribute(historicalAttrType, newLinkedList(attr));
}
/**
--
Gitblit v1.10.0