From 7749de69b8983493d0f0a8501a845773c650674f Mon Sep 17 00:00:00 2001 From: David Gomez G Date: Tue, 23 Jul 2019 09:23:19 +0200 Subject: [PATCH] removed getEntry method call in deleteEntry method impl Both getEntry(entryId) and deleteEntry(entryId) return the entity by its ID or throw a PortalException if the entity with the provided Id does not exists in the persistence layer. So, the first call is redundant. The method implementation could have been simplified to one-line: return deleteEntry(entryId), but I keep the assigment to make it more clear that deleteEntry() method is returning the Entry. --- .../03-implementing-service-methods.markdown | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/develop/tutorials/articles/04-developing-a-web-application/03-generating-the-backend/03-implementing-service-methods.markdown b/develop/tutorials/articles/04-developing-a-web-application/03-generating-the-backend/03-implementing-service-methods.markdown index ed2fc08820d..dc8fdb15379 100755 --- a/develop/tutorials/articles/04-developing-a-web-application/03-generating-the-backend/03-implementing-service-methods.markdown +++ b/develop/tutorials/articles/04-developing-a-web-application/03-generating-the-backend/03-implementing-service-methods.markdown @@ -186,9 +186,7 @@ Do so now by following these steps: public Entry deleteEntry (long entryId, ServiceContext serviceContext) throws PortalException { - Entry entry = getEntry(entryId); - - entry = deleteEntry(entryId); + Entry entry = deleteEntry(entryId); return entry; }