From 05836953386cca8699128e58879d89b6f480e44f Mon Sep 17 00:00:00 2001 From: prabathabey Date: Tue, 31 Mar 2015 13:11:38 +0530 Subject: [PATCH] Fixing improper API name getting displayed when an API is republished --- .../device/mgt/core/api/mgt/APIPublisherServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/api/mgt/APIPublisherServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/api/mgt/APIPublisherServiceImpl.java index 5b5a9d59bc..e5e09fe4a8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/api/mgt/APIPublisherServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/api/mgt/APIPublisherServiceImpl.java @@ -48,9 +48,10 @@ public class APIPublisherServiceImpl implements APIPublisherService { log.info("Successfully published API '" + api.getId().getApiName() + "' with context '" + api.getContext() + "' and version '" + api.getId().getVersion() + "'"); } else { - log.info("An API already exists with the name '" + api.getId() + "', context '" + - api.getContext() + "' and verison '" + api.getId().getVersion() + - "'. Thus, the API config is not re-published"); + provider.updateAPI(api); + log.info("An API already exists with the name '" + api.getId().getApiName() + "', context '" + + api.getContext() + "' and version '" + api.getId().getVersion() + + "'. Thus, the API config is updated"); } } else { log.error("API provider configured for the given API configuration is null. Thus, the API is not " +