You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/06/10 19:11:13 UTC
cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo Resources.properties ComponentDescriptor.java
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>