From a866e22269500094d7c7311e357a8e4ba209074c Mon Sep 17 00:00:00 2001 From: Thiago Soares Date: Tue, 27 Dec 2011 12:11:18 -0200 Subject: [PATCH] Adequacao da assinatura do metodo "manage" da classe "br.gov.frameworkdemoiselle.internal.interceptor.ExceptionHandlerInterceptor" conforme a especificacao JSR-000318. O metodo foi alterado para lancar Exception ao inves de Throwable. Mantis 0000744. --- impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java index 5ef13eb..e3bbfb1 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java @@ -74,7 +74,7 @@ public class ExceptionHandlerInterceptor implements Serializable { private final Map, Map, Method>> cache = new HashMap, Map, Method>>(); - private final boolean handleException(final Exception cause, final InvocationContext ic) throws Throwable { + private final boolean handleException(final Exception cause, final InvocationContext ic) throws Exception { logger.info(bundle.getString("handling-exception", cause.getClass().getCanonicalName())); boolean handled = false; @@ -164,21 +164,26 @@ public class ExceptionHandlerInterceptor implements Serializable { return cache.containsKey(type); } - private final void invoke(final Method method, final Object object, final Exception param) throws Throwable { + private final void invoke(final Method method, final Object object, final Exception param) throws Exception { boolean accessible = method.isAccessible(); method.setAccessible(true); try { method.invoke(object, param); } catch (InvocationTargetException cause) { - throw cause.getTargetException(); + Throwable targetTrowable = cause.getTargetException(); + if (targetTrowable instanceof Exception) { + throw (Exception) targetTrowable; + } else { + throw new Exception(targetTrowable); + } } method.setAccessible(accessible); } @AroundInvoke - public Object manage(final InvocationContext ic) throws Throwable { + public Object manage(final InvocationContext ic) throws Exception { Object result = null; try { -- libgit2 0.21.2