From d86dd644e1543743cfcbc83b230bd4f2cb2e5d4e Mon Sep 17 00:00:00 2001 From: Instrumental Date: Thu, 29 Mar 2018 19:02:24 -0500 Subject: Clean up Sonar results 1 Issue-ID: AAF-206 Change-Id: If1fced5b528490a52691508fb1e30962dbe28856 Signed-off-by: Instrumental --- .../java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'auth/auth-locate/src/main/java') diff --git a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java index 1ce9821f..fdb02c70 100644 --- a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java +++ b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java @@ -275,6 +275,7 @@ public abstract class LocateFacadeImpl ex } public final static String GET_ENDPOINTS = "getEndpoints"; + private final static Object LOCK = new Object(); /* (non-Javadoc) * @see org.onap.aaf.auth.locate.facade.GwFacade#getEndpoints(org.onap.aaf.auth.env.test.AuthzTrans, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.String, java.lang.String) */ @@ -284,7 +285,7 @@ public abstract class LocateFacadeImpl ex try { String output=null; long temp=System.currentTimeMillis(); - synchronized(GET_ENDPOINTS) { + synchronized(LOCK) { if(cacheClear ex return Result.err(reps); } else { output = epDF.newData(trans).load(reps.value).asString(); - synchronized(GET_ENDPOINTS) { + synchronized(LOCK) { epsCache.put(key, output); } } @@ -338,7 +339,7 @@ public abstract class LocateFacadeImpl ex Result rp = service.putMgmtEndPoints(trans, rreq); switch(rp.status) { case OK: - synchronized(GET_ENDPOINTS) { + synchronized(LOCK) { cacheClear = 0L; } setContentType(resp,mepDF.getOutType()); @@ -374,7 +375,7 @@ public abstract class LocateFacadeImpl ex Result rp = service.removeMgmtEndPoints(trans, rreq); switch(rp.status) { case OK: - synchronized(GET_ENDPOINTS) { + synchronized(LOCK) { cacheClear = 0L; } setContentType(resp,mepDF.getOutType()); -- cgit 1.2.3-korg