mcconnell 2003/07/08 07:05:16
Modified: merlin/composition/src/java/org/apache/avalon/composition/model/impl
Scanner.java
merlin/composition/src/test/conf block.xml
Log:
Update the name scanner so that it never throws an exception.
Revision Changes Path
1.6 +17 -9
avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/model/impl/Scanner.java
Index: Scanner.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/model/impl/Scanner.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Scanner.java 8 Jul 2003 13:47:06 -0000 1.5
+++ Scanner.java 8 Jul 2003 14:05:15 -0000 1.6
@@ -588,16 +588,24 @@
private String parseResourceName( String resource )
{
- int i = resource.lastIndexOf( "." );
- String name = resource.substring( 0, i );
- String name2 = name.replace( '/', '.' );
- String name3 = name2.replace( '\\', '.' );
- if( name3.startsWith( "." ) )
+ try
{
- return name3.substring( 1, name3.length() );
- } else
+ int i = resource.lastIndexOf( "." );
+ String name = resource.substring( 0, i );
+ String name2 = name.replace( '/', '.' );
+ String name3 = name2.replace( '\\', '.' );
+ if( name3.startsWith( "." ) )
+ {
+ return name3.substring( 1, name3.length() );
+ }
+ else
+ {
+ return name3;
+ }
+ }
+ catch( Throwable e )
{
- return name3;
+ return resource;
}
}
1.5 +0 -2 avalon-sandbox/merlin/composition/src/test/conf/block.xml
Index: block.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/composition/src/test/conf/block.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- block.xml 8 Jul 2003 13:47:07 -0000 1.4
+++ block.xml 8 Jul 2003 14:05:16 -0000 1.5
@@ -26,8 +26,6 @@
</fileset>
<repository>
<resource id="test:test-d"/>
- </repository>
- <repository>
<resource id="avalon-framework:avalon-framework-api" version="4.1.5-dev"/>
<resource id="avalon-framework:avalon-framework-impl" version="4.1.5-dev"/>
</repository>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]