mcconnell 2004/01/20 17:17:15
Modified: util/env/src/java/org/apache/avalon/util/env Env.java
Log:
Path the env class so that it is a little quieter on zero length strings. Info
provided by Jon Elson-Green.
Revision Changes Path
1.4 +18 -10 avalon/util/env/src/java/org/apache/avalon/util/env/Env.java
Index: Env.java
===================================================================
RCS file: /home/cvs/avalon/util/env/src/java/org/apache/avalon/util/env/Env.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Env.java 17 Dec 2003 04:49:20 -0000 1.3
+++ Env.java 21 Jan 2004 01:17:15 -0000 1.4
@@ -347,9 +347,13 @@
int l_idx = l_line.indexOf( '=') ;
if ( -1 == l_idx )
- {
- System.err.println( "Skipping line - could not find '=' in"
- + " line: '" + l_line + "'" ) ;
+ {
+ if( l_line.length()!=0)
+ {
+ System.err.println(
+ "Skipping line - could not find '=' in"
+ + " line: '" + l_line + "'" );
+ }
continue ;
}
@@ -363,7 +367,6 @@
}
catch( Throwable t )
{
- t.printStackTrace() ;
throw new EnvAccessException( "NA", t ) ;
}
finally
@@ -385,8 +388,10 @@
// Check that we exited normally before returning an invalid output
if ( 0 != l_proc.exitValue() )
{
- throw new EnvAccessException( "Environment process failed "
- + " with non-zero exit code of " + l_proc.exitValue() ) ;
+ throw new EnvAccessException(
+ "Environment process failed "
+ + " with non-zero exit code of "
+ + l_proc.exitValue() ) ;
}
return l_props ;
@@ -572,7 +577,7 @@
}
catch( IOException e )
{
-
+ // ignore
}
}
@@ -587,7 +592,10 @@
return l_value ;
}
- throw new EnvAccessException( a_name, "Environment process failed"
- + " with non-zero exit code of " + l_proc.exitValue() ) ;
+ throw new EnvAccessException(
+ a_name,
+ "Environment process failed"
+ + " with non-zero exit code of "
+ + l_proc.exitValue() ) ;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]