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 Resources.properties ComponentDescriptor.java
Date Mon, 10 Jun 2002 17:11:13 GMT
mcconnell    2002/06/10 10:11:13

  Modified:    containerkit/src/java/org/apache/excalibur/containerkit/metainfo
                        ComponentDescriptor.java
  Added:       containerkit/src/java/org/apache/excalibur/containerkit/metainfo
                        Resources.properties
  Log:
  classname validation
  
  Revision  Changes    Path
  1.10      +12 -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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ComponentDescriptor.java	9 Jun 2002 00:27:02 -0000	1.9
  +++ ComponentDescriptor.java	10 Jun 2002 17:11:13 -0000	1.10
  @@ -49,11 +49,15 @@
    * </pre>
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.9 $ $Date: 2002/06/09 00:27:02 $
  + * @version $Revision: 1.10 $ $Date: 2002/06/10 17:11:13 $
    */
   public final class ComponentDescriptor
       extends FeatureDescriptor
   {
  +
  +    private static final Resources REZ =
  +        ResourceManager.getPackageResources( ComponentDescriptor.class );
  +
       /**
        * The short name of the Component Type. Useful for displaying
        * human readable strings describing the type in
  @@ -83,6 +87,13 @@
                                   final Properties attributes )
       {
           super( attributes );
  +
  +        if( classname.indexOf("/") > -1 )
  +        {
  +            message = REZ.getString( "component.invalid-classname", classname );
  +            throw new IllegalArgumentException( message );
  +        }
  +
           m_name = name;
           m_displayName = displayName;
           m_classname = classname;
  
  
  
  1.1                  jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  #From ComponentDescriptor class
  component.invalid-classname.error=Invalid classname {1}.
  
  
  

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