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-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier MetaDataVerifier.java
Date Sun, 25 Aug 2002 03:12:59 GMT
donaldp     2002/08/24 20:12:59

  Modified:    containerkit/src/java/org/apache/excalibur/containerkit/verifier
                        MetaDataVerifier.java
  Log:
  extract some variables
  
  Revision  Changes    Path
  1.15      +13 -20    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier/MetaDataVerifier.java
  
  Index: MetaDataVerifier.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier/MetaDataVerifier.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- MetaDataVerifier.java	24 Aug 2002 08:58:07 -0000	1.14
  +++ MetaDataVerifier.java	25 Aug 2002 03:12:59 -0000	1.15
  @@ -138,10 +138,11 @@
           {
               if( 0 != count )
               {
  +                final ComponentMetaData metaData = component.getMetaData();
                   final String message =
                       REZ.getString( "metadata.declare-uneeded-entrys.error",
  -                                   component.getMetaData().getName(),
  -                                   getClassname( component ) );
  +                                   metaData.getName(),
  +                                   metaData.getImplementationKey() );
                   throw new VerifyException( message );
               }
           }
  @@ -162,7 +163,8 @@
                                                final Class clazz )
           throws VerifyException
       {
  -        final int count = component.getMetaData().getDependencies().length;
  +        final ComponentMetaData metaData = component.getMetaData();
  +        final int count = metaData.getDependencies().length;
           final boolean aquiresServices =
               Composable.class.isAssignableFrom( clazz ) ||
               Serviceable.class.isAssignableFrom( clazz );
  @@ -172,8 +174,8 @@
               {
                   final String message =
                       REZ.getString( "metadata.declare-uneeded-deps.error",
  -                                   component.getMetaData().getName(),
  -                                   getClassname( component ) );
  +                                   metaData.getName(),
  +                                   metaData.getImplementationKey() );
                   throw new VerifyException( message );
               }
           }
  @@ -230,31 +232,22 @@
                               final ComponentProfile component )
           throws VerifyException
       {
  +        final ComponentMetaData metaData = component.getMetaData();
  +        final String classname = metaData.getImplementationKey();
           Class clazz = null;
           try
           {
  -            clazz = classLoader.loadClass( getClassname( component ) );
  +            clazz = classLoader.loadClass( classname );
           }
           catch( final Exception e )
           {
               final String message =
                   REZ.getString( "assembly.bad-class.error",
  -                               component.getMetaData().getName(),
  -                               getClassname( component ),
  +                               metaData.getName(),
  +                               classname,
                                  e.toString() );
               throw new VerifyException( message );
           }
           return clazz;
  -    }
  -
  -    /**
  -     * Utility method to aquire classname for component.
  -     *
  -     * @param component the component
  -     * @return the classname for component
  -     */
  -    private String getClassname( final ComponentProfile component )
  -    {
  -        return component.getMetaData().getImplementationKey();
       }
   }
  
  
  

--
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