jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1776884 - in /jmeter/trunk/src/core/org/apache/jmeter: control/gui/ gui/ gui/tree/ report/processor/ report/processor/graph/ report/processor/graph/impl/ samplers/ save/converters/ testelement/property/ threads/ util/ visualizers/
Date Sun, 01 Jan 2017 21:25:02 GMT
Author: pmouawad
Date: Sun Jan  1 21:25:02 2017
New Revision: 1776884

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

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/control/gui/TransactionControllerGui.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/GUIFactory.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeTransferHandler.java
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/RequestsSummaryConsumer.java
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/TimeStampKeysSelector.java
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/BytesThroughputGraphConsumer.java
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ResponseTimeDistributionGraphConsumer.java
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java
    jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MultiProperty.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java
    jmeter/trunk/src/core/org/apache/jmeter/util/Calculator.java
    jmeter/trunk/src/core/org/apache/jmeter/visualizers/Sample.java
    jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/gui/TransactionControllerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/gui/TransactionControllerGui.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/gui/TransactionControllerGui.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/gui/TransactionControllerGui.java Sun
Jan  1 21:25:02 2017
@@ -65,7 +65,7 @@ public class TransactionControllerGui ex
     public void modifyTestElement(TestElement el) {
         configureTestElement(el);
         ((TransactionController) el).setGenerateParentSample(generateParentSample.isSelected());
-        TransactionController tc = ((TransactionController) el);
+        TransactionController tc = (TransactionController) el;
         tc.setGenerateParentSample(generateParentSample.isSelected());
         tc.setIncludeTimers(includeTimers.isSelected());
     }

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/GUIFactory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/GUIFactory.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/GUIFactory.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/GUIFactory.java Sun Jan  1 21:25:02 2017
@@ -74,7 +74,7 @@ public final class GUIFactory {
      */
     public static ImageIcon getIcon(Class<?> elementClass, boolean enabled) {
         String key = elementClass.getName();
-        ImageIcon icon = (enabled ? ICON_MAP.get(key) : DISABLED_ICON_MAP.get(key));
+        ImageIcon icon = enabled ? ICON_MAP.get(key) : DISABLED_ICON_MAP.get(key);
 
         if (icon != null) {
             return icon;

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java Sun Jan  1 21:25:02
2017
@@ -113,7 +113,7 @@ public class JMeterTreeModel extends Def
                 addSubTree(subTree.getTree(item), current);
             } else if (item instanceof WorkBench) {
                 current = (JMeterTreeNode) ((JMeterTreeNode) getRoot()).getChildAt(1);
-                final TestElement testElement = ((TestElement) current.getUserObject());
+                final TestElement testElement = (TestElement) current.getUserObject();
                 testElement.addTestElement(item);
                 testElement.setName(item.getName());
                 addSubTree(subTree.getTree(item), current);

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeTransferHandler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeTransferHandler.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeTransferHandler.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeTransferHandler.java Sun Jan
 1 21:25:02 2017
@@ -116,7 +116,7 @@ public class JMeterTreeTransferHandler e
                 int row1 = tree.getRowForPath(o1);
                 int row2 = tree.getRowForPath(o2);
                 
-                return (row1<row2 ? -1 : (row1==row2 ? 0 : 1));
+                return row1<row2 ? -1 : (row1==row2 ? 0 : 1);
             }
         };
         

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java Sun
Jan  1 21:25:02 2017
@@ -63,7 +63,7 @@ public class ErrorsSummaryConsumer exten
         result.addResult(new ValueResultData(key != null ? key : JMeterUtils
                 .getResString("reportgenerator_summary_total")));
         result.addResult(new ValueResultData(data));
-        result.addResult(new ValueResultData(Double.valueOf(((double) data.longValue() *
100 / errorCount))));
+        result.addResult(new ValueResultData(Double.valueOf((double) data.longValue() * 100
/ errorCount)));
         result.addResult(new ValueResultData(Double.valueOf((double) data.longValue() * 100
                 / getOverallInfo().getData().doubleValue())));
         return result;
@@ -139,7 +139,7 @@ public class ErrorsSummaryConsumer exten
         if (StringUtils.isNumeric(codeAsString)) {
             try {
                 int code = Integer.parseInt(codeAsString);
-                return (code >= 200 && code <= 399);
+                return code >= 200 && code <= 399;
             } catch (NumberFormatException ex) {
                 return false;
             }

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/RequestsSummaryConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/RequestsSummaryConsumer.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/RequestsSummaryConsumer.java
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/RequestsSummaryConsumer.java
Sun Jan  1 21:25:02 2017
@@ -71,10 +71,10 @@ public class RequestsSummaryConsumer ext
     @Override
     public void stopConsuming() {
         MapResultData result = new MapResultData();
-        result.setResult("KoPercent", new ValueResultData(Double.valueOf(((double) errorCount
-                * 100 / count))));
+        result.setResult("KoPercent", new ValueResultData(Double.valueOf((double) errorCount
+                * 100 / count)));
         result.setResult("OkPercent", new ValueResultData(
-                Double.valueOf(((double) (count - errorCount) * 100 / count))));
+                Double.valueOf((double) (count - errorCount) * 100 / count)));
         setDataToContext(getName(), result);
         super.stopProducing();
     }

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/TimeStampKeysSelector.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/TimeStampKeysSelector.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/TimeStampKeysSelector.java
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/TimeStampKeysSelector.java
Sun Jan  1 21:25:02 2017
@@ -80,7 +80,7 @@ public class TimeStampKeysSelector imple
     @Override
     public Double select(Sample sample) {
         long time = selectBeginTime ? sample.getStartTime() : sample.getEndTime();
-        return Double.valueOf(((double) time - time % granularity));
+        return Double.valueOf((double) time - time % granularity);
     }
 
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/BytesThroughputGraphConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/BytesThroughputGraphConsumer.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/BytesThroughputGraphConsumer.java
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/BytesThroughputGraphConsumer.java
Sun Jan  1 21:25:02 2017
@@ -81,7 +81,7 @@ public class BytesThroughputGraphConsume
                         // We ignore Transaction Controller results
                         if(!sample.isController()) {
                             return Double.valueOf(
-                                (RECEIVED_BYTES_SERIES_LABEL.equals(series)) ? sample
+                                RECEIVED_BYTES_SERIES_LABEL.equals(series) ? sample
                                 .getReceivedBytes() : sample.getSentBytes());
                         } else {
                             return null;

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ResponseTimeDistributionGraphConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ResponseTimeDistributionGraphConsumer.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ResponseTimeDistributionGraphConsumer.java
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ResponseTimeDistributionGraphConsumer.java
Sun Jan  1 21:25:02 2017
@@ -72,7 +72,7 @@ public class ResponseTimeDistributionGra
             @Override
             public Double select(Sample sample) {
                 long elapsed = sample.getElapsedTime();
-                return Double.valueOf((elapsed - elapsed % granularity));
+                return Double.valueOf(elapsed - elapsed % granularity);
 
             }
         };

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java Sun Jan
 1 21:25:02 2017
