From 3c977110c72b3ddfa6cacf27485f2aa3886abf2a Mon Sep 17 00:00:00 2001 From: hisanhunais Date: Fri, 15 Mar 2024 15:32:28 +0530 Subject: [PATCH] Use equals method for string comparison --- .../main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java index 01adc5565322..f906758cd56b 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java @@ -9517,7 +9517,7 @@ public void addKeyManagerConfiguration(KeyManagerConfigurationDTO keyManagerConf preparedStatement.setString(10, keyManagerConfigurationDTO.getExternalReferenceId()); preparedStatement.executeUpdate(); KeyManagerPermissionConfigurationDTO permissionDTO = keyManagerConfigurationDTO.getPermissions(); - if (permissionDTO != null && permissionDTO.getPermissionType() != KeyManagerAccessPublic) { + if (permissionDTO != null && !KeyManagerAccessPublic.equals(permissionDTO.getPermissionType())) { try (PreparedStatement addPermissionStatement = conn .prepareStatement(SQLConstants.KeyManagerPermissionsSqlConstants .ADD_KEY_MANAGER_PERMISSION_SQL)) { @@ -9598,7 +9598,7 @@ public void updateKeyManagerConfiguration(KeyManagerConfigurationDTO keyManagerC deletePermissionsStatement.executeUpdate(); } KeyManagerPermissionConfigurationDTO permissionDTO = keyManagerConfigurationDTO.getPermissions(); - if (permissionDTO != null && permissionDTO.getPermissionType() != KeyManagerAccessPublic) { + if (permissionDTO != null && !KeyManagerAccessPublic.equals(permissionDTO.getPermissionType())) { try (PreparedStatement addPermissionStatement = conn.prepareStatement(SQLConstants .KeyManagerPermissionsSqlConstants.ADD_KEY_MANAGER_PERMISSION_SQL)) { for (String role : permissionDTO.getRoles()) {