You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/11/13 01:05:59 UTC

svn commit: r474102 - /directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java

Author: elecharny
Date: Sun Nov 12 16:05:58 2006
New Revision: 474102

URL: http://svn.apache.org/viewvc?view=rev&rev=474102
Log:
Fixed warning by using generics

Modified:
    directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java

Modified: directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java?view=diff&rev=474102&r1=474101&r2=474102
==============================================================================
--- directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java (original)
+++ directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java Sun Nov 12 16:05:58 2006
@@ -23,7 +23,6 @@
 import java.io.Serializable;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 
@@ -55,16 +54,18 @@
      * @param authenticationLevel
      *            the level of authentication required to this item
      */
-    protected ACIItem(String identificationTag, int precedence, AuthenticationLevel authenticationLevel)
+    protected ACIItem( String identificationTag, int precedence, AuthenticationLevel authenticationLevel )
     {
         if ( identificationTag == null )
         {
             throw new NullPointerException( "identificationTag" );
         }
+        
         if ( precedence < 0 || precedence > 255 )
         {
             throw new IllegalArgumentException( "precedence: " + precedence );
         }
+        
         if ( authenticationLevel == null )
         {
             throw new NullPointerException( "authenticationLevel" );
@@ -114,13 +115,15 @@
      * Converts a set of {@link GrantAndDenial}s into a set of
      * {@link MicroOperation}s and returns it.
      */
-    protected static Set toMicroOperations( Set grantsAndDenials )
+    protected static Set<MicroOperation> toMicroOperations( Set<GrantAndDenial> grantsAndDenials )
     {
-        Set microOps = new HashSet();
-        for ( Iterator j = grantsAndDenials.iterator(); j.hasNext(); )
+        Set<MicroOperation> microOps = new HashSet<MicroOperation>();
+        
+        for ( GrantAndDenial grantsAndDenial:grantsAndDenials )
         {
-            microOps.add( ( ( GrantAndDenial ) j.next() ).getMicroOperation() );
+            microOps.add( grantsAndDenial.getMicroOperation() );
         }
+        
         return microOps;
     }
 }