Repository: commons-lang
Updated Branches:
  refs/heads/master 04a2a4b45 -> 21810dc92


ObjectUtilsTest: collapse empty catch blocks

This patch employs Java 7's syntax to catch multiple exceptions in
the same block with the | operator to make ObjectUtilsTest's code
cleaner and easier to read.


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/07811434
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/07811434
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/07811434

Branch: refs/heads/master
Commit: 07811434b773b6e1737fe7dd3775aeab8afb18b8
Parents: 04a2a4b
Author: Allon Mureinik <amure...@redhat.com>
Authored: Sat Feb 11 21:35:16 2017 +0200
Committer: Allon Mureinik <amure...@redhat.com>
Committed: Sat Feb 11 21:35:16 2017 +0200

----------------------------------------------------------------------
 src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/07811434/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java 
b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
index fc4e9c5..1f3ae54 100644
--- a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
@@ -301,15 +301,13 @@ public class ObjectUtilsTest {
         try {
             ObjectUtils.identityToString((Appendable)null, "tmp");
             fail("NullPointerException expected");
-        } catch(final NullPointerException npe) {
-        } catch (final IOException ex) {
+        } catch(final NullPointerException | IOException npe) {
         }
-        
+
         try {
             ObjectUtils.identityToString((Appendable)(new StringBuilder()), 
null);
             fail("NullPointerException expected");
-        } catch(final NullPointerException npe) {
-        } catch (final IOException ex) {
+        } catch(final NullPointerException | IOException npe) {
         }
     }
 

Reply via email to