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 2007/10/12 14:42:43 UTC

svn commit: r584149 - in /directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec: ./ actions/ add/ extended/operations/ modify/ search/

Author: elecharny
Date: Fri Oct 12 05:42:24 2007
New Revision: 584149

URL: http://svn.apache.org/viewvc?rev=584149&view=rev
Log:
Removed warnings by using generics

Modified:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequest.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java Fri Oct 12 05:42:24 2007
@@ -278,14 +278,14 @@
 
         if ( ( referrals != null ) && ( referrals.size() != 0 ) )
         {
-            Iterator referralIterator = referrals.iterator();
+            Iterator<LdapURL> referralIterator = referrals.iterator();
 
             referralsLength = 0;
 
             // Each referral
             while ( referralIterator.hasNext() )
             {
-                LdapURL referral = ( LdapURL ) referralIterator.next();
+                LdapURL referral = referralIterator.next();
 
                 referralsLength += 1 + TLV.getNbBytes( referral.getNbBytes() ) + referral.getNbBytes();
             }
@@ -338,11 +338,11 @@
             buffer.put( TLV.getBytes( referralsLength ) );
 
             // Each referral
-            Iterator referralIterator = referrals.iterator();
+            Iterator<LdapURL> referralIterator = referrals.iterator();
 
             while ( referralIterator.hasNext() )
             {
-                LdapURL referral = ( LdapURL ) referralIterator.next();
+                LdapURL referral = referralIterator.next();
 
                 // Ecode the current referral
                 Value.encode( buffer, referral.getBytes() );

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java Fri Oct 12 05:42:24 2007
@@ -370,12 +370,12 @@
         // Twix : ArrayList modifications -> Snickers : ArrayList mods
         if ( modifyRequest.getModifications() != null )
         {
-            Iterator modifications = modifyRequest.getModifications().iterator();
+            Iterator<ModificationItemImpl> modifications = modifyRequest.getModifications().iterator();
 
             // Loop through the modifications
             while ( modifications.hasNext() )
             {
-                snickersMessage.addModification( ( ModificationItemImpl ) modifications.next() );
+                snickersMessage.addModification( modifications.next() );
             }
         }
 
@@ -416,11 +416,11 @@
                 // Loop on all AND/OR children
                 if ( filtersSet != null )
                 {
-                    Iterator filters = filtersSet.iterator();
+                    Iterator<Filter> filters = filtersSet.iterator();
 
                     while ( filters.hasNext() )
                     {
-                        branch.addNode( transformFilter( ( Filter ) filters.next() ) );
+                        branch.addNode( transformFilter( filters.next() ) );
                     }
                 }
 
@@ -632,7 +632,7 @@
         // Twix : ArrayList attributes -> Snickers : ArrayList attributes
         if ( searchRequest.getAttributes() != null )
         {
-            NamingEnumeration attributes = searchRequest.getAttributes().getAll();
+            NamingEnumeration<?> attributes = searchRequest.getAttributes().getAll();
 
             if ( attributes != null )
             {
@@ -747,17 +747,17 @@
         }
 
         // Transform the controls, too
-        List twixControls = twixMessage.getControls();
+        List<org.apache.directory.shared.ldap.codec.Control> twixControls = twixMessage.getControls();
 
         if ( twixControls != null )
         {
-            Iterator controls = twixControls.iterator();
+            Iterator<org.apache.directory.shared.ldap.codec.Control> controls = 
+                twixControls.iterator();
 
             while ( controls.hasNext() )
             {
                 AbstractMutableControlImpl neutralControl = null;
-                final org.apache.directory.shared.ldap.codec.Control twixControl = 
-                    ( org.apache.directory.shared.ldap.codec.Control ) controls.next();
+                final org.apache.directory.shared.ldap.codec.Control twixControl = controls.next();
 
                 if ( twixControl.getControlValue() instanceof 
                     org.apache.directory.shared.ldap.codec.controls.CascadeControl )
@@ -861,12 +861,12 @@
 
         if ( snisckersReferrals != null )
         {
-            Iterator referrals = snisckersReferrals.getLdapUrls().iterator();
+            Iterator<String> referrals = snisckersReferrals.getLdapUrls().iterator();
             twixLdapResult.initReferrals();
 
             while ( referrals.hasNext() )
             {
-                String referral = ( String ) referrals.next();
+                String referral = referrals.next();
 
                 try
                 {
@@ -1112,11 +1112,11 @@
         // Loop on all referals
         if ( referrals != null )
         {
-            Collection urls = referrals.getLdapUrls();
+            Collection<String> urls = referrals.getLdapUrls();
 
             if ( urls != null )
             {
-                Iterator url = urls.iterator();
+                Iterator<String> url = urls.iterator();
 
                 while ( url.hasNext() )
                 {
@@ -1221,11 +1221,11 @@
      */
     private void transformControls( LdapMessage twixMessage, Message msg )
     {
-        Iterator list = msg.getControls().values().iterator();
+        Iterator<javax.naming.ldap.Control> list = msg.getControls().values().iterator();
         
         while ( list.hasNext() )
         {
-            javax.naming.ldap.Control control = ( javax.naming.ldap.Control ) list.next();
+            javax.naming.ldap.Control control = list.next();
             org.apache.directory.shared.ldap.codec.Control twixControl = new org.apache.directory.shared.ldap.codec.Control();
             twixMessage.addControl( twixControl );
             twixControl.setCriticality( control.isCritical() );

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java Fri Oct 12 05:42:24 2007
@@ -100,7 +100,7 @@
 
         if ( IS_DEBUG )
         {
-            Iterator urls = ldapResult.getReferrals().iterator();
+            Iterator<LdapURL> urls = ldapResult.getReferrals().iterator();
 
             StringBuffer sb = new StringBuffer();
             boolean isFirst = true;

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java Fri Oct 12 05:42:24 2007
@@ -243,7 +243,7 @@
 
         if ( ( attributes != null ) && ( attributes.size() != 0 ) )
         {
-            NamingEnumeration attributeIterator = attributes.getAll();
+            NamingEnumeration<? extends Attribute> attributeIterator = attributes.getAll();
             attributeLength = new LinkedList<Integer>();
             valuesLength = new LinkedList<Integer>();
 
@@ -261,7 +261,7 @@
                 // The values
                 try
                 {
-                    NamingEnumeration values = attribute.getAll();
+                    NamingEnumeration<?> values = attribute.getAll();
 
                     if ( values.hasMoreElements() )
                     {
@@ -362,7 +362,7 @@
             // The partial attribute list
             if ( ( attributes != null ) && ( attributes.size() != 0 ) )
             {
-                NamingEnumeration attributeIterator = attributes.getAll();
+                NamingEnumeration<? extends Attribute> attributeIterator = attributes.getAll();
                 int attributeNumber = 0;
 
                 // Compute the attributes length
@@ -385,7 +385,7 @@
 
                     try
                     {
-                        NamingEnumeration values = attribute.getAll();
+                        NamingEnumeration<?> values = attribute.getAll();
 
                         if ( values.hasMoreElements() )
                         {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java Fri Oct 12 05:42:24 2007
@@ -132,12 +132,12 @@
         {
             replicatedContextsLength = 0;
 
-            Iterator replicatedContextIterator = replicatedContexts.iterator();
+            Iterator<LdapURL> replicatedContextIterator = replicatedContexts.iterator();
 
             // We may have more than one reference.
             while ( replicatedContextIterator.hasNext() )
             {
-                int ldapUrlLength = ( ( LdapURL ) replicatedContextIterator.next() ).getNbBytes();
+                int ldapUrlLength = replicatedContextIterator.next().getNbBytes();
                 replicatedContextsLength += 1 + TLV.getNbBytes( ldapUrlLength ) + ldapUrlLength;
             }
 
@@ -181,12 +181,12 @@
             bb.put( UniversalTag.SEQUENCE_TAG );
             bb.put( TLV.getBytes( replicatedContextsLength ) );
 
-            Iterator replicatedContextIterator = replicatedContexts.iterator();
+            Iterator<LdapURL> replicatedContextIterator = replicatedContexts.iterator();
 
             // We may have more than one reference.
             while ( replicatedContextIterator.hasNext() )
             {
-                LdapURL url = ( LdapURL ) replicatedContextIterator.next();
+                LdapURL url = replicatedContextIterator.next();
                 Value.encode( bb, url.getBytes() );
             }
         }

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedure.java Fri Oct 12 05:42:24 2007
@@ -193,7 +193,7 @@
             paramTypeLength = new LinkedList<Integer>();
             paramValueLength = new LinkedList<Integer>();
             
-    		Iterator params = parameters.iterator();
+    		Iterator<StoredProcedureParameter> params = parameters.iterator();
     		
     		while ( params.hasNext() )
     		{
@@ -201,7 +201,7 @@
     			int localParamTypeLength = 0;
     			int localParamValueLength = 0;
     			
-    			StoredProcedureParameter spParam = (StoredProcedureParameter)params.next();
+    			StoredProcedureParameter spParam = params.next();
     			
     			localParamTypeLength = 1 + TLV.getNbBytes( spParam.type.length ) + spParam.type.length;
     			localParamValueLength = 1 + TLV.getNbBytes( spParam.value.length ) + spParam.value.length;
@@ -253,11 +253,11 @@
             if ( ( parameters != null ) && ( parameters.size() != 0 ) )
             {
             	int parameterNumber = 0;
-        		Iterator params = parameters.iterator();
+        		Iterator<StoredProcedureParameter> params = parameters.iterator();
         		
         		while ( params.hasNext() )
         		{
-        			StoredProcedureParameter spParam = (StoredProcedureParameter)params.next();
+        			StoredProcedureParameter spParam = params.next();
 
                     // The parameter sequence
                     bb.put( UniversalTag.SEQUENCE_TAG );
@@ -306,7 +306,7 @@
         {
             sb.append( "        Parameters\n" );
 
-            Iterator params = parameters.iterator();
+            Iterator<StoredProcedureParameter> params = parameters.iterator();
             int i = 1;
     		
     		while ( params.hasNext() )

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequest.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequest.java Fri Oct 12 05:42:24 2007
@@ -319,7 +319,7 @@
 
         if ( ( modifications != null ) && ( modifications.size() != 0 ) )
         {
-            Iterator modificationsIterator = modifications.iterator();
+            Iterator<ModificationItemImpl> modificationsIterator = modifications.iterator();
             modificationSequenceLength = new LinkedList<Integer>();
             modificationLength = new LinkedList<Integer>();
             valuesLength = new LinkedList<Integer>();
@@ -330,7 +330,7 @@
                 int localModificationSequenceLength = 1 + 1 + 1;
                 int localValuesLength = 0;
 
-                ModificationItemImpl modification = ( ModificationItemImpl ) modificationsIterator.next();
+                ModificationItemImpl modification = modificationsIterator.next();
 
                 // Modification length initialized with the type
                 int typeLength = modification.getAttribute().getID().length();
@@ -339,7 +339,7 @@
                 try
                 {
 
-                    NamingEnumeration values = modification.getAttribute().getAll();
+                    NamingEnumeration<?> values = modification.getAttribute().getAll();
 
                     // Get all the values
                     if ( values.hasMoreElements() )
@@ -442,13 +442,13 @@
             // The modifications list
             if ( ( modifications != null ) && ( modifications.size() != 0 ) )
             {
-                Iterator modificationIterator = modifications.iterator();
+                Iterator<ModificationItemImpl> modificationIterator = modifications.iterator();
                 int modificationNumber = 0;
 
                 // Compute the modifications length
                 while ( modificationIterator.hasNext() )
                 {
-                    ModificationItemImpl modification = ( ModificationItemImpl ) modificationIterator.next();
+                    ModificationItemImpl modification = modificationIterator.next();
 
                     // The modification sequence
                     buffer.put( UniversalTag.SEQUENCE_TAG );
@@ -492,7 +492,7 @@
 
                     try
                     {
-                        NamingEnumeration values = modification.getAttribute().getAll();
+                        NamingEnumeration<?> values = modification.getAttribute().getAll();
 
                         if ( values.hasMoreElements() )
                         {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java Fri Oct 12 05:42:24 2007
@@ -109,11 +109,11 @@
 
         if ( ( filterSet != null ) && ( filterSet.size() != 0 ) )
         {
-            Iterator filterIterator = filterSet.iterator();
+            Iterator<Filter> filterIterator = filterSet.iterator();
 
             while ( filterIterator.hasNext() )
             {
-                Filter filter = ( Filter ) filterIterator.next();
+                Filter filter = filterIterator.next();
 
                 connectorFilterLength += filter.computeLength();
             }
@@ -142,11 +142,11 @@
         // encode each filter
         if ( ( filterSet != null ) && ( filterSet.size() != 0 ) )
         {
-            Iterator filterIterator = filterSet.iterator();
+            Iterator<Filter> filterIterator = filterSet.iterator();
 
             while ( filterIterator.hasNext() )
             {
-                Filter filter = ( Filter ) filterIterator.next();
+                Filter filter = filterIterator.next();
 
                 filter.encode( buffer );
             }

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java Fri Oct 12 05:42:24 2007
@@ -492,12 +492,12 @@
 
         if ( ( attributes != null ) && ( attributes.size() != 0 ) )
         {
-            NamingEnumeration attributeIterator = attributes.getAll();
+            NamingEnumeration<? extends Attribute> attributeIterator = attributes.getAll();
 
             // Compute the attributes length
             while ( attributeIterator.hasMoreElements() )
             {
-                Attribute attribute = ( AttributeImpl ) attributeIterator.nextElement();
+                Attribute attribute = attributeIterator.nextElement();
 
                 // add the attribute length to the attributes length
                 try
@@ -586,7 +586,7 @@
 
             if ( ( attributes != null ) && ( attributes.size() != 0 ) )
             {
-                NamingEnumeration attributeIterator = attributes.getAll();
+                NamingEnumeration<? extends Attribute> attributeIterator = attributes.getAll();
 
                 // encode each attribute
                 while ( attributeIterator.hasMoreElements() )
@@ -633,14 +633,14 @@
 
         if ( attributes != null )
         {
-            NamingEnumeration attrs = attributes.getAll();
+            NamingEnumeration<? extends Attribute> attrs = attributes.getAll();
             boolean isFirst = true;
     
             if ( attrs != null )
             {
                 while ( attrs.hasMoreElements() )
                 {
-                    Attribute attr = ( AttributeImpl ) attrs.nextElement();
+                    Attribute attr = attrs.nextElement();
         
                     if ( isFirst )
                     {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java Fri Oct 12 05:42:24 2007
@@ -238,7 +238,7 @@
 
         if ( ( partialAttributeList != null ) && ( partialAttributeList.size() != 0 ) )
         {
-            NamingEnumeration attributes = partialAttributeList.getAll();
+            NamingEnumeration<? extends Attribute> attributes = partialAttributeList.getAll();
             attributeLength = new LinkedList<Integer>();
             valsLength = new LinkedList<Integer>();
 
@@ -259,7 +259,7 @@
                     // The values
                     try
                     {
-                        NamingEnumeration values = attribute.getAll();
+                        NamingEnumeration<?> values = attribute.getAll();
 
                         if ( values.hasMoreElements() )
                         {
@@ -372,7 +372,7 @@
             // The partial attribute list
             if ( ( partialAttributeList != null ) && ( partialAttributeList.size() != 0 ) )
             {
-                NamingEnumeration attributes = partialAttributeList.getAll();
+                NamingEnumeration<? extends Attribute> attributes = partialAttributeList.getAll();
                 int attributeNumber = 0;
 
                 // Compute the attributes length
@@ -397,7 +397,7 @@
                     {
                         try
                         {
-                            NamingEnumeration values = attribute.getAll();
+                            NamingEnumeration<?> values = attribute.getAll();
 
                             if ( values.hasMoreElements() )
                             {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java Fri Oct 12 05:42:24 2007
@@ -123,12 +123,12 @@
     {
         searchResultReferenceLength = 0;
 
-        Iterator referencesIterator = searchResultReferences.iterator();
+        Iterator<LdapURL> referencesIterator = searchResultReferences.iterator();
 
         // We may have more than one reference.
         while ( referencesIterator.hasNext() )
         {
-            int ldapUrlLength = ( ( LdapURL ) referencesIterator.next() ).getNbBytes();
+            int ldapUrlLength = referencesIterator.next().getNbBytes();
             searchResultReferenceLength += 1 + TLV.getNbBytes( ldapUrlLength ) + ldapUrlLength;
         }
 
@@ -162,12 +162,12 @@
             buffer.put( TLV.getBytes( searchResultReferenceLength ) );
 
             // The references. We must at least have one reference
-            Iterator referencesIterator = searchResultReferences.iterator();
+            Iterator<LdapURL> referencesIterator = searchResultReferences.iterator();
 
             // We may have more than one reference.
             while ( referencesIterator.hasNext() )
             {
-                LdapURL reference = ( ( LdapURL ) referencesIterator.next() );
+                LdapURL reference = referencesIterator.next();
 
                 // Encode the reference
                 Value.encode( buffer, reference.getString() );

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java?rev=584149&r1=584148&r2=584149&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java Fri Oct 12 05:42:24 2007
@@ -247,11 +247,11 @@
 
         if ( anySubstrings != null )
         {
-            Iterator anyIterator = anySubstrings.iterator();
+            Iterator<String> anyIterator = anySubstrings.iterator();
 
             while ( anyIterator.hasNext() )
             {
-                String any = ( String ) anyIterator.next();
+                String any = anyIterator.next();
                 int anyLength = StringTools.getBytesUtf8( any ).length; 
                 substringsFilterSequenceLength += 1 + TLV.getNbBytes( anyLength ) + anyLength;
             }
@@ -329,11 +329,11 @@
             // The any substrings
             if ( anySubstrings != null )
             {
-                Iterator anyIterator = anySubstrings.iterator();
+                Iterator<String> anyIterator = anySubstrings.iterator();
 
                 while ( anyIterator.hasNext() )
                 {
-                    String any = ( String ) anyIterator.next();
+                    String any = anyIterator.next();
                     byte[] anyBytes = StringTools.getBytesUtf8( any );
                     buffer.put( ( byte ) LdapConstants.SUBSTRINGS_FILTER_ANY_TAG );
                     buffer.put( TLV.getBytes( anyBytes.length ) );