Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D835318500 for ; Thu, 5 Nov 2015 19:00:20 +0000 (UTC) Received: (qmail 77123 invoked by uid 500); 5 Nov 2015 19:00:20 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 77079 invoked by uid 500); 5 Nov 2015 19:00:20 -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 77069 invoked by uid 99); 5 Nov 2015 19:00:20 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2015 19:00:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 21BE5C4884 for ; Thu, 5 Nov 2015 19:00:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.99 X-Spam-Level: X-Spam-Status: No, score=0.99 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id GZDUL9fsqtNU for ; Thu, 5 Nov 2015 19:00:19 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 736F9206E8 for ; Thu, 5 Nov 2015 19:00:18 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 408F0E0044 for ; Thu, 5 Nov 2015 19:00:17 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 118923A0909 for ; Thu, 5 Nov 2015 19:00:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1712847 - /directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java Date: Thu, 05 Nov 2015 19:00:16 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151105190017.118923A0909@svn01-us-west.apache.org> Author: elecharny Date: Thu Nov 5 19:00:16 2015 New Revision: 1712847 URL: http://svn.apache.org/viewvc?rev=1712847&view=rev Log: o Fixed the DbIndex parsing (some index types weren't even read, the default index's type was ignored) Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java?rev=1712847&r1=1712846&r2=1712847&view=diff ============================================================================== --- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java (original) +++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java Thu Nov 5 19:00:16 2015 @@ -96,6 +96,7 @@ public class DbIndexWrapper implements C if ( "default".equalsIgnoreCase( attrStr ) ) { isDefault = true; + startPos = pos + 1; break; } @@ -113,7 +114,7 @@ public class DbIndexWrapper implements C } } - // If the 'default' special attribute si presetn, we can discard all the other attributes + // If the 'default' special attribute is present, we can discard all the other attributes if ( isDefault ) { attributes.clear(); @@ -136,11 +137,7 @@ public class DbIndexWrapper implements C // Check if we have this indexType DbIndexTypeEnum indexType = DbIndexTypeEnum.getIndexType( indexTypeName ); - if ( indexType == DbIndexTypeEnum.NONE ) - { - // This is an error, ignore it. - } - else + if ( indexType != DbIndexTypeEnum.NONE ) { indexTypes.add( indexType ); } @@ -148,6 +145,20 @@ public class DbIndexWrapper implements C startPos = pos + 1; } } + + if ( pos != startPos ) + { + // Search for the index type + String indexTypeName = indexStr.substring( startPos, pos ); + + // Check if we have this indexType + DbIndexTypeEnum indexType = DbIndexTypeEnum.getIndexType( indexTypeName ); + + if ( indexType != DbIndexTypeEnum.NONE ) + { + indexTypes.add( indexType ); + } + } } } @@ -296,12 +307,12 @@ public class DbIndexWrapper implements C { StringBuilder sb = new StringBuilder(); - // first, the Attribute, if it's not dafault + // first, the Attribute, if it's not default if ( isDefault ) { if ( indexTypes.size() == 0 ) { - // No types either ? retrun a blank String + // No types either ? return a blank String return ""; }