directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r491287 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
Date Sat, 30 Dec 2006 18:38:54 GMT
Author: elecharny
Date: Sat Dec 30 10:38:53 2006
New Revision: 491287

URL: http://svn.apache.org/viewvc?view=rev&rev=491287
Log:
Fixed some potential NPE in 3 methods.

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java?view=diff&rev=491287&r1=491286&r2=491287
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
Sat Dec 30 10:38:53 2006
@@ -271,7 +271,7 @@
 
            String newNormName = sb.toString();
 
-           if ( normName != newNormName )
+           if ( ( normName ==  null ) || !normName.equals( newNormName ) )
            {
                bytes = StringTools.getBytesUtf8( newNormName );
                normName = newNormName;
@@ -441,7 +441,7 @@
    {
        int result = 17;
 
-       if ( ( rdns != null ) || ( rdns.size() == 0 ) )
+       if ( ( rdns != null ) && ( rdns.size() == 0 ) )
        {
            for ( Rdn rdn:rdns )
            {
@@ -588,6 +588,7 @@
                {
                    e.printStackTrace();
                    log.error( "Failed to parse RDN for name " + name.toString(), e );
+                   return false;
                }
 
                if ( nameRdn.compareTo( ldapRdn ) != 0 )



Mime
View raw message