directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r583177 - in /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core: event/LeafEvaluator.java event/SubstringEvaluator.java partition/impl/btree/LeafEvaluator.java partition/impl/btree/SubstringEnumerator.java
Date Tue, 09 Oct 2007 14:14:03 GMT
Author: elecharny
Date: Tue Oct  9 07:14:02 2007
New Revision: 583177

URL: http://svn.apache.org/viewvc?rev=583177&view=rev
Log:
Injected the modifications which fix MR NPE  from trunk to bigbang

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java?rev=583177&r1=583176&r2=583177&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
Tue Oct  9 07:14:02 2007
@@ -341,14 +341,22 @@
             case ( EQUALITY_MATCH ):
                 mrule = type.getEquality();
                 break;
+                
             case ( SUBSTRING_MATCH ):
                 mrule = type.getSubstr();
                 break;
+                
             case ( ORDERING_MATCH ):
                 mrule = type.getOrdering();
                 break;
+                
             default:
                 throw new NamingException( "Unknown match type: " + matchType );
+        }
+
+        if ( ( mrule == null ) && ( matchType != EQUALITY_MATCH ) )
+        {
+            mrule = type.getEquality();
         }
 
         return mrule;

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java?rev=583177&r1=583176&r2=583177&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
Tue Oct  9 07:14:02 2007
@@ -33,6 +33,7 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 
 
@@ -72,7 +73,15 @@
         SubstringNode snode = (SubstringNode)node;
         String oid = oidRegistry.getOid( snode.getAttribute() );
         AttributeType type = attributeTypeRegistry.lookup( oid );
-        Normalizer normalizer = type.getSubstr().getNormalizer();
+        MatchingRule matchingRule = type.getSubstr();
+        
+        if ( matchingRule == null )
+        {
+            matchingRule = type.getEquality();
+        }
+        
+        Normalizer normalizer = matchingRule.getNormalizer();
+        
 
         // get the attribute
         Attribute attr = entry.get( snode.getAttribute() );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java?rev=583177&r1=583176&r2=583177&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
Tue Oct  9 07:14:02 2007
@@ -346,7 +346,6 @@
             // this attribute type : as the AT was indexed, we
             // have a direct access to the entry.
             if ( idx.hasValue( attrId, rec.getEntryId() ) )
-                ;
             {
                 return true;
             }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java?rev=583177&r1=583176&r2=583177&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java
Tue Oct  9 07:14:02 2007
@@ -30,6 +30,7 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 
 
@@ -79,7 +80,15 @@
         Index idx = null;
         final SubstringNode snode = ( SubstringNode ) node;
         AttributeType type = attributeTypeRegistry.lookup( snode.getAttribute() );
-        Normalizer normalizer = type.getSubstr().getNormalizer();
+
+        MatchingRule matchingRule = type.getSubstr();
+
+        if ( matchingRule == null )
+        {
+            matchingRule = type.getEquality();
+        }
+        
+        Normalizer normalizer = matchingRule.getNormalizer();
 
         if ( db.hasUserIndexOn( snode.getAttribute() ) )
         {



Mime
View raw message