ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service MultiSourceServiceManager.java
Date Mon, 18 Feb 2002 08:39:58 GMT
donaldp     02/02/18 00:39:58

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service
                        MultiSourceServiceManager.java
  Log:
  Move complex operations outside loop body
  
  Revision  Changes    Path
  1.2       +7 -5      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service/MultiSourceServiceManager.java
  
  Index: MultiSourceServiceManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service/MultiSourceServiceManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MultiSourceServiceManager.java	14 Feb 2002 02:03:25 -0000	1.1
  +++ MultiSourceServiceManager.java	18 Feb 2002 08:39:58 -0000	1.2
  @@ -16,7 +16,7 @@
    * {@link ServiceManager} objects.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.1 $ $Date: 2002/02/14 02:03:25 $
  + * @version $Revision: 1.2 $ $Date: 2002/02/18 08:39:58 $
    */
   public class MultiSourceServiceManager
       implements ServiceManager
  @@ -40,9 +40,10 @@
        *
        * @param serviceType The service interface.
        */
  -    public boolean hasService( Class serviceType )
  +    public boolean hasService( final Class serviceType )
       {
  -        for( int i = 0; i < m_sources.size(); i++ )
  +        final int size = m_sources.size();
  +        for( int i = 0; i < size; i++ )
           {
               final ServiceManager serviceManager = (ServiceManager)m_sources.get( i );
               if( serviceManager.hasService( serviceType ) )
  @@ -61,10 +62,11 @@
        *         implement the service interface.
        * @throws ServiceException If the service does not exist.
        */
  -    public Object getService( Class serviceType )
  +    public Object getService( final Class serviceType )
           throws ServiceException
       {
  -        for( int i = 0; i < m_sources.size(); i++ )
  +        final int size = m_sources.size();
  +        for( int i = 0; i < size; i++ )
           {
               final ServiceManager serviceManager = (ServiceManager)m_sources.get( i );
               if( serviceManager.hasService( serviceType ) )
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message