directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r923893 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap: message/ResultCodeEnum.java util/AttributeUtils.java
Date Tue, 16 Mar 2010 17:42:11 GMT
Author: elecharny
Date: Tue Mar 16 17:42:11 2010
New Revision: 923893

URL: http://svn.apache.org/viewvc?rev=923893&view=rev
Log:
Fixed the last exceptions

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java?rev=923893&r1=923892&r2=923893&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java
Tue Mar 16 17:42:11 2010
@@ -24,7 +24,11 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.directory.shared.ldap.codec.LdapEncoder;
+import javax.naming.CommunicationException;
+import javax.naming.LimitExceededException;
+import javax.naming.PartialResultException;
+import javax.naming.SizeLimitExceededException;
+
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
@@ -2365,7 +2369,7 @@ public enum ResultCodeEnum
             return ( ( LdapOperationException ) t ).getResultCode();
         }
 
-        if ( t instanceof LdapCommunicationException )
+        if ( t instanceof CommunicationException )
         {
             return ResultCodeEnum.PROTOCOL_ERROR;
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java?rev=923893&r1=923892&r2=923893&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
Tue Mar 16 17:42:11 2010
@@ -42,7 +42,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeTypeException;
-import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
@@ -284,9 +283,9 @@ public class AttributeUtils
                     }
                 }
             }
-            catch( LdapInvalidDnException e )
+            catch( NamingException e )
             {
-                throw new NamingException( e.getMessage() );
+                throw new LdapException( e.getMessage() );
             }
         }
         else
@@ -352,18 +351,25 @@ public class AttributeUtils
                 comparedBytes = compared.getBytes();
             }
 
-            for ( NamingEnumeration<?> values = attr.getAll(); values.hasMoreElements();
/**/)
+            try
             {
-                Object value = values.nextElement();
-
-                if ( value instanceof byte[] )
+                for ( NamingEnumeration<?> values = attr.getAll(); values.hasMoreElements();
/**/)
                 {
-                    if ( ArrayUtils.isEquals( comparedBytes, value ) )
+                    Object value = values.nextElement();
+    
+                    if ( value instanceof byte[] )
                     {
-                        return true;
+                        if ( ArrayUtils.isEquals( comparedBytes, value ) )
+                        {
+                            return true;
+                        }
                     }
                 }
             }
+            catch ( NamingException ne )
+            {
+                throw new LdapException( ne.getMessage() );
+            }
         }
 
         return false;



Mime
View raw message