You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2016/12/28 17:34:24 UTC

svn commit: r1776308 - /jmeter/trunk/src/core/org/apache/jmeter/samplers/RemoteListenerWrapper.java

Author: pmouawad
Date: Wed Dec 28 17:34:24 2016
New Revision: 1776308

URL: http://svn.apache.org/viewvc?rev=1776308&view=rev
Log:
sonar: fix errors and ignore false positive

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/samplers/RemoteListenerWrapper.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/RemoteListenerWrapper.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/RemoteListenerWrapper.java?rev=1776308&r1=1776307&r2=1776308&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/RemoteListenerWrapper.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/RemoteListenerWrapper.java Wed Dec 28 17:34:24 2016
@@ -61,16 +61,12 @@ public class RemoteListenerWrapper exten
         log.debug("Test Started()");
         try {
             listener.testStarted();
-        } catch (Throwable ex) {
-            log.warn("testStarted()", ex);
-            if (ex instanceof Error){
-                throw (Error) ex;
-            }
-            if (ex instanceof RuntimeException){
-                throw (RuntimeException) ex;
-            }
+        } catch (Error | RuntimeException ex) { // NOSONAR We want to have errors logged in log file
+            log.error("testStarted()", ex);
+            throw ex;
+        } catch (Exception ex) {
+            log.error("testStarted()", ex);
         }
-
     }
 
     @Override
@@ -83,14 +79,11 @@ public class RemoteListenerWrapper exten
         log.debug("Test Started on " + host);
         try {
             listener.testStarted(host);
-        } catch (Throwable ex) {
-            log.error("testStarted(host)", ex);
-            if (ex instanceof Error){
-                throw (Error) ex;
-            }
-            if (ex instanceof RuntimeException){
-                throw (RuntimeException) ex;
-            }
+        } catch (Error | RuntimeException ex) { // NOSONAR We want to have errors logged in log file
+            log.error("testStarted(host) on "+host, ex);
+            throw ex;
+        } catch(Exception ex) {
+            log.error("testStarted(host) on "+host, ex);
         }
     }