Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 76752 invoked from network); 3 Apr 2005 17:28:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Apr 2005 17:28:46 -0000 Received: (qmail 54048 invoked by uid 500); 3 Apr 2005 17:28:45 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 54026 invoked by uid 500); 3 Apr 2005 17:28:45 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 54012 invoked by uid 99); 3 Apr 2005 17:28:45 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 03 Apr 2005 10:28:45 -0700 Received: (qmail 75953 invoked by uid 65534); 3 Apr 2005 17:28:44 -0000 Message-ID: <20050403172844.75892.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Sun, 03 Apr 2005 17:28:44 -0000 Subject: svn commit: r159936 - directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapDNDecoder.java To: commits@directory.apache.org From: elecharny@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: elecharny Date: Sun Apr 3 10:28:43 2005 New Revision: 159936 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D159936 Log: Used a MutableString instead of a simple String. Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/co= dec/primitives/LdapDNDecoder.java Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/l= dap/codec/primitives/LdapDNDecoder.java URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/s= rc/java/org/apache/asn1/ldap/codec/primitives/LdapDNDecoder.java?view=3Ddif= f&r1=3D159935&r2=3D159936 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/co= dec/primitives/LdapDNDecoder.java (original) +++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/co= dec/primitives/LdapDNDecoder.java Sun Apr 3 10:28:43 2005 @@ -16,11 +16,11 @@ */ package org.apache.asn1.ldap.codec.primitives; =20 -import java.io.UnsupportedEncodingException; - import org.apache.asn1.ber.tlv.Value; import org.apache.asn1.ldap.codec.DecoderException; import org.apache.asn1.ldap.codec.utils.LdapDN; +import org.apache.asn1.util.MutableString; +import org.apache.asn1.util.pools.PoolManager; =20 =20 /** @@ -35,25 +35,14 @@ /** * Transform the byte array to a String. A check is done to insure that * it complies with RFC 2044. - *=20 + * + * @param pool The poolmanager that will allocate a MutableString * @param value The byte array to transform * @return A String that represent the LDAPString * @throws DecoderException If the byte array does not comply with RFC= 2044 */ - public static String parse( Value value ) throws DecoderException + public static MutableString parse( PoolManager pool, Value value ) thr= ows DecoderException { - try - { - byte[] data =3D value.getData(); - String text =3D new String(data, "UTF-8"); - char[] chars =3D new char[text.length()]; - text.getChars(0, data.length, chars, 0); -=09 - return LdapDN.parseDN( chars ); - } - catch (UnsupportedEncodingException uee) - { - throw new DecoderException("Error while decoding the string"); - } + return LdapDN.parseDN( pool, value.getData() ); } }