Author: sebb
Date: Fri Apr 23 14:41:17 2010
New Revision: 937316
URL: http://svn.apache.org/viewvc?rev=937316&view=rev
Log:
args[] array will never be null
Modified:
commons/proper/daemon/trunk/src/samples/ProcrunService.java
Modified: commons/proper/daemon/trunk/src/samples/ProcrunService.java
URL:
http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/samples/ProcrunService.java?rev=937316&r1=937315&r2=937316&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/samples/ProcrunService.java (original)
+++ commons/proper/daemon/trunk/src/samples/ProcrunService.java Fri Apr 23
14:41:17 2010
@@ -62,12 +62,12 @@ public class ProcrunService implements R
/**
* Helper method for process args with defaults.
*
- * @param args array of string arguments, may be null or empty
+ * @param args array of string arguments, may be empty
* @param argnum which argument to extract
* @return the argument or null
*/
private static String getArg(String[] args, int argnum){
- if (args != null && args.length > argnum) {
+ if (args.length > argnum) {
return args[argnum];
} else {
return null;
@@ -83,7 +83,7 @@ public class ProcrunService implements R
* @throws IOException if there are problems creating or deleting the
temporary file
*/
public static void main(String[] args) throws IOException {
- final int argc = (args == null) ? -0 : args.length;
+ final int argc = args.length;
log("ProcrunService called with "+argc+" arguments from thread:
"+Thread.currentThread());
for(int i=0; i < argc; i++) {
System.out.println("["+i+"] "+args[i]);