From 3b84b587d442340c5cffa108e5fda34fa7b507b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 19 May 2018 01:58:43 +0200 Subject: [PATCH] Continued: - made more local variables final MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../exceptions/CustomExceptionHandler.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/org/mxchange/jcoreee/exceptions/CustomExceptionHandler.java b/src/org/mxchange/jcoreee/exceptions/CustomExceptionHandler.java index 37716a1..e1f0a1e 100644 --- a/src/org/mxchange/jcoreee/exceptions/CustomExceptionHandler.java +++ b/src/org/mxchange/jcoreee/exceptions/CustomExceptionHandler.java @@ -93,36 +93,35 @@ public class CustomExceptionHandler extends ExceptionHandlerWrapper { final Iterator iterator = this.getUnhandledExceptionQueuedEvents().iterator(); while (iterator.hasNext()) { - ExceptionQueuedEvent event = iterator.next(); - ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); + final ExceptionQueuedEvent event = iterator.next(); + final ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); - // get the exception from context - Throwable t = context.getException(); + // Get the exception from context + final Throwable t = context.getException(); final FacesContext facesContext = FacesContext.getCurrentInstance(); final Map requestMap = facesContext.getExternalContext().getRequestMap(); final NavigationHandler nav = facesContext.getApplication().getNavigationHandler(); - //here you do what ever you want with exception + // Here you do what ever you want with exception try { - - //log error ? + // Log error ? this.loggerBeanLocal.logFatal("Critical Exception.", t); //NOI18N - //redirect error page + // Redirect error page requestMap.put("exceptionMessage", t.getMessage()); //NOI18N nav.handleNavigation(facesContext, null, "exception"); //NOI18N facesContext.renderResponse(); - // remove the comment below if you want to report the error in a jsf error message + // Remove the comment below if you want to report the error in a jsf error message // @TODO: JsfUtil.addErrorMessage(t.getMessage()); } finally { - //remove it from queue + // Remove it from queue iterator.remove(); } } - //parent hanle + // Parent hanle this.getWrapped().handle(); } -- 2.39.5