Author: sebb
Date: Fri Jan 28 22:33:57 2011
New Revision: 1064914

URL: http://svn.apache.org/viewvc?rev=1064914&view=rev
Log:
Re-instate null check dropped in error

Modified:
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java

Modified: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java?rev=1064914&r1=1064913&r2=1064914&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java 
(original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java 
Fri Jan 28 22:33:57 2011
@@ -127,22 +127,24 @@ public class FileServer {
 
     /**
      * Sets the current base directory for relative file names from the 
provided script file.
-     * The parameter is assumed to be the path to  a JMX file, so the base 
directory is derived
+     * The parameter is assumed to be the path to a JMX file, so the base 
directory is derived
      * from its parent.
      * 
-     * @param scriptPath the path of the script file; may be {@code null}
+     * @param scriptPath the path of the script file; must be not be {@code 
null}
      * @throws IllegalStateException if files are still open
+     * @throws IllegalArgumentException if scriptPath parameter is null
      */
     public synchronized void setBaseForScript(File scriptPath) {
+        if (scriptPath == null){
+            throw new IllegalArgumentException("scriptPath must not be null");
+        }
         if (filesOpen()) {
             throw new IllegalStateException("Files are still open, cannot 
change base directory");
         }
         files.clear();
-        if (scriptPath != null) {
-            // getParentFile() may not work on relative paths
-            base = scriptPath.getAbsoluteFile().getParentFile();
-            log.info("Set new base '"+base+"'");
-        }
+        // getParentFile() may not work on relative paths
+        base = scriptPath.getAbsoluteFile().getParentFile();
+        log.info("Set new base '"+base+"'");
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to