diff --git a/j-lawyer-server/j-lawyer-io/src/java/org/jlawyer/io/rest/v7/CasesEndpointV7.java b/j-lawyer-server/j-lawyer-io/src/java/org/jlawyer/io/rest/v7/CasesEndpointV7.java index 0698854f0..5c204416e 100644 --- a/j-lawyer-server/j-lawyer-io/src/java/org/jlawyer/io/rest/v7/CasesEndpointV7.java +++ b/j-lawyer-server/j-lawyer-io/src/java/org/jlawyer/io/rest/v7/CasesEndpointV7.java @@ -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(); } } @@ -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(); @@ -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(); } }