commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [2/2] [lang] LANG-1279: Update Java requirement from Java 6 to 7
Date Sun, 23 Oct 2016 20:40:16 GMT
LANG-1279: Update Java requirement from Java 6 to 7

use multi-catch in AnnotationUtils and ExceptionUtils


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

Branch: refs/heads/master
Commit: 383bc8eefae7e17d0bb0349ab2300488c655ec42
Parents: f9cab27
Author: pascalschumacher <pascalschumacher@gmx.net>
Authored: Sun Oct 23 22:40:07 2016 +0200
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Sun Oct 23 22:40:07 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/commons/lang3/AnnotationUtils.java    |  4 +---
 .../apache/commons/lang3/exception/ExceptionUtils.java    | 10 ++--------
 2 files changed, 3 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/383bc8ee/src/main/java/org/apache/commons/lang3/AnnotationUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/AnnotationUtils.java b/src/main/java/org/apache/commons/lang3/AnnotationUtils.java
index 2c67458..81bd0f0 100644
--- a/src/main/java/org/apache/commons/lang3/AnnotationUtils.java
+++ b/src/main/java/org/apache/commons/lang3/AnnotationUtils.java
@@ -143,9 +143,7 @@ public class AnnotationUtils {
                     }
                 }
             }
-        } catch (final IllegalAccessException ex) {
-            return false;
-        } catch (final InvocationTargetException ex) {
+        } catch (final IllegalAccessException | InvocationTargetException ex) {
             return false;
         }
         return true;

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/383bc8ee/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
index 7a1d810..5866df9 100644
--- a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
+++ b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
@@ -198,20 +198,14 @@ public class ExceptionUtils {
         Method method = null;
         try {
             method = throwable.getClass().getMethod(methodName);
-        } catch (final NoSuchMethodException ignored) { // NOPMD
-            // exception ignored
-        } catch (final SecurityException ignored) { // NOPMD
+        } catch (final NoSuchMethodException | SecurityException ignored) { // NOPMD
             // exception ignored
         }
 
         if (method != null && Throwable.class.isAssignableFrom(method.getReturnType()))
{
             try {
                 return (Throwable) method.invoke(throwable);
-            } catch (final IllegalAccessException ignored) { // NOPMD
-                // exception ignored
-            } catch (final IllegalArgumentException ignored) { // NOPMD
-                // exception ignored
-            } catch (final InvocationTargetException ignored) { // NOPMD
+            } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException
ignored) { // NOPMD
                 // exception ignored
             }
         }


Mime
View raw message