directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1692495 - /directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java
Date Fri, 24 Jul 2015 12:29:31 GMT
Author: elecharny
Date: Fri Jul 24 12:29:31 2015
New Revision: 1692495

URL: http://svn.apache.org/r1692495
Log:
o Don't use an iterator anymore, it's useless

Modified:
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java?rev=1692495&r1=1692494&r2=1692495&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java
Fri Jul 24 12:29:31 2015
@@ -386,15 +386,12 @@ public abstract class BrowserSelectionUt
         if ( selection instanceof IStructuredSelection )
         {
             IStructuredSelection structuredSelection = ( IStructuredSelection ) selection;
-            Iterator<?> it = structuredSelection.iterator();
             
-            while ( it.hasNext() )
+            for ( Object element : structuredSelection.toArray() )
             {
-                Object o = it.next();
-                
-                if ( type.isInstance( o ) )
+                if ( type.isInstance( element ) )
                 {
-                    list.add( o );
+                    list.add( element );
                 }
             }
         }



Mime
View raw message