directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r940478 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java
Date Mon, 03 May 2010 15:07:20 GMT
Author: elecharny
Date: Mon May  3 15:07:20 2010
New Revision: 940478

URL: http://svn.apache.org/viewvc?rev=940478&view=rev
Log:
Removed the controls initialization out of the constructor, so it's done only once

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java?rev=940478&r1=940477&r2=940478&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java
Mon May  3 15:07:20 2010
@@ -76,20 +76,10 @@ public abstract class LdapMessageCodec e
     /** The controls sequence length */
     private int controlsSequenceLength;
 
-    private Map<String, Control> codecControls = new HashMap<String, Control>();
-
-
-    // ~ Constructors
-    // -------------------------------------------------------------------------------
-
-    /**
-     * Creates a new LdapMessage object.
-     */
-    public LdapMessageCodec()
+    private static Map<String, Control> codecControls = new HashMap<String, Control>();
+    
+    static
     {
-        super();
-        // We should not create this kind of object directly
-        
         // Initialize the different known Controls
         Control control = new PersistentSearchControl();
         codecControls.put( control.getOid(), control );
@@ -126,6 +116,19 @@ public abstract class LdapMessageCodec e
     }
 
 
+    // ~ Constructors
+    // -------------------------------------------------------------------------------
+
+    /**
+     * Creates a new LdapMessage object.
+     */
+    public LdapMessageCodec()
+    {
+        // We should not create this kind of object directly
+        super();
+    }
+
+
     // ~ Methods
     // ------------------------------------------------------------------------------------
 



Mime
View raw message