directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r291604 - /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/MostSpecificProtectedItemFilter.java
Date Mon, 26 Sep 2005 12:16:03 GMT
Author: trustin
Date: Mon Sep 26 05:15:58 2005
New Revision: 291604

URL: http://svn.apache.org/viewcvs?rev=291604&view=rev
Log:
Removed unnecessary assertion code.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/MostSpecificProtectedItemFilter.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/MostSpecificProtectedItemFilter.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/MostSpecificProtectedItemFilter.java?rev=291604&r1=291603&r2=291604&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/MostSpecificProtectedItemFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/support/MostSpecificProtectedItemFilter.java
Mon Sep 26 05:15:58 2005
@@ -52,35 +52,21 @@
                 ProtectedItem item = ( ProtectedItem ) j.next();
                 if( item instanceof ProtectedItem.AttributeType )
                 {
-                    if( contains( attrId, ( ( ProtectedItem.AttributeType ) item ).iterator()
) )
-                    {
-                        filteredTuples.add( tuple );
-                        break;
-                    }
+                    filteredTuples.add( tuple );
+                    break;
                 }
                 else if( item instanceof ProtectedItem.AllAttributeValues )
                 {
-                    if( contains( attrId, ( ( ProtectedItem.AllAttributeValues ) item ).iterator()
) )
-                    {
-                        filteredTuples.add( tuple );
-                        break;
-                    }
+                    filteredTuples.add( tuple );
+                    break;
                 }
                 else if( item instanceof ProtectedItem.SelfValue )
                 {
-                    if( contains( attrId, ( ( ProtectedItem.SelfValue ) item ).iterator()
) )
-                    {
-                        filteredTuples.add( tuple );
-                        break;
-                    }
+                    filteredTuples.add( tuple );
+                    break;
                 }
                 else if( item instanceof ProtectedItem.AttributeValue )
                 {
-                    if( attrId == null || attrValue == null )
-                    {
-                        continue;
-                    }
-
                     filteredTuples.add( tuple );
                     break;
                 }
@@ -115,23 +101,5 @@
         }
         
         return tuples;
-    }
-    
-    private static boolean contains( Object needle, Iterator haystack )
-    {
-        if( needle == null )
-        {
-            return false;
-        }
-
-        while( haystack.hasNext() )
-        {
-            if( haystack.next().equals( needle ) )
-            {
-                return true;
-            }
-        }
-        
-        return false;
     }
 }



Mime
View raw message