Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 92714 invoked from network); 5 Jun 2008 19:54:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jun 2008 19:54:43 -0000 Received: (qmail 87643 invoked by uid 500); 5 Jun 2008 19:54:46 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 87576 invoked by uid 500); 5 Jun 2008 19:54:46 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 87562 invoked by uid 99); 5 Jun 2008 19:54:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 12:54:46 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 19:53:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id ED6C72388A1E; Thu, 5 Jun 2008 12:54:20 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: seelmann@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080605195420.ED6C72388A1E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 ) ); + } } } }