From 19df65dd04f8f3bd8f76bdf3e061a6d242ed3c69 Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Wed, 02 Oct 2013 14:39:39 +0000
Subject: [PATCH] Fix OPENDJ-176 - Use SLF4J for logging in the SDK Review CR-2404
---
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/ByteStringBuilder.java | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/ByteStringBuilder.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/ByteStringBuilder.java
index 7e6d643..6ee1c5b 100755
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/ByteStringBuilder.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/ByteStringBuilder.java
@@ -22,19 +22,17 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
- * Portions copyright 2011-2012 ForgeRock AS
+ * Portions copyright 2011-2013 ForgeRock AS
*/
package org.forgerock.opendj.ldap;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
-import java.util.logging.Level;
-
-import com.forgerock.opendj.util.StaticUtils;
/**
* A mutable sequence of bytes backed by a byte array.
@@ -596,13 +594,9 @@
// There is a multi-byte char. Defer to JDK
try {
return append(s.getBytes("UTF-8"));
- } catch (final Exception e) {
- if (StaticUtils.DEBUG_LOG.isLoggable(Level.WARNING)) {
- StaticUtils.DEBUG_LOG.warning("Unable to encode String "
- + "to UTF-8 bytes: " + e.toString());
- }
-
- return append(s.getBytes());
+ } catch (final UnsupportedEncodingException e) {
+ // TODO: I18N
+ throw new RuntimeException("Unable to encode String '" + s + "' to UTF-8 bytes", e);
}
}
}
--
Gitblit v1.10.0