You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2015/12/22 14:57:35 UTC

svn commit: r1721405 - /jmeter/trunk/src/core/org/apache/jmeter/report/processor/AggregateConsumer.java

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;