From 52ce72b22ef8d92a1f35b4993bcddaaa66d67350 Mon Sep 17 00:00:00 2001
From: Roberto Sánchez <roberto.sanchez@curisit.net>
Date: Thu, 18 Sep 2014 17:55:35 +0000
Subject: [PATCH] #396 fix - Fixed some SonarQube issues

---
 securis/src/main/java/net/curisit/securis/DefaultExceptionHandler.java |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/securis/src/main/java/net/curisit/securis/DefaultExceptionHandler.java b/securis/src/main/java/net/curisit/securis/DefaultExceptionHandler.java
index 9c193a1..b7c52bd 100644
--- a/securis/src/main/java/net/curisit/securis/DefaultExceptionHandler.java
+++ b/securis/src/main/java/net/curisit/securis/DefaultExceptionHandler.java
@@ -17,12 +17,12 @@
 
 @Provider
 public class DefaultExceptionHandler implements ExceptionMapper<Exception> {
-	private static final Logger log = LogManager.getLogger(DefaultExceptionHandler.class);
+	private static final Logger LOG = LogManager.getLogger(DefaultExceptionHandler.class);
 
 	public static final String ERROR_MESSAGE_HEADER = "X-SECURIS-ERROR";
 
 	public DefaultExceptionHandler() {
-		log.info("Creating DefaultExceptionHandler ");
+		LOG.info("Creating DefaultExceptionHandler ");
 	}
 
 	@Context
@@ -32,21 +32,19 @@
 
 	@Override
 	public Response toResponse(Exception e) {
-		// log.info("Creating DefaultExceptionHandler ");
-		// e.printStackTrace();
 		if (e instanceof ForbiddenException) {
-			log.warn("Unauthorized access to {}, user: {}", request.getPathInfo(), bsc.getUserPrincipal());
+			LOG.warn("Unauthorized access to {}, user: {}", request.getPathInfo(), bsc.getUserPrincipal());
 			return Response.status(Status.UNAUTHORIZED).header(ERROR_MESSAGE_HEADER, "Unathorized access to the application").type(MediaType.APPLICATION_JSON).build();
 		}
 
 		if (e instanceof SeCurisServiceException) {
-			log.warn("SeCurisServiceException accessing to {}, user: {}", request.getPathInfo(), bsc.getUserPrincipal());
+			LOG.warn("SeCurisServiceException accessing to {}, user: {}", request.getPathInfo(), bsc.getUserPrincipal());
 			return Response.status(Status.fromStatusCode(((SeCurisServiceException) e).getStatus())).header(ERROR_MESSAGE_HEADER, e.getMessage()).type(MediaType.APPLICATION_JSON).build();
 		}
 
-		log.error("Unexpected error accesing to '{}' by user: {}", request.getPathInfo(), bsc.getUserPrincipal());
-		log.error("Request sent from {}, with User-Agent: {}", request.getRemoteHost(), request.getHeader("User-Agent"));
-		log.error("Request url: " + request.getRequestURL(), e);
+		LOG.error("Unexpected error accesing to '{}' by user: {}", request.getPathInfo(), bsc.getUserPrincipal());
+		LOG.error("Request sent from {}, with User-Agent: {}", request.getRemoteHost(), request.getHeader("User-Agent"));
+		LOG.error("Request url: " + request.getRequestURL(), e);
 		return Response.serverError().header(ERROR_MESSAGE_HEADER, "Unexpected error: " + e.toString()).type(MediaType.APPLICATION_JSON).build();
 	}
 }
\ No newline at end of file

--
Gitblit v1.3.2