From 642ce9c35148314aa41a95af1e8609ae170b67fe Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 29 Apr 2016 07:25:58 +0000
Subject: [PATCH] Simplify AttributeBuilder API usage: - new AttributeBuilder(AttributeType, AttribueType.getNameOrOID()) => new AttributeBuilder(AttributeType) - new AttributeBuilder(DirectoryServer.getAttributeType(name)) => new AttributeBuilder(name)
---
opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
index 17abc64..516fa78 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
@@ -34,8 +34,16 @@
import org.opends.server.backends.task.TaskState;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.SchemaConfigManager;
-import org.opends.server.types.*;
+import org.opends.server.types.Attribute;
+import org.opends.server.types.AttributeBuilder;
+import org.opends.server.types.DirectoryException;
+import org.opends.server.types.Entry;
+import org.opends.server.types.InitializationException;
import org.opends.server.types.LockManager.DNLock;
+import org.opends.server.types.Modification;
+import org.opends.server.types.Operation;
+import org.opends.server.types.Privilege;
+import org.opends.server.types.Schema;
import static org.opends.messages.TaskMessages.*;
import static org.opends.server.config.ConfigConstants.*;
@@ -180,7 +188,7 @@
{
Attribute a = m.getAttribute();
AttributeType attrType = a.getAttributeDescription().getAttributeType();
- AttributeBuilder builder = new AttributeBuilder(attrType, attrType.getNameOrOID());
+ AttributeBuilder builder = new AttributeBuilder(attrType);
for (ByteString v : a)
{
String s = v.toString();
@@ -201,8 +209,7 @@
builder.add(s);
}
- mods.add(new Modification(m.getModificationType(), builder
- .toAttribute()));
+ mods.add(new Modification(m.getModificationType(), builder.toAttribute()));
}
}
catch (ConfigException | InitializationException e)
--
Gitblit v1.10.0