Fixed sonar issue in ExternalKeyValidator 89/75089/1
authorezhil <ezhrajam@in.ibm.com>
Wed, 26 Dec 2018 11:08:07 +0000 (16:38 +0530)
committerezhil <ezhrajam@in.ibm.com>
Wed, 26 Dec 2018 11:08:20 +0000 (16:38 +0530)
Fixed major sonar issue
Issue-ID: CCSDK-690
Change-Id: I17abdb751f1a384bd0c63e5b336186eaad945783
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/validator/ExternalKeyValidator.java

index 4b7ec79..c17158c 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -36,7 +38,7 @@ public class ExternalKeyValidator {
      * Tells if the given external ID is present in the DB.
      */
     public boolean isPresent(String externalId) {
-        if (genNameRepo.findByExternalId(externalId).size() > 0 || genNameRepo.findByExternalId(externalId).isEmpty() ) {
+        if (!genNameRepo.findByExternalId(externalId).isEmpty() ) {
             return true;
         }
         return false;