jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1721348 - /jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java
Date Tue, 22 Dec 2015 11:09:39 GMT
Author: fschumacher
Date: Tue Dec 22 11:09:39 2015
New Revision: 1721348

URL: http://svn.apache.org/viewvc?rev=1721348&view=rev
Log:
Replace ArgumentNullException with NPE by using Validate.notNull.

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java?rev=1721348&r1=1721347&r2=1721348&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java Tue
Dec 22 11:09:39 2015
@@ -23,11 +23,11 @@ import java.nio.file.Files;
 import java.util.Map;
 import java.util.TimeZone;
 
+import org.apache.commons.lang3.Validate;
 import org.apache.jmeter.report.config.ConfigurationException;
 import org.apache.jmeter.report.config.ExporterConfiguration;
 import org.apache.jmeter.report.config.SubConfiguration;
 import org.apache.jmeter.report.config.ReportGeneratorConfiguration;
-import org.apache.jmeter.report.core.ArgumentNullException;
 import org.apache.jmeter.report.core.DataContext;
 import org.apache.jmeter.report.core.TimeHelper;
 import org.apache.jmeter.report.processor.MapResultData;
@@ -49,6 +49,9 @@ import freemarker.template.TemplateExcep
  */
 public class HtmlTemplateExporter extends AbstractDataExporter {
 
+    /** Format used for non null check of parameters. */
+    private static final String MUST_NOT_BE_NULL = "%s must not be null";
+
     private static final Logger log = LoggingManager.getLoggerForClass();
 
     public static final String DATA_CTX_TESTFILE = "testFile";
@@ -136,15 +139,9 @@ public class HtmlTemplateExporter extend
     @Override
     public void export(SampleContext context, File file,
             ReportGeneratorConfiguration configuration) throws ExportException {
-        if (context == null) {
-            throw new ArgumentNullException("context");
-        }
-        if (file == null) {
-            throw new ArgumentNullException("file");
-        }
-        if (configuration == null) {
-            throw new ArgumentNullException("configuration");
-        }
+        Validate.notNull(context, MUST_NOT_BE_NULL, "context");
+        Validate.notNull(file, MUST_NOT_BE_NULL, "file");
+        Validate.notNull(configuration, MUST_NOT_BE_NULL, "configuration");
 
         log.debug("Start template processing");
 



Mime
View raw message