directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r538684 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
Date Wed, 16 May 2007 19:00:48 GMT
Author: elecharny
Date: Wed May 16 12:00:47 2007
New Revision: 538684

URL: http://svn.apache.org/viewvc?view=rev&rev=538684
Log:
Fixed some Integer overflow (DIRSERVER-933)
Removed useless casts

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java?view=diff&rev=538684&r1=538683&r2=538684
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
Wed May 16 12:00:47 2007
@@ -170,7 +170,7 @@
         // Recursively create NamingEnumerations for each child expression node
         for ( int ii = 0; ii < childEnumerations.length; ii++ )
         {
-            childEnumerations[ii] = enumerate( ( ExprNode ) children.get( ii ) );
+            childEnumerations[ii] = enumerate( children.get( ii ) );
         }
 
         return new DisjunctionEnumeration( childEnumerations );
@@ -234,8 +234,8 @@
     private NamingEnumeration enumConj( final BranchNode node ) throws NamingException
     {
         int minIndex = 0;
-        int minValue = Integer.MAX_VALUE;
-        int value = Integer.MAX_VALUE;
+        long minValue = Long.MAX_VALUE;
+        long value = Long.MAX_VALUE;
 
         /*
          * We scan the child nodes of a branch node searching for the child
@@ -246,7 +246,7 @@
         final List<ExprNode> children = node.getChildren();
         for ( int ii = 0; ii < children.size(); ii++ )
         {
-            ExprNode child = ( ExprNode ) children.get( ii );
+            ExprNode child = children.get( ii );
             value = ( ( Long ) child.get( "count" ) ).intValue();
             minValue = Math.min( minValue, value );
 
@@ -257,14 +257,14 @@
         }
 
         // Once found we build the child enumeration & the wrapping enum
-        final ExprNode minChild = ( ExprNode ) children.get( minIndex );
+        final ExprNode minChild = children.get( minIndex );
         IndexAssertion assertion = new IndexAssertion()
         {
             public boolean assertCandidate( IndexRecord rec ) throws NamingException
             {
                 for ( int ii = 0; ii < children.size(); ii++ )
                 {
-                    ExprNode child = ( ExprNode ) children.get( ii );
+                    ExprNode child = children.get( ii );
 
                     // Skip the child (with min scan count) chosen for enum
                     if ( child == minChild )



Mime
View raw message