Skip to content

Commit

Permalink
sonarqube fixes for issue #2189
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Nov 8, 2023
1 parent 926e40c commit b0d8574
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,7 @@ public Response getCaseByExternalId(@PathParam("extId") String extId) {
}
} catch (Exception ex) {
log.error("can not get case by external id " + extId, ex);
Response res = Response.serverError().build();
return res;
return Response.serverError().build();
}

}
Expand All @@ -856,12 +855,11 @@ public Response getCaseByExternalId(@PathParam("extId") String extId) {
public Response getDocumentByExternalId(@PathParam("extId") String extId) {
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);
ArchiveFileDocumentsBean doc = cases.getDocumentByExternalId(extId);
if (doc == null) {
log.error("can not get document for external id " + extId);
Response res = Response.serverError().build();
return res;
return Response.serverError().build();
}

RestfulDocumentV1 d = new RestfulDocumentV1();
Expand All @@ -878,12 +876,10 @@ public Response getDocumentByExternalId(@PathParam("extId") String extId) {
if (doc.getFolder() != null) {
d.setFolderId(doc.getFolder().getId());
}
Response res = Response.ok(d).build();
return res;
return Response.ok(d).build();
} catch (Exception ex) {
log.error("can not get document for external id " + extId, ex);
Response res = Response.serverError().build();
return res;
return Response.serverError().build();
}
}

Expand Down

0 comments on commit b0d8574

Please sign in to comment.