directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r663720 - /directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
Date Thu, 05 Jun 2008 19:54:20 GMT
Author: seelmann
Date: Thu Jun  5 12:54:20 2008
New Revision: 663720

URL: http://svn.apache.org/viewvc?rev=663720&view=rev
Log:
Fixed case where an attribute without any value is returned from JNDI

Modified:
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java?rev=663720&r1=663719&r2=663720&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
Thu Jun  5 12:54:20 2008
@@ -643,23 +643,26 @@
                 Attribute attribute = attributeEnumeration.next();
                 String attributeDescription = attribute.getID();
 
-                IAttribute studioAttribute = null;
-                if ( entry.getAttribute( attributeDescription ) == null )
+                if( attribute.getAll().hasMore() )
                 {
-                    studioAttribute = new org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute(
entry,
-                        attributeDescription );
-                    entry.addAttribute( studioAttribute );
-                }
-                else
-                {
-                    studioAttribute = entry.getAttribute( attributeDescription );
-                }
-
-                NamingEnumeration<?> valueEnumeration = attribute.getAll();
-                while ( valueEnumeration.hasMore() )
-                {
-                    Object value = valueEnumeration.next();
-                    studioAttribute.addValue( new Value( studioAttribute, value ) );
+                    IAttribute studioAttribute = null;
+                    if ( entry.getAttribute( attributeDescription ) == null )
+                    {
+                        studioAttribute = new org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute(
entry,
+                            attributeDescription );
+                        entry.addAttribute( studioAttribute );
+                    }
+                    else
+                    {
+                        studioAttribute = entry.getAttribute( attributeDescription );
+                    }
+    
+                    NamingEnumeration<?> valueEnumeration = attribute.getAll();
+                    while ( valueEnumeration.hasMore() )
+                    {
+                        Object value = valueEnumeration.next();
+                        studioAttribute.addValue( new Value( studioAttribute, value ) );
+                    }
                 }
             }
         }



Mime
View raw message