jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1721405 - /jmeter/trunk/src/core/org/apache/jmeter/report/processor/AggregateConsumer.java
Date Tue, 22 Dec 2015 13:57:35 GMT
Author: fschumacher
Date: Tue Dec 22 13:57:35 2015
New Revision: 1721405

URL: http://svn.apache.org/viewvc?rev=1721405&view=rev
Log:
Replace ArgumentNullException with NPE by using Validate.notNull instead of checking for null
by hand.
Document the need for non null parameter

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/AggregateConsumer.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/AggregateConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/AggregateConsumer.java?rev=1721405&r1=1721404&r2=1721405&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/AggregateConsumer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/AggregateConsumer.java Tue Dec
22 13:57:35 2015
@@ -17,7 +17,7 @@
  */
 package org.apache.jmeter.report.processor;
 
-import org.apache.jmeter.report.core.ArgumentNullException;
+import org.apache.commons.lang3.Validate;
 import org.apache.jmeter.report.core.Sample;
 import org.apache.jmeter.report.core.SampleSelector;
 
@@ -29,6 +29,8 @@ import org.apache.jmeter.report.core.Sam
  */
 public class AggregateConsumer extends AbstractSampleConsumer {
 
+    private static final String MUST_NOT_BE_NULL = "%s must not be null";
+
     /** The aggregator. */
     private Aggregator aggregator;
 
@@ -57,18 +59,14 @@ public class AggregateConsumer extends A
      * Instantiates a new abstract aggregate consumer.
      *
      * @param aggregator
-     *            the aggregator
+     *            the aggregator (must not be {@code null})
      * @param selector
-     *            the selector
+     *            the selector (must not be {@code null})
      */
     public AggregateConsumer(Aggregator aggregator,
             SampleSelector<Double> selector) {
-        if (aggregator == null) {
-            throw new ArgumentNullException("aggregator");
-        }
-        if (selector == null) {
-            throw new ArgumentNullException("selector");
-        }
+        Validate.notNull(aggregator, MUST_NOT_BE_NULL, "aggregator");
+        Validate.notNull(selector, MUST_NOT_BE_NULL, "selector");
 
         this.aggregator = aggregator;
         this.selector = selector;



Mime
View raw message