From 520fdcf304cc2ea282859017b4a3ccf26ee5ae70 Mon Sep 17 00:00:00 2001 From: anushadasari Date: Wed, 6 Nov 2019 15:03:30 +0530 Subject: Merge this if statement with the enclosing one Merging collapsible if statements increases the code's readability. Issue-ID: OPTFRA-634 Change-Id: Ic1c24c2671f62282477e32c432216ac560745c03 Signed-off-by: anushadasari --- .../src/main/java/org/onap/optf/cmso/aaf/AafAuthProvider.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafAuthProvider.java b/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafAuthProvider.java index 332ca73..0a7a69e 100755 --- a/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafAuthProvider.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafAuthProvider.java @@ -66,11 +66,9 @@ public class AafAuthProvider implements AuthenticationProvider { sessionId = webAuthDetails.getRemoteAddress() + ":" + webAuthDetails.getSessionId(); } } - if (env.getProperty(AafProperties.aafEnabled.toString(), Boolean.class, true)) { - if (clientCache.authenticate(name, password, sessionId) != AuthorizationResult.Authenticated) { + if (env.getProperty(AafProperties.aafEnabled.toString(), Boolean.class, true) && clientCache.authenticate(name, password, sessionId) != AuthorizationResult.Authenticated ) { return null; } - } return new UsernamePasswordAuthenticationToken(name, password, new ArrayList<>()); } -- cgit 1.2.3-korg