jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1776887 - in /jmeter/trunk/src: functions/org/apache/jmeter/functions/ jorphan/org/apache/commons/cli/avalon/ jorphan/org/apache/jorphan/collections/ jorphan/org/apache/jorphan/util/
Date Sun, 01 Jan 2017 21:27:02 GMT
Author: pmouawad
Date: Sun Jan  1 21:27:02 2017
New Revision: 1776887

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

Modified:
    jmeter/trunk/src/functions/org/apache/jmeter/functions/TimeFunction.java
    jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java
    jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java
    jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java
    jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/TimeFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/TimeFunction.java?rev=1776887&r1=1776886&r2=1776887&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/TimeFunction.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/TimeFunction.java Sun Jan  1 21:27:02
2017
@@ -90,7 +90,7 @@ public class TimeFunction extends Abstra
             }
             if (DIVISOR_PATTERN.matcher(fmt).matches()) { // divisor is a positive number
                 long div = Long.parseLong(fmt.substring(1)); // should never case NFE
-                datetime = Long.toString((System.currentTimeMillis() / div));
+                datetime = Long.toString(System.currentTimeMillis() / div);
             } else {
                 SimpleDateFormat df = new SimpleDateFormat(fmt);// Not synchronised, so can't
be shared
                 datetime = df.format(new Date());

Modified: jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java?rev=1776887&r1=1776886&r2=1776887&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java Sun Jan  1 21:27:02
2017
@@ -51,9 +51,9 @@ public final class CLUtil {
             final String name = option.getName();
             String description = option.getDescription();
             int flags = option.getFlags();
-            boolean argumentOptional = ((flags & CLOptionDescriptor.ARGUMENT_OPTIONAL)
== CLOptionDescriptor.ARGUMENT_OPTIONAL);
-            boolean argumentRequired = ((flags & CLOptionDescriptor.ARGUMENT_REQUIRED)
== CLOptionDescriptor.ARGUMENT_REQUIRED);
-            boolean twoArgumentsRequired = ((flags & CLOptionDescriptor.ARGUMENTS_REQUIRED_2)
== CLOptionDescriptor.ARGUMENTS_REQUIRED_2);
+            boolean argumentOptional = (flags & CLOptionDescriptor.ARGUMENT_OPTIONAL)
== CLOptionDescriptor.ARGUMENT_OPTIONAL;
+            boolean argumentRequired = (flags & CLOptionDescriptor.ARGUMENT_REQUIRED)
== CLOptionDescriptor.ARGUMENT_REQUIRED;
+            boolean twoArgumentsRequired = (flags & CLOptionDescriptor.ARGUMENTS_REQUIRED_2)
== CLOptionDescriptor.ARGUMENTS_REQUIRED_2;
             boolean needComma = false;
             if (twoArgumentsRequired) {
                 argumentRequired = true;

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java?rev=1776887&r1=1776886&r2=1776887&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java Sun Jan  1 21:27:02
2017
@@ -356,7 +356,7 @@ public class Data implements Serializabl
      * @return True if there is another row. False if there are no more rows.
      */
     public boolean next() {
-        return (++currentPos < size);
+        return ++currentPos < size;
     }
 
     /**
@@ -397,7 +397,7 @@ public class Data implements Serializabl
      * @return True if there is another row. False if there are no more rows.
      */
     public boolean previous() {
-        return (--currentPos >= 0);
+        return --currentPos >= 0;
     }
 
     /**

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java?rev=1776887&r1=1776886&r2=1776887&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java Sun Jan  1
21:27:02 2017
@@ -204,7 +204,7 @@ public class ListedHashTree extends Hash
             return false;
         }
         ListedHashTree lht = (ListedHashTree) o;
-        return (super.equals(lht) && order.equals(lht.order));
+        return super.equals(lht) && order.equals(lht.order);
     }
 
 

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java?rev=1776887&r1=1776886&r2=1776887&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java Sun Jan  1 21:27:02
2017
@@ -331,7 +331,7 @@ public final class JOrphanUtils {
      * @return slice from the input array
      */
     public static byte[] getByteArraySlice(byte[] array, int begin, int end) {
-        byte[] slice = new byte[(end - begin + 1)];
+        byte[] slice = new byte[end - begin + 1];
         System.arraycopy(array, begin, slice, 0, slice.length);
         return slice;
     }
@@ -494,7 +494,7 @@ public final class JOrphanUtils {
     public static int read(InputStream is, byte[] buffer, int offset, int length) throws
IOException {
         int remaining = length;
         while ( remaining > 0 ) {
-            int location = ( length - remaining );
+            int location = length - remaining;
             int count = is.read( buffer, location, remaining );
             if ( -1 == count ) { // EOF
                 break;
@@ -525,7 +525,7 @@ public final class JOrphanUtils {
                     builder.append(stackTraceElement.getClassName()+"#"+stackTraceElement.getMethodName()+
                             (lineNumber >=0 ? " at line:"+ stackTraceElement.getLineNumber()
: "")+lineSeparator);
                 }
-                System.out.println(e.getKey().toString()+((daemon ? " (daemon)" : ""))+",
stackTrace:"+ builder.toString());
+                System.out.println(e.getKey().toString()+(daemon ? " (daemon)" : "")+", stackTrace:"+
builder.toString());
             }
         }
     }



Mime
View raw message