mcconnell 02/02/11 05:39:35
Modified: src/java/org/apache/avalon/excalibur/logger/factory
FileTargetFactory.java
Log:
applied patch to trap NullPointer case and JavaDoc correction submitted by
Mark Woon
Revision Changes Path
1.11 +9 -5
jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/logger/factory/FileTargetFactory.java
Index: FileTargetFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/logger/factory/FileTargetFactory.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FileTargetFactory.java 9 Feb 2002 00:29:57 -0000 1.10
+++ FileTargetFactory.java 11 Feb 2002 13:39:35 -0000 1.11
@@ -111,7 +111,7 @@
* </dl>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.10 $ $Date: 2002/02/09 00:29:57 $
+ * @version CVS $Revision: 1.11 $ $Date: 2002/02/11 13:39:35 $
* @since 4.0
*/
public class FileTargetFactory
@@ -291,11 +291,11 @@
}
/**
- * Process the file name
+ * Process the file name.
*
* This method scans the file name passed for occurrences of
- * ${foo}. Those strings get replaced by values from the Context object
- * indexted by the name (here foo).
+ * ${foo}. These strings get replaced by values from the Context
+ * object indexed by the name (here foo).
*
* @param rawFilename The filename with substitutable placeholders
* @return The processed file name
@@ -310,6 +310,9 @@
int j = -1;
while( ( j = rawFilename.indexOf( "${", i ) ) > -1 )
{
+ if( m_context == null ) {
+ throw new ConfigurationException( "Context not available." );
+ }
if( i < j )
{
sb.append( rawFilename.substring( i, j ) );
@@ -323,7 +326,8 @@
}
catch( final ContextException ce )
{
- throw new ConfigurationException( "missing entry '" +
ctx_name + "' in Context" );
+ throw new ConfigurationException(
+ "missing entry '" + ctx_name + "' in Context." );
}
sb.append( ctx.toString() );
i = k + 1;
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>