directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1445178 - /directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java
Date Tue, 12 Feb 2013 14:18:21 GMT
Author: kayyagari
Date: Tue Feb 12 14:18:21 2013
New Revision: 1445178

URL: http://svn.apache.org/r1445178
Log:
ignore unknown encryption types after logging a warning

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=1445178&r1=1445177&r2=1445178&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
Tue Feb 12 14:18:21 2013
@@ -580,15 +580,22 @@ public class ServiceBuilder
             return new EncryptionType[0];
         }
 
-        EncryptionType[] types = new EncryptionType[encryptionTypes.size()];
-        int pos = 0;
+        List<EncryptionType> types = new ArrayList<EncryptionType>();
 
         for ( String encryptionType : encryptionTypes )
         {
-            types[pos++] = EncryptionType.getByName( encryptionType );
+            EncryptionType et = EncryptionType.getByName( encryptionType );
+            if( et == EncryptionType.UNKNOWN )
+            {
+                LOG.warn( "Unknown encryption type {}", encryptionType );
+            }
+            else
+            {
+                types.add( et );
+            }
         }
 
-        return types;
+        return types.toArray(new EncryptionType[0]);
     }
 
 



Mime
View raw message