avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application BlockResourceProvider.java
Date Tue, 01 Oct 2002 09:34:35 GMT
donaldp     2002/10/01 02:34:35

  Modified:    src/java/org/apache/avalon/phoenix/components/application
                        BlockResourceProvider.java
  Log:
  Only doubly place component in serviceMap if the type name equals the role name and the
type is an array.
  
  Revision  Changes    Path
  1.10      +18 -15    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockResourceProvider.java
  
  Index: BlockResourceProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockResourceProvider.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BlockResourceProvider.java	1 Oct 2002 07:50:56 -0000	1.9
  +++ BlockResourceProvider.java	1 Oct 2002 09:34:35 -0000	1.10
  @@ -143,11 +143,11 @@
           final Iterator iterator = serviceMap.keySet().iterator();
           while( iterator.hasNext() )
           {
  -            final String key = (String) iterator.next();
  +            final String key = (String)iterator.next();
               final Object value = serviceMap.get( key );
               if( value instanceof Component )
               {
  -                manager.put( key, (Component) value );
  +                manager.put( key, (Component)value );
               }
               else
               {
  @@ -182,7 +182,7 @@
           final Iterator iterator = serviceMap.keySet().iterator();
           while( iterator.hasNext() )
           {
  -            final String key = (String) iterator.next();
  +            final String key = (String)iterator.next();
               final Object value = serviceMap.get( key );
               manager.put( key, value );
           }
  @@ -212,7 +212,7 @@
               final ServiceDescriptor service = candidate.getService();
               if( service.isArray() )
               {
  -                ArrayList list = (ArrayList) sets.get( key );
  +                ArrayList list = (ArrayList)sets.get( key );
                   if( null == list )
                   {
                       list = new ArrayList();
  @@ -223,7 +223,7 @@
               }
               else if( service.isMap() )
               {
  -                HashMap smap = (HashMap) sets.get( key );
  +                HashMap smap = (HashMap)sets.get( key );
                   if( null == smap )
                   {
                       smap = new HashMap();
  @@ -241,25 +241,28 @@
           final Iterator iterator = sets.keySet().iterator();
           while( iterator.hasNext() )
           {
  -            final String key = (String) iterator.next();
  +            final String key = (String)iterator.next();
               final Object value = sets.get( key );
               if( value instanceof List )
               {
  -                final List list = (List) value;
  +                final List list = (List)value;
                   final ServiceDescriptor service =
                       metaData.getBlockInfo().getDependency( key ).getService();
   
  -                final String classname =
  -                    "[L" + service.getComponentType() + ";";
  -
                   final Object[] result = toArray( list, service.getComponentType() );
                   map.put( key, result );
  -                map.put( classname, result );
  +
  +                if( key.equals( service.getName() ) )
  +                {
  +                    final String classname =
  +                        "[L" + service.getComponentType() + ";";
  +                    map.put( classname, result );
  +                }
               }
               else
               {
                   final Map smap =
  -                    Collections.unmodifiableMap( (Map)value);
  +                    Collections.unmodifiableMap( (Map)value );
                   map.put( key, smap );
               }
           }
  @@ -284,7 +287,7 @@
               list.get( 0 ).getClass().getClassLoader();
           final Class clazz = classLoader.loadClass( type );
           final Object[] elements =
  -            (Object[]) Array.newInstance( clazz, list.size() );
  +            (Object[])Array.newInstance( clazz, list.size() );
           return list.toArray( elements );
       }
   
  @@ -327,6 +330,6 @@
        */
       private BlockMetaData getMetaDataFor( final Object entry )
       {
  -        return ( (BlockEntry) entry ).getMetaData();
  +        return ( (BlockEntry)entry ).getMetaData();
       }
   }
  
  
  

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


Mime
View raw message