directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r178098 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapDN.java /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java
Date Tue, 24 May 2005 06:35:05 GMT
Author: elecharny
Date: Mon May 23 23:35:05 2005
New Revision: 178098

URL: http://svn.apache.org/viewcvs?rev=178098&view=rev
Log:
Suppressed the pooling mechanism

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapDN.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapDN.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapDN.java?rev=178098&r1=178097&r2=178098&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapDN.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapDN.java
Mon May 23 23:35:05 2005
@@ -20,9 +20,6 @@
 import org.apache.asn1.ldap.codec.utils.DNUtils;
 import org.apache.asn1.util.MutableString;
 import org.apache.asn1.util.StringUtils;
-import org.apache.asn1.util.pools.LocalPoolManager;
-import org.apache.asn1.util.pools.PoolException;
-import org.apache.asn1.util.pools.PoolManager;
 
 
 /**
@@ -462,12 +459,11 @@
      * <name-components>    ::= <spaces> <separator>
<spaces> <name-component> <name-components> | e
<br>
      * </p>
      * 
-     * @param pool The pool in which we will get a MutableSTring
      * @param bytes The byte buffer that contains the DN
      * @return A MutableString containing the DN. 
      * @exception A DecoderException is thrown if the buffer does not contains a valid DN.
      */
-    public static MutableString parseDN( PoolManager pool, byte[] bytes ) throws DecoderException
+    public static MutableString parseDN( byte[] bytes ) throws DecoderException
     {
 
         // <distinguishedName> ::= e
@@ -508,16 +504,9 @@
         
         int stringLength = StringUtils.countChars(bytes);
         
-        try 
-        {
-            MutableString string = (MutableString)(((LocalPoolManager)pool).allocateString(stringLength));
-            string.setData(bytes);
-            
-            return string;
-        }
-        catch (PoolException pe) 
-        {
-            throw new DecoderException("Cannot allocate a LdapDN");
-        }
+        MutableString string = new MutableString(stringLength);
+        string.setData(bytes);
+        
+        return string;
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java?rev=178098&r1=178097&r2=178098&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/primitives/LdapString.java
Mon May 23 23:35:05 2005
@@ -19,9 +19,6 @@
 import org.apache.asn1.DecoderException;
 import org.apache.asn1.util.MutableString;
 import org.apache.asn1.util.StringUtils;
-import org.apache.asn1.util.pools.LocalPoolManager;
-import org.apache.asn1.util.pools.PoolException;
-import org.apache.asn1.util.pools.PoolManager;
 
 /**
  * Decodes a LdapString, and checks that the character set used comply
@@ -38,13 +35,12 @@
      * Transform a byte array to a MutableString. The byte array contains
      * an UTF-8 representation of a String
      * 
-     * @param pool The pool in which we will get a MutableSTring
      * @param bytes The byte buffer that contains the LDAPSTRING
      * @return A MutableString containing the LDAPSTRING
      * 
      * @throws DecoderException If the byte array does not comply with RFC 2279
      */
-    public static MutableString parse( PoolManager pool, byte[] bytes ) throws DecoderException
+    public static MutableString parse( byte[] bytes ) throws DecoderException
     {
         if ( ( bytes == null ) || ( bytes.length == 0 ) )
         {
@@ -53,16 +49,9 @@
 
         int stringLength = StringUtils.countChars(bytes);
         
-        try 
-        {
-            MutableString string = (MutableString)(((LocalPoolManager)pool).allocateString(stringLength));
-            string.setData(bytes);
-            
-            return string;
-        }
-        catch (PoolException pe) 
-        {
-            throw new DecoderException("Cannot allocate a LdapString");
-        }
+        MutableString string = new MutableString(stringLength);
+        string.setData(bytes);
+        
+        return string;
     }
 }



Mime
View raw message