diff options
author | Parshad Patel <pars.patel@samsung.com> | 2019-02-11 15:14:54 +0900 |
---|---|---|
committer | Parshad Patel <pars.patel@samsung.com> | 2019-02-11 15:17:31 +0900 |
commit | a9a7807cfd3bdafdb624ad98ffbf89150713e13b (patch) | |
tree | 1ebfe375ef2261806f1b06c966ea612ff1d7e542 /src/main | |
parent | 8bd435031bd393374b6e44077929ec8136efedd5 (diff) |
Fix blocker sonar issues in dmaap-kafka11aaf
Fix "NullPointerException" issue
Fix always evaluate to "false" issue
Issue-ID: DMAAP-894
Change-Id: I2a9cf4cc94631bd8f0042ef3f4f10450adb0876f
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/dmaap/commonauth/kafka/base/authorization/Cadi3AAFProvider.java | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/dmaap/kafkaAuthorize/KafkaCustomAuthorizer.java | 2 |
2 files changed, 1 insertions, 9 deletions
diff --git a/src/main/java/org/onap/dmaap/commonauth/kafka/base/authorization/Cadi3AAFProvider.java b/src/main/java/org/onap/dmaap/commonauth/kafka/base/authorization/Cadi3AAFProvider.java index 5ee43e8..9cc45fe 100644 --- a/src/main/java/org/onap/dmaap/commonauth/kafka/base/authorization/Cadi3AAFProvider.java +++ b/src/main/java/org/onap/dmaap/commonauth/kafka/base/authorization/Cadi3AAFProvider.java @@ -54,8 +54,6 @@ public class Cadi3AAFProvider implements AuthorizationProvider { private static AAFAuthn<?> aafAuthn; private static AbsAAFLur<AAFPermission> aafLur; - private static boolean props_ok = false; - private static final Logger logger = LoggerFactory.getLogger(Cadi3AAFProvider.class); public Cadi3AAFProvider() { @@ -85,11 +83,6 @@ public class Cadi3AAFProvider implements AuthorizationProvider { logger.error("Unable to load " + CADI_PROPERTIES); logger.error("Error", e); } - - props_ok = true; - if (props_ok == false) { - return; - } } if (aafAuthn == null) { @@ -101,7 +94,6 @@ public class Cadi3AAFProvider implements AuthorizationProvider { aafAuthn = null; if (access != null) access.log(e, "Failed to initialize AAF"); - props_ok = false; } } diff --git a/src/main/java/org/onap/dmaap/kafkaAuthorize/KafkaCustomAuthorizer.java b/src/main/java/org/onap/dmaap/kafkaAuthorize/KafkaCustomAuthorizer.java index cb33e29..acafbdf 100644 --- a/src/main/java/org/onap/dmaap/kafkaAuthorize/KafkaCustomAuthorizer.java +++ b/src/main/java/org/onap/dmaap/kafkaAuthorize/KafkaCustomAuthorizer.java @@ -94,7 +94,7 @@ public class KafkaCustomAuthorizer implements Authorizer { logger.info("^Event Received for topic " + topicName + " , User " + fullName + " , action = " + action); } - if (fullName.equals("admin")) { + if (null != fullName && fullName.equals("admin")) { return true; } |