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/services/ApplicationResource.java | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/securis/src/main/java/net/curisit/securis/services/ApplicationResource.java b/securis/src/main/java/net/curisit/securis/services/ApplicationResource.java
index ee9c676..1c1d860 100644
--- a/securis/src/main/java/net/curisit/securis/services/ApplicationResource.java
+++ b/securis/src/main/java/net/curisit/securis/services/ApplicationResource.java
@@ -46,7 +46,7 @@
@Inject
Provider<EntityManager> emProvider;
- private static final Logger log = LogManager.getLogger(ApplicationResource.class);
+ private static final Logger LOG = LogManager.getLogger(ApplicationResource.class);
public ApplicationResource() {
}
@@ -60,7 +60,7 @@
@Produces(
{ MediaType.APPLICATION_JSON })
public Response index() {
- log.info("Getting applications list ");
+ LOG.info("Getting applications list ");
EntityManager em = emProvider.get();
TypedQuery<Application> q = em.createNamedQuery("list-applications", Application.class);
@@ -78,16 +78,16 @@
@Produces(
{ MediaType.APPLICATION_JSON })
public Response get(@PathParam("appid") String appid, @HeaderParam(TokenHelper.TOKEN_HEADER_PÀRAM) String token) {
- log.info("Getting application data for id: {}: ", appid);
+ LOG.info("Getting application data for id: {}: ", appid);
if (appid == null || appid.equals("")) {
- log.error("Application ID is mandatory");
+ LOG.error("Application ID is mandatory");
return Response.status(Status.NOT_FOUND).build();
}
EntityManager em = emProvider.get();
Application app = em.find(Application.class, Integer.parseInt(appid));
if (app == null) {
- log.error("Application with id {} not found in DB", appid);
+ LOG.error("Application with id {} not found in DB", appid);
return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "Application not found with ID: " + appid).build();
}
@@ -101,7 +101,7 @@
{ MediaType.APPLICATION_JSON })
@Transactional
public Response create(Application app, @HeaderParam(TokenHelper.TOKEN_HEADER_PÀRAM) String token) {
- log.info("Creating new application");
+ LOG.info("Creating new application");
EntityManager em = emProvider.get();
app.setCreationTimestamp(new Date());
em.persist(app);
@@ -117,11 +117,11 @@
@Produces(
{ MediaType.APPLICATION_JSON })
public Response modify(Application app, @PathParam("appid") String appid, @HeaderParam(TokenHelper.TOKEN_HEADER_PÀRAM) String token) {
- log.info("Modifying application with id: {}", appid);
+ LOG.info("Modifying application with id: {}", appid);
EntityManager em = emProvider.get();
Application currentapp = em.find(Application.class, Integer.parseInt(appid));
if (currentapp == null) {
- log.error("Application with id {} not found in DB", appid);
+ LOG.error("Application with id {} not found in DB", appid);
return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "Application not found with ID: " + appid).build();
}
currentapp.setName(app.getName());
@@ -137,11 +137,11 @@
@Produces(
{ MediaType.APPLICATION_JSON })
public Response delete(@PathParam("appid") String appid, @Context HttpServletRequest request) {
- log.info("Deleting app with id: {}", appid);
+ LOG.info("Deleting app with id: {}", appid);
EntityManager em = emProvider.get();
Application app = em.find(Application.class, Integer.parseInt(appid));
if (app == null) {
- log.error("Application with id {} can not be deleted, It was not found in DB", appid);
+ LOG.error("Application with id {} can not be deleted, It was not found in DB", appid);
return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "Application not found with ID: " + appid).build();
}
--
Gitblit v1.3.2