Skip to content

Commit

Permalink
sonarqube fixes. issue #2018
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Sep 14, 2023
1 parent b70610d commit f2ec818
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,11 @@ public Response getCaseMessages(@PathParam("id") String id) {
try {

InitialContext ic = new InitialContext();
ArchiveFileServiceLocal cases = (ArchiveFileServiceLocal) ic.lookup("java:global/j-lawyer-server/j-lawyer-server-ejb/ArchiveFileService!com.jdimension.jlawyer.services.ArchiveFileServiceLocal");
ArchiveFileServiceLocal cases = (ArchiveFileServiceLocal) ic.lookup(LOOKUP_CASES);
ArchiveFileBean currentCase = cases.getArchiveFile(id);
if (currentCase == null) {
log.error("case with id " + id + " does not exist");
Response res = Response.serverError().build();
return res;
return Response.serverError().build();
}

MessagingServiceLocal msgService = (MessagingServiceLocal) ic.lookup("java:global/j-lawyer-server/j-lawyer-server-ejb/MessagingService!com.jdimension.jlawyer.services.MessagingServiceLocal");
Expand All @@ -803,12 +802,10 @@ public Response getCaseMessages(@PathParam("id") String id) {
msgList.add(m);
}

Response res = Response.ok(msgList).build();
return res;
return Response.ok(msgList).build();
} catch (Exception ex) {
log.error("can not get message for case " + id, ex);
Response res = Response.serverError().build();
return res;
return Response.serverError().build();
}
}

Expand Down

0 comments on commit f2ec818

Please sign in to comment.