From ad8075db9d1ed81528a069d446c27c7e2edbf1d9 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Mon, 11 Sep 2006 17:03:04 +0000
Subject: [PATCH] Implement a test suite for the LDIFReader class. Performed refactoring to reduce the amount of code duplication and improve the coupling between the LDIFReader class and the ChangeRecordEntry classes.
---
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java
index 0eff754..7e1996b 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java
@@ -49,6 +49,7 @@
import org.opends.server.protocols.ldap.LDAPException;
import org.opends.server.protocols.ldap.LDAPFilter;
import org.opends.server.protocols.ldap.LDAPMessage;
+import org.opends.server.protocols.ldap.LDAPModification;
import org.opends.server.protocols.ldap.ModifyRequestProtocolOp;
import org.opends.server.protocols.ldap.ModifyResponseProtocolOp;
import org.opends.server.protocols.ldap.ModifyDNRequestProtocolOp;
@@ -236,7 +237,7 @@
case ADD:
operationType = "ADD";
AddChangeRecordEntry addEntry = (AddChangeRecordEntry) entry;
- ArrayList<Attribute> attrs = addEntry.getAttributes();
+ List<Attribute> attrs = addEntry.getAttributes();
ArrayList<LDAPAttribute> attributes =
new ArrayList<LDAPAttribute>(attrs.size());
for(Attribute a : attrs)
@@ -256,8 +257,9 @@
case MODIFY:
operationType = "MODIFY";
ModifyChangeRecordEntry modEntry = (ModifyChangeRecordEntry) entry;
- protocolOp = new ModifyRequestProtocolOp(asn1OctetStr,
- modEntry.getModifications());
+ ArrayList<LDAPModification> mods =
+ new ArrayList<LDAPModification>(modEntry.getModifications());
+ protocolOp = new ModifyRequestProtocolOp(asn1OctetStr, mods);
msgID = MSGID_PROCESSING_OPERATION;
System.out.println(getMessage(msgID, operationType, asn1OctetStr));
break;
--
Gitblit v1.10.0