@@ -914,7 +914,7 @@ public class SampleSaveConfiguration imp
      *            milliseconds since epoch will be printed
      */
     public void setFormatter(DateFormat fmt){
-        printMilliseconds = (fmt == null); // maintain relationship
+        printMilliseconds = fmt == null; // maintain relationship
         formatter = fmt;
     }
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java Sun
Jan  1 21:25:02 2017
@@ -411,7 +411,7 @@ public class SampleResultConverter exten
                 try {
                     res.setResponseData(responseData.getBytes(dataEncoding));
                 } catch (UnsupportedEncodingException e) {
-                    res.setResponseData(("Can't support the char set: " + dataEncoding),
null);
+                    res.setResponseData("Can't support the char set: " + dataEncoding, null);
                     res.setDataType(SampleResult.TEXT);
                 }
             }

Modified: jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java Sun
Jan  1 21:25:02 2017
@@ -54,7 +54,7 @@ public class CollectionProperty extends
 
     @Override
     public int hashCode() {
-        return (value == null ? 0 : value.hashCode());
+        return value == null ? 0 : value.hashCode();
     }
 
     public void remove(String prop) {

Modified: jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MultiProperty.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MultiProperty.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MultiProperty.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MultiProperty.java Sun Jan
 1 21:25:02 2017
@@ -85,7 +85,7 @@ public abstract class MultiProperty exte
         }
         log.debug("merging in " + prop.getClass());
         if (prop instanceof MultiProperty) {
-            for (JMeterProperty item : ((MultiProperty) prop)) {
+            for (JMeterProperty item : (MultiProperty) prop) {
                 addProperty(item);
             }
         } else {

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java Sun Jan  1 21:25:02
2017
@@ -202,7 +202,7 @@ public class TestCompiler implements Has
             List<PreProcessor>  tempPre = new LinkedList<>();
             List<PostProcessor> tempPost = new LinkedList<>();
             for (Object item : testTree.list(stack.subList(0, i))) {
-                if ((item instanceof ConfigTestElement)) {
+                if (item instanceof ConfigTestElement) {
                     configs.add((ConfigTestElement) item);
                 }
                 if (item instanceof SampleListener) {

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/Calculator.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/Calculator.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/Calculator.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/Calculator.java Sun Jan  1 21:25:02 2017
@@ -185,10 +185,10 @@ public class Calculator {
         double rval = 0.0;
 
         if (count == 0) {
-            return (rval);
+            return rval;
         }
         rval = (double) errors / (double) count;
-        return (rval);
+        return rval;
     }
 
     /**

Modified: jmeter/trunk/src/core/org/apache/jmeter/visualizers/Sample.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/visualizers/Sample.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/visualizers/Sample.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/visualizers/Sample.java Sun Jan  1 21:25:02 2017
@@ -181,10 +181,8 @@ public class Sample implements Serializa
     
     @Override
     public boolean equals(Object o){
-        return (
-                (o instanceof Sample) &&
-                (this.compareTo((Sample) o) == 0)
-                );
+        return (o instanceof Sample) &&
+                (this.compareTo((Sample) o) == 0);
     }
 
     @Override

Modified: jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java?rev=1776884&r1=1776883&r2=1776884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java Sun Jan  1 21:25:02
2017
@@ -123,17 +123,15 @@ public class TableSample implements Seri
     @Override
     public int compareTo(TableSample o) {
         TableSample oo = o;
-        return ((totalSamples - oo.totalSamples) < 0 ? -1 : (totalSamples == oo.totalSamples
? 0 : 1));
+        return (totalSamples - oo.totalSamples) < 0 ? -1 : (totalSamples == oo.totalSamples
? 0 : 1);
     }
 
     // TODO should equals and hashCode depend on field other than count?
     
     @Override
     public boolean equals(Object o){
-        return (
-                (o instanceof TableSample) &&
-                (this.compareTo((TableSample) o) == 0)
-                );
+        return (o instanceof TableSample) &&
+                (this.compareTo((TableSample) o) == 0);
     }
 
     @Override



Mime
View raw message