directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r490755 - /directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/SearchManager.java
Date Thu, 28 Dec 2006 16:28:22 GMT
Author: elecharny
Date: Thu Dec 28 08:28:21 2006
New Revision: 490755

URL: http://svn.apache.org/viewvc?view=rev&rev=490755
Log:
Removed warnings

Modified:
    directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/SearchManager.java

Modified: directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/SearchManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/SearchManager.java?view=diff&rev=490755&r1=490754&r2=490755
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/SearchManager.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/SearchManager.java
Thu Dec 28 08:28:21 2006
@@ -23,13 +23,13 @@
 
 import java.io.Serializable;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.directory.ldapstudio.browser.core.events.EventRegistry;
 import org.apache.directory.ldapstudio.browser.core.events.SearchUpdateEvent;
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.core.model.ISearch;
+import org.eclipse.osgi.util.NLS;
 
 
 public class SearchManager implements Serializable
@@ -37,7 +37,7 @@
 
     private static final long serialVersionUID = 8665227628274097691L;
 
-    private List searchList;
+    private List<ISearch> searchList;
 
     private IConnection connection;
 
@@ -50,7 +50,7 @@
     public SearchManager( IConnection connection )
     {
         this.connection = connection;
-        this.searchList = new ArrayList();
+        this.searchList = new ArrayList<ISearch>();
     }
 
 
@@ -68,44 +68,46 @@
 
     public void addSearch( int index, ISearch search )
     {
-        if ( this.getSearch( search.getName() ) != null )
+        if ( getSearch( search.getName() ) != null )
         {
-            String newSearchName = BrowserCoreMessages.bind( BrowserCoreMessages.copy_n_of_s,
"", search.getName() ); //$NON-NLS-1$
+            String newSearchName = NLS.bind( BrowserCoreMessages.copy_n_of_s, "", search.getName()
); //$NON-NLS-1$
+            
             for ( int i = 2; this.getSearch( newSearchName ) != null; i++ )
             {
-                newSearchName = BrowserCoreMessages.bind( BrowserCoreMessages.copy_n_of_s,
i + " ", search.getName() ); //$NON-NLS-1$
+                newSearchName = NLS.bind( BrowserCoreMessages.copy_n_of_s, i + " ", search.getName()
); //$NON-NLS-1$
             }
+            
             search.setName( newSearchName );
         }
 
-        this.searchList.add( index, search );
+        searchList.add( index, search );
         EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search, SearchUpdateEvent.SEARCH_ADDED
), this );
     }
 
 
     public ISearch getSearch( String name )
     {
-        for ( Iterator it = this.searchList.iterator(); it.hasNext(); )
+        for ( ISearch search:searchList )
         {
-            ISearch search = ( ISearch ) it.next();
             if ( search.getName().equals( name ) )
             {
                 return search;
             }
         }
+        
         return null;
     }
 
 
     public int indexOf( ISearch search )
     {
-        return this.searchList.indexOf( search );
+        return searchList.indexOf( search );
     }
 
 
     public void removeSearch( ISearch search )
     {
-        this.searchList.remove( search );
+        searchList.remove( search );
         EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search, SearchUpdateEvent.SEARCH_REMOVED
), this );
     }
 
@@ -118,13 +120,13 @@
 
     public ISearch[] getSearches()
     {
-        return ( ISearch[] ) this.searchList.toArray( new ISearch[0] );
+        return searchList.toArray( new ISearch[0] );
     }
 
 
     public int getSearchCount()
     {
-        return this.searchList.size();
+        return searchList.size();
     }
 
 }



Mime
View raw message