avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo ComponentDescriptor.java ContextDescriptor.java
Date Mon, 10 Jun 2002 17:14:19 GMT
mcconnell    2002/06/10 10:14:18

  Modified:    containerkit/src/java/org/apache/excalibur/containerkit/metainfo
                        ComponentDescriptor.java ContextDescriptor.java
  Log:
  classname validation
  
  Revision  Changes    Path
  1.11      +3 -1      jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentDescriptor.java
  
  Index: ComponentDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentDescriptor.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ComponentDescriptor.java	10 Jun 2002 17:11:13 -0000	1.10
  +++ ComponentDescriptor.java	10 Jun 2002 17:14:18 -0000	1.11
  @@ -9,6 +9,8 @@
   
   import java.util.Properties;
   import org.apache.avalon.framework.Version;
  +import org.apache.avalon.excalibur.i18n.ResourceManager;
  +import org.apache.avalon.excalibur.i18n.Resources;
   
   /**
    * This class is used to provide explicit information to assembler
  @@ -49,7 +51,7 @@
    * </pre>
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.10 $ $Date: 2002/06/10 17:11:13 $
  + * @version $Revision: 1.11 $ $Date: 2002/06/10 17:14:18 $
    */
   public final class ComponentDescriptor
       extends FeatureDescriptor
  
  
  
  1.3       +13 -1     jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ContextDescriptor.java
  
  Index: ContextDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ContextDescriptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContextDescriptor.java	9 Jun 2002 01:04:55 -0000	1.2
  +++ ContextDescriptor.java	10 Jun 2002 17:14:18 -0000	1.3
  @@ -8,6 +8,8 @@
   package org.apache.excalibur.containerkit.metainfo;
   
   import java.util.Properties;
  +import org.apache.avalon.excalibur.i18n.ResourceManager;
  +import org.apache.avalon.excalibur.i18n.Resources;
   
   /**
    * A descriptor describing the Context that the Component
  @@ -24,11 +26,15 @@
    * about Context requirements.</p>
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.2 $ $Date: 2002/06/09 01:04:55 $
  + * @version $Revision: 1.3 $ $Date: 2002/06/10 17:14:18 $
    */
   public class ContextDescriptor
       extends FeatureDescriptor
   {
  +
  +    private static final Resources REZ =
  +        ResourceManager.getPackageResources( ContextDescriptor.class );
  +
       private final String m_classname;
       private final EntryDescriptor[] m_entrys;
   
  @@ -58,6 +64,12 @@
           if( null == entrys )
           {
               throw new NullPointerException( "entrys" );
  +        }
  +
  +        if( classname.indexOf("/") > -1 )
  +        {
  +            message = REZ.getString( "component.invalid-classname", classname );
  +            throw new IllegalArgumentException( message );
           }
   
           m_classname = classname;
  
  
  

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