From 131d526b6ba303980d184fdb25187c51126f214a Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 19 Sep 2012 23:20:38 +0000
Subject: [PATCH] Fix for OPENDJ-597: Remove superfluous ByteString based constructors

---
 opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/AVA.java |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/AVA.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/AVA.java
index e738b90..e46452e 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/AVA.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/AVA.java
@@ -565,6 +565,9 @@
     /**
      * Creates a new attribute value assertion (AVA) using the provided
      * attribute type and value.
+     * <p>
+     * If {@code attributeValue} is not an instance of {@code ByteString} then
+     * it will be converted using the {@link ByteString#valueOf(Object)} method.
      *
      * @param attributeType
      *            The attribute type.
@@ -574,11 +577,11 @@
      *             If {@code attributeType} or {@code attributeValue} was
      *             {@code null}.
      */
-    public AVA(final AttributeType attributeType, final ByteString attributeValue) {
+    public AVA(final AttributeType attributeType, final Object attributeValue) {
         Validator.ensureNotNull(attributeType, attributeValue);
 
         this.attributeType = attributeType;
-        this.attributeValue = attributeValue;
+        this.attributeValue = ByteString.valueOf(attributeValue);
     }
 
     /**

--
Gitblit v1.10.0