directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r767290 - /directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
Date Tue, 21 Apr 2009 20:59:37 GMT
Author: seelmann
Date: Tue Apr 21 20:59:36 2009
New Revision: 767290

URL: http://svn.apache.org/viewvc?rev=767290&view=rev
Log:
Use typed collection and foreach loop

Modified:
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java?rev=767290&r1=767289&r2=767290&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
Tue Apr 21 20:59:36 2009
@@ -25,12 +25,10 @@
 import java.beans.XMLEncoder;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.List;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 import java.util.Set;
@@ -257,18 +255,16 @@
     }
 
 
-    public static boolean containsIgnoreCase( Collection c, String s )
+    public static boolean containsIgnoreCase( Collection<String> c, String s )
     {
         if ( c == null || s == null )
         {
             return false;
         }
 
-        Iterator it = c.iterator();
-        while ( it.hasNext() )
+        for ( String string : c )
         {
-            Object o = it.next();
-            if ( o instanceof String && ( ( String ) o ).equalsIgnoreCase( s ) )
+            if ( string.equalsIgnoreCase( s ) )
             {
                 return true;
             }



Mime
View raw message