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

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwebbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d0264b  collapse likewise catches
7d0264b is described below

commit 7d0264ba9a981160d13e224a2bf32efcda314bb3
Author: Mark Struberg <strub...@apache.org>
AuthorDate: Sun Jun 7 22:49:50 2020 +0200

    collapse likewise catches
    
    no funcational change
---
 .../apache/webbeans/ee/event/TransactionalEventNotifier.java |  9 +--------
 .../main/java/org/apache/webbeans/config/BeansDeployer.java  | 12 ++----------
 .../java/org/apache/webbeans/config/WebBeansContext.java     |  6 +-----
 .../java/org/apache/webbeans/container/BeanManagerImpl.java  | 10 +---------
 .../webbeans/corespi/security/ManagedSecurityService.java    |  6 +-----
 .../org/apache/webbeans/proxy/NormalScopeProxyFactory.java   | 10 +---------
 .../factory/InterceptorDecoratorProxyFactoryTest.java        |  6 +-----
 .../test/interceptors/lifecycle/InterceptorExtension.java    |  4 +---
 .../webbeans/web/tomcat7/ContextLifecycleListener.java       |  6 +-----
 9 files changed, 10 insertions(+), 59 deletions(-)

diff --git 
a/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java
 
b/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java
index 18d7ad9..0c339f9 100644
--- 
a/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java
+++ 
b/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java
@@ -119,14 +119,7 @@ public final class TransactionalEventNotifier
         {
             transaction.registerSynchronization(synchronization);
         }
-        catch (RollbackException re)
-        {
-            if (immediateOnError)
-            {
-                synchronization.notifyObserver();
-            }
-        }
-        catch (IllegalStateException ise)
+        catch (RollbackException | IllegalStateException re)
         {
             if (immediateOnError)
             {
diff --git 
a/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java 
b/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
index 370a8fe..d3fdf09 100644
--- a/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
+++ b/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
@@ -330,19 +330,11 @@ public class BeansDeployer
                 webBeansContext.getAnnotationManager().clearCaches();
             }
         }
-        catch (UnsatisfiedResolutionException e)
+        catch (UnsatisfiedResolutionException | UnproxyableResolutionException 
| AmbiguousResolutionException e)
         {
             throw new WebBeansDeploymentException(e);
         }
-        catch (AmbiguousResolutionException e)
-        {
-            throw new WebBeansDeploymentException(e);
-        }
-        catch (UnproxyableResolutionException e)
-        {
-            // the tck expects a DeploymentException, but it really should be 
a DefinitionException, see i.e. https://issues.jboss.org/browse/CDITCK-346
-            throw new WebBeansDeploymentException(e);
-        }
+        // the tck expects a DeploymentException, but it really should be a 
DefinitionException, see i.e. https://issues.jboss.org/browse/CDITCK-346
         catch (IllegalArgumentException e)
         {
             throw new WebBeansConfigurationException(e);
diff --git 
a/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java 
b/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
index c12eff6..8d4976e 100644
--- 
a/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
+++ 
b/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
@@ -600,11 +600,7 @@ public class WebBeansContext
                 throw new WebBeansException("No suitable constructor : " + 
clazz.getName(), e.getCause());
             }
         }
-        catch (InstantiationException e)
-        {
-            throw new WebBeansException("Unable to instantiate class : " + 
clazz.getName(), e.getCause());
-        }
-        catch (InvocationTargetException e)
+        catch (InstantiationException | InvocationTargetException e)
         {
             throw new WebBeansException("Unable to instantiate class : " + 
clazz.getName(), e.getCause());
         }
diff --git 
a/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
 
b/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
index 93e416b..22ee614 100644
--- 
a/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
+++ 
b/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
@@ -1252,15 +1252,7 @@ public class BeanManagerImpl implements BeanManager, 
Referenceable
             {
                 
webBeansContext.getWebBeansUtil().validate(injectionTarget.getInjectionPoints(),
 null);
             }
-            catch (InjectionException ie)
-            {
-                throw new IllegalArgumentException(ie);
-            }
-            catch (WebBeansConfigurationException ie)
-            {
-                throw new IllegalArgumentException(ie);
-            }
-            catch (DeploymentException ie)
+            catch (InjectionException | DeploymentException | 
WebBeansConfigurationException ie)
             {
                 throw new IllegalArgumentException(ie);
             }
diff --git 
a/webbeans-impl/src/main/java/org/apache/webbeans/corespi/security/ManagedSecurityService.java
 
