jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1749193 - in /jmeter/trunk/src: core/org/apache/jmeter/reporters/ResultCollector.java protocol/http/org/apache/jmeter/protocol/http/sampler/JMeterClientConnectionOperator.java
Date Sun, 19 Jun 2016 19:01:49 GMT
Author: fschumacher
Date: Sun Jun 19 19:01:49 2016
New Revision: 1749193

URL: http://svn.apache.org/viewvc?rev=1749193&view=rev
Log:
Use multi-catch for exceptions. Patch by Graham Russell.
Part of #174 from github pr.

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/JMeterClientConnectionOperator.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java?rev=1749193&r1=1749192&r2=1749193&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java Sun Jun 19 19:01:49
2016
@@ -56,8 +56,6 @@ import org.apache.jorphan.util.JMeterErr
 import org.apache.jorphan.util.JOrphanUtils;
 import org.apache.log.Logger;
 
-import com.thoughtworks.xstream.converters.ConversionException;
-
 /**
  * This class handles all saving of samples.
  * The class must be thread-safe because it is shared between threads (NoThreadClone).
@@ -386,16 +384,14 @@ public class ResultCollector extends Abs
                             SaveService.loadTestResults(bufferedInputStream,
                                     new ResultCollectorHelper(this, visualizer));
                             parsedOK = true;
-                        } catch (ConversionException e) {
-                            log.warn("Failed to load "+filename+" using XStream. Error was:
"+e);
                         } catch (Exception e) {
-                            log.warn("Failed to load "+filename+" using XStream. Error was:
"+e);
+                            log.warn("Failed to load " + filename + " using XStream. Error
was: " + e);
                         }
                     }
                 }
             } catch (IOException | JMeterError | RuntimeException | OutOfMemoryError e) {
                 // FIXME Why do we catch OOM ?
-                log.warn("Problem reading JTL file: "+file);
+                log.warn("Problem reading JTL file: " + file);
             } finally {
                 JOrphanUtils.closeQuietly(dataReader);
                 JOrphanUtils.closeQuietly(bufferedInputStream);

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/JMeterClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/JMeterClientConnectionOperator.java?rev=1749193&r1=1749192&r2=1749193&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/JMeterClientConnectionOperator.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/JMeterClientConnectionOperator.java
Sun Jun 19 19:01:49 2016
@@ -112,9 +112,7 @@ public class JMeterClientConnectionOpera
             Method s = null;
             try {
                 s = cls.getMethod("setHost", String.class);
-            } catch (SecurityException e) {
-                initFail(e);
-            } catch (NoSuchMethodException e) {
+            } catch (SecurityException | NoSuchMethodException e) {
                 initFail(e);
             }
             CURRENT.set(new HostNameSetter(cls, s));
@@ -154,11 +152,9 @@ public class JMeterClientConnectionOpera
             if (setter != null) {
                 try {
                     setter.invoke(sslsock, hostname);
-                } catch (IllegalArgumentException e) {
-                    setServerNameIndicationFail(e);
-                } catch (IllegalAccessException e) {
-                    setServerNameIndicationFail(e);
-                } catch (InvocationTargetException e) {
+                } catch (IllegalArgumentException
+                        | IllegalAccessException
+                        | InvocationTargetException e) {
                     setServerNameIndicationFail(e);
                 }
             }



Mime
View raw message