diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 46a37b9f59c..cd657fb5749 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -826,8 +826,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { deviceConfig.setClientId(dcrResponse.getClientId()); deviceConfig.setClientSecret(dcrResponse.getClientSecret()); - StringBuilder scopes = new StringBuilder("device_" + type.replace(" ", "") - .replace("_", "") + "_" + id); + StringBuilder scopes = new StringBuilder("device_" + type.replace(" ", "") + "_" + id); for (String topic : mqttEventTopicStructure) { if (topic.contains("${deviceId}")) { topic = topic.replace("${deviceId}", id);