From 571d8afa115b5a2f409ac686c7c0e1842b1cccd0 Mon Sep 17 00:00:00 2001 From: "tcdlpds@gmail.com" Date: Fri, 29 Jan 2021 19:35:50 +0530 Subject: [PATCH] Fix app updating issues when the payload contains same app name --- .../application/mgt/core/impl/ApplicationManagerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index 4f2d7bce65..b7b32ca34d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -1969,7 +1969,8 @@ public class ApplicationManagerImpl implements ApplicationManager { ApplicationDTO applicationDTO = getApplication(applicationId); try { ConnectionManagerUtil.beginDBTransaction(); - if (!StringUtils.isEmpty(applicationUpdateWrapper.getName())){ + if (!StringUtils.isEmpty(applicationUpdateWrapper.getName()) && !applicationDTO.getName() + .equals(applicationUpdateWrapper.getName())) { if (applicationDAO .isExistingAppName(applicationUpdateWrapper.getName().trim(), applicationDTO.getDeviceTypeId(), tenantId)) {