b/webbeans-impl/src/main/java/org/apache/webbeans/corespi/security/ManagedSecurityService.java
index 2c0abce..be6218a 100644
--- 
a/webbeans-impl/src/main/java/org/apache/webbeans/corespi/security/ManagedSecurityService.java
+++ 
b/webbeans-impl/src/main/java/org/apache/webbeans/corespi/security/ManagedSecurityService.java
@@ -367,11 +367,7 @@ public class ManagedSecurityService implements 
SecurityService
             {
                 return clazz.newInstance();
             }
-            catch (InstantiationException e)
-            {
-                throw e;
-            }
-            catch (IllegalAccessException e)
+            catch (InstantiationException | IllegalAccessException e)
             {
                 throw e;
             }
diff --git 
a/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
 
b/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
index 8d5a57e..1953ff8 100644
--- 
a/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
+++ 
b/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
@@ -177,15 +177,7 @@ public class NormalScopeProxyFactory extends 
AbstractProxyFactory
         {
             throw new WebBeansConfigurationException("Configured 
InterceptorHandler " + className +" cannot be found", e);
         }
-        catch (InvocationTargetException e)
-        {
-            throw new WebBeansConfigurationException("Configured 
InterceptorHandler " + className +" creation exception", e);
-        }
-        catch (InstantiationException e)
-        {
-            throw new WebBeansConfigurationException("Configured 
InterceptorHandler " + className +" creation exception", e);
-        }
-        catch (IllegalAccessException e)
+        catch (InvocationTargetException | IllegalAccessException | 
InstantiationException e)
         {
             throw new WebBeansConfigurationException("Configured 
InterceptorHandler " + className +" creation exception", e);
         }
diff --git 
a/webbeans-impl/src/test/java/org/apache/webbeans/test/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
 
b/webbeans-impl/src/test/java/org/apache/webbeans/test/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
index ea3ca5e..5d7b9f6 100644
--- 
a/webbeans-impl/src/test/java/org/apache/webbeans/test/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
+++ 
b/webbeans-impl/src/test/java/org/apache/webbeans/test/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
@@ -252,11 +252,7 @@ public class InterceptorDecoratorProxyFactoryTest extends 
AbstractUnitTest
             {
                 return method.invoke(instance, args);
             }
-            catch (IllegalAccessException e)
-            {
-                throw new WebBeansException(e);
-            }
-            catch (InvocationTargetException e)
+            catch (IllegalAccessException | InvocationTargetException e)
             {
                 throw new WebBeansException(e);
             }
diff --git 
a/webbeans-impl/src/test/java/org/apache/webbeans/test/interceptors/lifecycle/InterceptorExtension.java
 
b/webbeans-impl/src/test/java/org/apache/webbeans/test/interceptors/lifecycle/InterceptorExtension.java
index cd327f2..3ac904f 100644
--- 
a/webbeans-impl/src/test/java/org/apache/webbeans/test/interceptors/lifecycle/InterceptorExtension.java
+++ 
b/webbeans-impl/src/test/java/org/apache/webbeans/test/interceptors/lifecycle/InterceptorExtension.java
@@ -197,9 +197,7 @@ public class InterceptorExtension implements Extension
             try {
                 this.declaringType = declaringType;
                 this.javaMember = 
declaringType.getJavaClass().getConstructor();
-            } catch (SecurityException e) {
-                ExceptionUtil.throwAsRuntimeException(e);
-            } catch (NoSuchMethodException e) {
+            } catch (SecurityException | NoSuchMethodException e) {
                 ExceptionUtil.throwAsRuntimeException(e);
             }
         }
diff --git 
a/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/ContextLifecycleListener.java
 
b/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/ContextLifecycleListener.java
index 9f1066e..4511b89 100644
--- 
a/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/ContextLifecycleListener.java
+++ 
b/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/ContextLifecycleListener.java
@@ -141,11 +141,7 @@ public class ContextLifecycleListener implements 
LifecycleListener, ServletConte
                 StandardContext context = (StandardContext) 
getContext(servletContextAttributeEvent.getServletContext());
                 wrapInstanceManager(context);
             }
-            catch (NoSuchFieldException e)
-            {
-                throw new WebBeansException(e.getMessage(), e);
-            }
-            catch (IllegalAccessException e)
+            catch (NoSuchFieldException | IllegalAccessException e)
             {
                 throw new WebBeansException(e.getMessage(), e);
             }

Reply via email to