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/02/10 22:02:04 UTC

svn commit: r1729734 - in /jmeter/trunk/test/src/org/apache: jmeter/visualizers/GenerateTreeGui.java jorphan/test/AllTests.java

Author: pmouawad
Date: Wed Feb 10 21:02:03 2016
New Revision: 1729734

URL: http://svn.apache.org/viewvc?rev=1729734&view=rev
Log:
Use multi-catch where possible
Patch by Graham Russell PART 4
https://github.com/apache/jmeter/pull/110

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/visualizers/GenerateTreeGui.java
    jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java

Modified: jmeter/trunk/test/src/org/apache/jmeter/visualizers/GenerateTreeGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/visualizers/GenerateTreeGui.java?rev=1729734&r1=1729733&r2=1729734&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/visualizers/GenerateTreeGui.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/visualizers/GenerateTreeGui.java Wed Feb 10 21:02:03 2016
@@ -220,9 +220,7 @@ public class GenerateTreeGui extends Abs
         } else {
             try {
                 SwingUtilities.invokeAndWait(runnable);
-            } catch (InterruptedException e) {
-                throw new Error(e);
-            } catch (InvocationTargetException e) {
+            } catch (InterruptedException | InvocationTargetException e) {
                 throw new Error(e);
             }
         }

Modified: jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java?rev=1729734&r1=1729733&r2=1729734&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java (original)
+++ jmeter/trunk/test/src/org/apache/jorphan/test/AllTests.java Wed Feb 10 21:02:03 2016
@@ -244,8 +244,6 @@ public final class AllTests {
                 inputStream = new FileInputStream(args[1]);
                 props.load(inputStream);
                 LoggingManager.initializeLogging(props);
-            } catch (FileNotFoundException e) {
-                System.out.println(e.getLocalizedMessage());
             } catch (IOException e) {
                 System.out.println(e.getLocalizedMessage());
             } finally {
@@ -271,13 +269,8 @@ public final class AllTests {
                 UnitTestManager um = (UnitTestManager) Class.forName(args[2]).newInstance();
                 System.out.println("Setting up initial properties using: " + args[1]);
                 um.initializeProperties(args[1]);
-            } catch (ClassNotFoundException e) {
-                System.out.println("Couldn't create: " + args[2]);
-                e.printStackTrace();
-            } catch (InstantiationException e) {
-                System.out.println("Couldn't create: " + args[2]);
-                e.printStackTrace();
-            } catch (IllegalAccessException e) {
+            } catch (ClassNotFoundException | IllegalAccessException
+                    | InstantiationException e) {
                 System.out.println("Couldn't create: " + args[2]);
                 e.printStackTrace();
             }
@@ -316,14 +309,11 @@ public final class AllTests {
                         isJunitTest = checkForJUnitAnnotations(c);
                     }
                 }
-            } catch (UnsupportedClassVersionError ignored) {
-                log.debug(ignored.getLocalizedMessage());
-            } catch (NoClassDefFoundError ignored) {
-                log.debug(ignored.getLocalizedMessage());
-            } catch (ClassNotFoundException ignored) {
-                log.debug(ignored.getLocalizedMessage());
+            } catch (UnsupportedClassVersionError | ClassNotFoundException
+                    | NoClassDefFoundError e) {
+                log.debug(e.getLocalizedMessage());
             }
-            
+
             return isJunitTest;
         }