Repository: commons-pool Updated Branches: refs/heads/master 848500e97 -> ca327dffb
Use a multi-catch clause instead of individual catch clauses. Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/ca327dff Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/ca327dff Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/ca327dff Branch: refs/heads/master Commit: ca327dffbb807254fd57f38680f459fc9481cdf8 Parents: 848500e Author: Gary Gregory <[email protected]> Authored: Thu Apr 5 13:48:12 2018 -0600 Committer: Gary Gregory <[email protected]> Committed: Thu Apr 5 13:48:12 2018 -0600 ---------------------------------------------------------------------- .../apache/commons/pool2/impl/BaseGenericObjectPool.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/ca327dff/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java index d2bb641..365a984 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java @@ -935,9 +935,7 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject { try { ManagementFactory.getPlatformMBeanServer().unregisterMBean( oname); - } catch (final MBeanRegistrationException e) { - swallowException(e); - } catch (final InstanceNotFoundException e) { + } catch (final MBeanRegistrationException | InstanceNotFoundException e) { swallowException(e); } } @@ -993,10 +991,7 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject { } catch (final InstanceAlreadyExistsException e) { // Increment the index and try again i++; - } catch (final MBeanRegistrationException e) { - // Shouldn't happen. Skip registration if it does. - registered = true; - } catch (final NotCompliantMBeanException e) { + } catch (final MBeanRegistrationException | NotCompliantMBeanException e) { // Shouldn't happen. Skip registration if it does. registered = true; }
