You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/01/08 14:22:29 UTC

[commons-beanutils] branch master updated: Collapse multiple identical catch clauses into one.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git


The following commit(s) were added to refs/heads/master by this push:
     new 318ad11  Collapse multiple identical catch clauses into one.
318ad11 is described below

commit 318ad119665b9b69748026a045479c532640752f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jan 8 09:22:24 2021 -0500

    Collapse multiple identical catch clauses into one.
---
 .../apache/commons/beanutils2/LazyDynaBeanTestCase.java  | 16 ++--------------
 .../apache/commons/beanutils2/LazyDynaMapTestCase.java   | 16 ++--------------
 2 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/src/test/java/org/apache/commons/beanutils2/LazyDynaBeanTestCase.java b/src/test/java/org/apache/commons/beanutils2/LazyDynaBeanTestCase.java
index a1bba77..22e4872 100644
--- a/src/test/java/org/apache/commons/beanutils2/LazyDynaBeanTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/LazyDynaBeanTestCase.java
@@ -221,13 +221,7 @@ public class LazyDynaBeanTestCase extends TestCase {
         try {
           PropertyUtils.setProperty(bean, testProperty+"("+testKey+")", testString1);
         }
-        catch (final NoSuchMethodException ex) {
-            fail("testIndexedPropertyUtils threw "+ex);
-        }
-        catch (final InvocationTargetException ex) {
-            fail("testIndexedPropertyUtils threw "+ex);
-        }
-        catch (final IllegalAccessException ex) {
+        catch (final NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) {
             fail("testIndexedPropertyUtils threw "+ex);
         }
 
@@ -443,13 +437,7 @@ public class LazyDynaBeanTestCase extends TestCase {
         try {
           PropertyUtils.setProperty(bean, testProperty+"["+index+"]", testString1);
         }
-        catch (final NoSuchMethodException ex) {
-            fail("testIndexedPropertyUtils threw "+ex);
-        }
-        catch (final InvocationTargetException ex) {
-            fail("testIndexedPropertyUtils threw "+ex);
-        }
-        catch (final IllegalAccessException ex) {
+        catch (final NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) {
             fail("testIndexedPropertyUtils threw "+ex);
         }
 
diff --git a/src/test/java/org/apache/commons/beanutils2/LazyDynaMapTestCase.java b/src/test/java/org/apache/commons/beanutils2/LazyDynaMapTestCase.java
index 9817387..7ae2b29 100644
--- a/src/test/java/org/apache/commons/beanutils2/LazyDynaMapTestCase.java
+++ b/src/test/java/org/apache/commons/beanutils2/LazyDynaMapTestCase.java
@@ -211,13 +211,7 @@ public class LazyDynaMapTestCase extends TestCase {
         try {
           PropertyUtils.setProperty(dynaMap, testProperty+"("+testKey+")", testString1);
         }
-        catch (final NoSuchMethodException ex) {
-            fail("testIndexedPropertyUtils threw "+ex);
-        }
-        catch (final InvocationTargetException ex) {
-            fail("testIndexedPropertyUtils threw "+ex);
-        }
-        catch (final IllegalAccessException ex) {
+        catch (final NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) {
             fail("testIndexedPropertyUtils threw "+ex);
         }
 
@@ -433,13 +427,7 @@ public class LazyDynaMapTestCase extends TestCase {
         try {
           PropertyUtils.setProperty(dynaMap, testProperty+"["+index+"]", testString1);
         }
-        catch (final NoSuchMethodException ex) {
-            fail("testIndexedPropertyUtils threw "+ex);
-        }
-        catch (final InvocationTargetException ex) {
-            fail("testIndexedPropertyUtils threw "+ex);
-        }
-        catch (final IllegalAccessException ex) {
+        catch (final NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) {
             fail("testIndexedPropertyUtils threw "+ex);
         }