jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1776882 - in /jmeter/trunk/src/components/org/apache/jmeter: timers/ConstantThroughputTimer.java timers/PoissonRandomTimer.java visualizers/Graph.java visualizers/RespTimeGraphVisualizer.java visualizers/SearchTextExtension.java
Date Sun, 01 Jan 2017 21:23:00 GMT
Author: pmouawad
Date: Sun Jan  1 21:23:00 2017
New Revision: 1776882

URL: http://svn.apache.org/viewvc?rev=1776882&view=rev
Log:
Sonar : fix squid:UselessParenthesesCheck Remove those useless parentheses.

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java
    jmeter/trunk/src/components/org/apache/jmeter/timers/PoissonRandomTimer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/Graph.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java?rev=1776882&r1=1776881&r2=1776882&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java Sun
Jan  1 21:23:00 2017
@@ -174,7 +174,7 @@ public class ConstantThroughputTimer ext
     private long calculateDelay() {
         long delay;
         // N.B. we fetch the throughput each time, as it may vary during a test
-        double msPerRequest = (MILLISEC_PER_MIN / getThroughput());
+        double msPerRequest = MILLISEC_PER_MIN / getThroughput();
         switch (mode) {
         case AllActiveThreads: // Total number of threads
             delay = Math.round(JMeterContextService.getNumberOfThreads() * msPerRequest);

Modified: jmeter/trunk/src/components/org/apache/jmeter/timers/PoissonRandomTimer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/timers/PoissonRandomTimer.java?rev=1776882&r1=1776881&r2=1776882&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/timers/PoissonRandomTimer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/timers/PoissonRandomTimer.java Sun Jan 
1 21:23:00 2017
@@ -360,7 +360,7 @@ public class PoissonRandomTimer extends
             }
             double v = Math.random();
             double y = alpha - beta*x;
-            double lhs = y + Math.log(v/Math.pow((1.0 + Math.exp(y)),2));
+            double lhs = y + Math.log(v/Math.pow(1.0 + Math.exp(y),2));
             double rhs = k + n*Math.log(lambda) -logFactorial(n);
             if (lhs <= rhs) {
                 return n;

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/Graph.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/Graph.java?rev=1776882&r1=1776881&r2=1776882&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/Graph.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/Graph.java Sun Jan  1 21:23:00
2017
@@ -228,27 +228,27 @@ public class Graph extends JComponent im
             int average = (int) (oneSample.getAverage() * height / graphMax);
 
             g.setColor(Color.blue);
-            g.drawLine(adjustedWidth, height - average, adjustedWidth, (height - average
- 1));
+            g.drawLine(adjustedWidth, height - average, adjustedWidth, height - average -
1);
         }
 
         if (wantMedian) {
             int median = (int) (oneSample.getMedian() * height / graphMax);
 
             g.setColor(JMeterColor.PURPLE);
-            g.drawLine(adjustedWidth, height - median, adjustedWidth, (height - median -
1));
+            g.drawLine(adjustedWidth, height - median, adjustedWidth, height - median - 1);
         }
 
         if (wantDeviation) {
             int deviation = (int) (oneSample.getDeviation() * height / graphMax);
 
             g.setColor(Color.red);
-            g.drawLine(adjustedWidth, height - deviation, adjustedWidth, (height - deviation
- 1));
+            g.drawLine(adjustedWidth, height - deviation, adjustedWidth, height - deviation
- 1);
         }
         if (wantThroughput) {
             int throughput = (int) (oneSample.getThroughput() * height / throughputMax);
 
             g.setColor(JMeterColor.DARK_GREEN);
-            g.drawLine(adjustedWidth, height - throughput, adjustedWidth, (height - throughput
- 1));
+            g.drawLine(adjustedWidth, height - throughput, adjustedWidth, height - throughput
- 1);
         }
     }
 

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java?rev=1776882&r1=1776881&r2=1776882&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
Sun Jan  1 21:23:00 2017
@@ -423,7 +423,7 @@ public class RespTimeGraphVisualizer ext
                         for (int cnt = 0; cnt < nlsize; cnt++) {
                             int pos = idx - (nlsize - cnt);
                             if (pos < 0) { pos = 0; }
-                            valPrev = (valPrev + ((nanLast - nanBegin) / (nlsize + 2)));
+                            valPrev = valPrev + ((nanLast - nanBegin) / (nlsize + 2));
                             data[s][pos] = valPrev;
                         }
                         nanList.clear();

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java?rev=1776882&r1=1776881&r2=1776882&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java Sun
Jan  1 21:23:00 2017
@@ -306,7 +306,7 @@ public class SearchTextExtension impleme
                 Matcher matcher = null;
                 try {
                     Document contentDoc = results.getDocument();
-                    String body = contentDoc.getText(lastPosition, (contentDoc.getLength()
- lastPosition));
+                    String body = contentDoc.getText(lastPosition, contentDoc.getLength()
- lastPosition);
                     matcher = pattern.matcher(body);
 
                     if ((matcher != null) && (matcher.find())) {



Mime
View raw message