Commit a866e22269500094d7c7311e357a8e4ba209074c
1 parent
791b218e
Exists in
master
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.
Showing
1 changed file
with
9 additions
and
4 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java
| ... | ... | @@ -74,7 +74,7 @@ public class ExceptionHandlerInterceptor implements Serializable { |
| 74 | 74 | |
| 75 | 75 | private final Map<Class<?>, Map<Class<?>, Method>> cache = new HashMap<Class<?>, Map<Class<?>, Method>>(); |
| 76 | 76 | |
| 77 | - private final boolean handleException(final Exception cause, final InvocationContext ic) throws Throwable { | |
| 77 | + private final boolean handleException(final Exception cause, final InvocationContext ic) throws Exception { | |
| 78 | 78 | logger.info(bundle.getString("handling-exception", cause.getClass().getCanonicalName())); |
| 79 | 79 | |
| 80 | 80 | boolean handled = false; |
| ... | ... | @@ -164,21 +164,26 @@ public class ExceptionHandlerInterceptor implements Serializable { |
| 164 | 164 | return cache.containsKey(type); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - private final void invoke(final Method method, final Object object, final Exception param) throws Throwable { | |
| 167 | + private final void invoke(final Method method, final Object object, final Exception param) throws Exception { | |
| 168 | 168 | boolean accessible = method.isAccessible(); |
| 169 | 169 | method.setAccessible(true); |
| 170 | 170 | |
| 171 | 171 | try { |
| 172 | 172 | method.invoke(object, param); |
| 173 | 173 | } catch (InvocationTargetException cause) { |
| 174 | - throw cause.getTargetException(); | |
| 174 | + Throwable targetTrowable = cause.getTargetException(); | |
| 175 | + if (targetTrowable instanceof Exception) { | |
| 176 | + throw (Exception) targetTrowable; | |
| 177 | + } else { | |
| 178 | + throw new Exception(targetTrowable); | |
| 179 | + } | |
| 175 | 180 | } |
| 176 | 181 | |
| 177 | 182 | method.setAccessible(accessible); |
| 178 | 183 | } |
| 179 | 184 | |
| 180 | 185 | @AroundInvoke |
| 181 | - public Object manage(final InvocationContext ic) throws Throwable { | |
| 186 | + public Object manage(final InvocationContext ic) throws Exception { | |
| 182 | 187 | Object result = null; |
| 183 | 188 | |
| 184 | 189 | try { | ... | ... |