directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1446146 - /directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java
Date Thu, 14 Feb 2013 12:47:22 GMT
Author: elecharny
Date: Thu Feb 14 12:47:22 2013
New Revision: 1446146

URL: http://svn.apache.org/r1446146
Log:
Another fix for DIRSERVER-1802 : we were creating an array which is too big when we remove
a disabled Authenticator, so we end with a null value in the array, which produces a NPE

Modified:
    directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java

Modified: directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java?rev=1446146&r1=1446145&r2=1446146&view=diff
==============================================================================
--- directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java
(original)
+++ directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java
Thu Feb 14 12:47:22 2013
@@ -535,18 +535,19 @@ public class ServiceBuilder
      */
     public static Authenticator[] createAuthenticators( List<AuthenticatorBean> list
) throws ConfigurationException
     {
-        Authenticator[] authenticators = new Authenticator[list.size()];
+        Set<Authenticator> authenticators = new HashSet<Authenticator>( list.size()
);
         int i = 0;
 
         for ( AuthenticatorBean authenticatorBean : list )
         {
             if ( authenticatorBean.isEnabled() )
             {
-                authenticators[i++] = createAuthenticator( authenticatorBean );
+                authenticators.add( createAuthenticator( authenticatorBean ) );
             }
         }
 
-        return authenticators;
+        return authenticators.toArray( new Authenticator[]
+            {} );
     }
 
 



Mime
View raw message