jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1828104 - in /jmeter/trunk/src/core/org/apache/jmeter/threads: ListenerNotifier.java ThreadGroup.java
Date Sat, 31 Mar 2018 12:36:26 GMT
Author: pmouawad
Date: Sat Mar 31 12:36:26 2018
New Revision: 1828104

URL: http://svn.apache.org/viewvc?rev=1828104&view=rev
Log:
Fix SONAR warnings:
- About non serializable properties
- About misplaced method

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/threads/ListenerNotifier.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/ListenerNotifier.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/ListenerNotifier.java?rev=1828104&r1=1828103&r2=1828104&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/ListenerNotifier.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/ListenerNotifier.java Sat Mar 31 12:36:26
2018
@@ -29,6 +29,7 @@
 
 package org.apache.jmeter.threads;
 
+import java.io.Serializable;
 import java.util.List;
 
 import org.apache.jmeter.samplers.SampleEvent;
@@ -44,7 +45,11 @@ import org.slf4j.LoggerFactory;
  * using {@link #notifyListeners(SampleEvent, List)} <br>
  * Thread safe class 
  */
-public class ListenerNotifier {
+public class ListenerNotifier implements Serializable {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -4861457279068497917L;
     private static final Logger log = LoggerFactory.getLogger(ListenerNotifier.class);
 
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java?rev=1828104&r1=1828103&r2=1828104&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java Sat Mar 31 12:36:26 2018
@@ -20,7 +20,6 @@ package org.apache.jmeter.threads;
 
 import java.io.IOException;
 import java.io.ObjectInputStream;
-import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
@@ -76,7 +75,7 @@ public class ThreadGroup extends Abstrac
     private transient Thread threadStarter;
 
     // List of active threads
-    private final Map<JMeterThread, Thread> allThreads = new ConcurrentHashMap<>();
+    private final ConcurrentHashMap<JMeterThread, Thread> allThreads = new ConcurrentHashMap<>();
     
     private transient Object addThreadLock = new Object();
 
@@ -515,18 +514,6 @@ public class ThreadGroup extends Abstrac
     }
 
     /**
-     * Pause ms milliseconds
-     * @param ms long milliseconds
-     */
-    private void pause(long ms){
-        try {
-            TimeUnit.MILLISECONDS.sleep(ms);
-        } catch (InterruptedException e) {
-            Thread.currentThread().interrupt();
-        }
-    }
-
-    /**
      * Starts Threads using ramp up
      */
     class ThreadStarter implements Runnable {
@@ -544,7 +531,19 @@ public class ThreadGroup extends Abstrac
             // Store context from Root Thread to pass it to created threads
             this.context = JMeterContextService.getContext();
         }
-        
+
+        /**
+         * Pause ms milliseconds
+         * @param ms long milliseconds
+         */
+        private void pause(long ms){
+            try {
+                TimeUnit.MILLISECONDS.sleep(ms);
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+            }
+        }
+
         /**
          * Wait for delay with RAMPUP_GRANULARITY
          * @param delay delay in ms



Mime
View raw message