jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1776888 - in /jmeter/trunk/src/protocol: http/org/apache/jmeter/protocol/http/control/ http/org/apache/jmeter/protocol/http/gui/ http/org/apache/jmeter/protocol/http/modifier/gui/ http/org/apache/jmeter/protocol/http/parser/ http/org/apach...
Date Sun, 01 Jan 2017 21:28:17 GMT
Author: pmouawad
Date: Sun Jan  1 21:28:17 2017
New Revision: 1776888

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

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/DNSCachePanel.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HeaderPanel.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/URLRewritingModifierGui.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/URLString.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
Sun Jan  1 21:28:17 2017
@@ -494,8 +494,8 @@ public class AuthManager extends ConfigT
         if (STRIP_PORT) {
             return true;
         }
-        return (url.getPort() == HTTPConstants.DEFAULT_HTTP_PORT ||
-                url.getPort() == HTTPConstants.DEFAULT_HTTPS_PORT);
+        return url.getPort() == HTTPConstants.DEFAULT_HTTP_PORT ||
+                url.getPort() == HTTPConstants.DEFAULT_HTTPS_PORT;
     }
 
     /**

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java Sun
Jan  1 21:28:17 2017
@@ -293,7 +293,7 @@ public class AuthPanel extends AbstractC
     }
 
     private JPanel createButtonPanel() {
-        boolean tableEmpty = (tableModel.getRowCount() == 0);
+        boolean tableEmpty = tableModel.getRowCount() == 0;
 
         addButton = createButton("add", 'A', ADD_COMMAND, true); //$NON-NLS-1$
         deleteButton = createButton("delete", 'D', DELETE_COMMAND, !tableEmpty); //$NON-NLS-1$

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java Sun
Jan  1 21:28:17 2017
@@ -104,11 +104,11 @@ public class CookiePanel extends Abstrac
     private HashMap<String, String> handlerMap = new HashMap<>();
 
     private static final String[] COLUMN_RESOURCE_NAMES = {
-        ("name"),   //$NON-NLS-1$
-        ("value"),  //$NON-NLS-1$
-        ("domain"), //$NON-NLS-1$
-        ("path"),   //$NON-NLS-1$
-        ("secure"), //$NON-NLS-1$
+        "name",   //$NON-NLS-1$
+        "value",  //$NON-NLS-1$
+        "domain", //$NON-NLS-1$
+        "path",   //$NON-NLS-1$
+        "secure", //$NON-NLS-1$
         // removed expiration because it's just an annoyance for static cookies
     };
 
@@ -403,7 +403,7 @@ public class CookiePanel extends Abstrac
     }
 
     private JPanel createButtonPanel() {
-        boolean tableEmpty = (tableModel.getRowCount() == 0);
+        boolean tableEmpty = tableModel.getRowCount() == 0;
 
         addButton = createButton("add", 'A', ADD_COMMAND, true); //$NON-NLS-1$
         deleteButton = createButton("delete", 'D', DELETE_COMMAND, !tableEmpty); //$NON-NLS-1$

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/DNSCachePanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/DNSCachePanel.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/DNSCachePanel.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/DNSCachePanel.java
Sun Jan  1 21:28:17 2017
@@ -86,7 +86,7 @@ public class DNSCachePanel extends Abstr
     private ButtonGroup providerDNSradioGroup = new ButtonGroup();
 
     private static final String[] COLUMN_RESOURCE_NAMES = {
-        (JMeterUtils.getResString("dns_hostname_or_ip")), //$NON-NLS-1$
+        JMeterUtils.getResString("dns_hostname_or_ip"), //$NON-NLS-1$
     };
     private static final Class<?>[] columnClasses = {
         String.class };
@@ -237,7 +237,7 @@ public class DNSCachePanel extends Abstr
     }
 
     private JPanel createButtonPanel() {
-        boolean tableEmpty = (dnsServersTableModel.getRowCount() == 0);
+        boolean tableEmpty = dnsServersTableModel.getRowCount() == 0;
 
         addButton = createButton("add", 'A', ADD_COMMAND, custResButton.isSelected()); //
$NON-NLS-1$
         deleteButton = createButton("delete", 'D', DELETE_COMMAND, !tableEmpty); // $NON-NLS-1$

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HeaderPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HeaderPanel.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HeaderPanel.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HeaderPanel.java Sun
Jan  1 21:28:17 2017
@@ -294,7 +294,7 @@ public class HeaderPanel extends Abstrac
     }
 
     private JPanel createButtonPanel() {
-        boolean tableEmpty = (tableModel.getRowCount() == 0);
+        boolean tableEmpty = tableModel.getRowCount() == 0;
 
         JButton addButton = createButton("add", 'A', ADD_COMMAND, true); // $NON-NLS-1$
         deleteButton = createButton("delete", 'D', DELETE_COMMAND, !tableEmpty); // $NON-NLS-1$

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/URLRewritingModifierGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/URLRewritingModifierGui.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/URLRewritingModifierGui.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/URLRewritingModifierGui.java
Sun Jan  1 21:28:17 2017
@@ -102,12 +102,12 @@ public class URLRewritingModifierGui ext
     @Override
     public void modifyTestElement(TestElement modifier) {
         super.configureTestElement(modifier);
-        URLRewritingModifier rewritingModifier = ((URLRewritingModifier) modifier);
+        URLRewritingModifier rewritingModifier = (URLRewritingModifier) modifier;
         rewritingModifier.setArgumentName(argumentName.getText());
         rewritingModifier.setPathExtension(pathExt.isSelected());
         rewritingModifier.setPathExtensionNoEquals(pathExtNoEquals.isSelected());
         rewritingModifier.setPathExtensionNoQuestionmark(pathExtNoQuestionmark.isSelected());
-        rewritingModifier.setShouldCache((shouldCache.isSelected()));
+        rewritingModifier.setShouldCache(shouldCache.isSelected());
         rewritingModifier.setEncode(encode.isSelected());
     }
 
@@ -131,7 +131,7 @@ public class URLRewritingModifierGui ext
      */
     @Override
     public void configure(TestElement el) {
-        URLRewritingModifier rewritingModifier = ((URLRewritingModifier) el);
+        URLRewritingModifier rewritingModifier = (URLRewritingModifier) el;
         argumentName.setText(rewritingModifier.getArgumentName());
         pathExt.setSelected(rewritingModifier.isPathExtension());
         pathExtNoEquals.setSelected(rewritingModifier.isPathExtensionNoEquals());

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/URLString.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/URLString.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/URLString.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/URLString.java Sun
Jan  1 21:28:17 2017
@@ -25,7 +25,6 @@ import java.net.URL;
  * cost of the hostname lookup performed by the URL methods equals() and
  * hashCode() URL is a final class, so cannot be extended ...
  *
- * @version $Revision$
  */
 public class URLString implements Comparable<URLString> {
 
@@ -66,7 +65,7 @@ public class URLString implements Compar
     /** {@inheritDoc} */
     @Override
     public boolean equals(Object o) {
-        return (o instanceof URLString && urlAsString.equals(o.toString()));
+        return o instanceof URLString && urlAsString.equals(o.toString());
     }
 
     /** {@inheritDoc} */

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java
Sun Jan  1 21:28:17 2017
@@ -145,7 +145,7 @@ public abstract class HTTPHCAbstractImpl
      * @return {@code true} iff both ProxyPort and ProxyHost are defined.
      */
     protected boolean isDynamicProxy(String proxyHost, int proxyPort){
-        return (!JOrphanUtils.isBlank(proxyHost) && proxyPort > 0);        
+        return !JOrphanUtils.isBlank(proxyHost) && proxyPort > 0;        
     }
 
     /**

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/Base64Encoder.java
Sun Jan  1 21:28:17 2017
@@ -46,7 +46,7 @@ public final class Base64Encoder {
         StringBuilder out = new StringBuilder();
         int bl = bs.length;
         for (int i = 0; i < bl; i += 3) {
-            out.append(encodeAtom(bs, i, (bl - i)));
+            out.append(encodeAtom(bs, i, bl - i));
         }
         return out.toString();
     }

Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java?rev=1776888&r1=1776887&r2=1776888&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
(original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
Sun Jan  1 21:28:17 2017
@@ -321,7 +321,7 @@ public class JavaSampler extends Abstrac
             Thread.yield();
             SampleResult results = new SampleResult();
             results.setSuccessful(false);
-            results.setResponseData(("Class not found: " + getClassname()), null);
+            results.setResponseData("Class not found: " + getClassname(), null);
             results.setSampleLabel("ERROR: " + getClassname());
             return results;
         }



Mime
View raw message