From 537fc9b8c4161e18a13d6a9492fb475ec44de5cc Mon Sep 17 00:00:00 2001 From: shamalka Date: Thu, 10 Nov 2022 21:00:08 +0530 Subject: [PATCH] Fix formatting issues --- .../mgt/core/dao/impl/tracker/TrackerDAOImpl.java | 12 ++++++++++-- .../service/DeviceManagementProviderServiceImpl.java | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/tracker/TrackerDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/tracker/TrackerDAOImpl.java index 8066bc311c..034ecbff77 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/tracker/TrackerDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/tracker/TrackerDAOImpl.java @@ -109,8 +109,16 @@ public class TrackerDAOImpl implements TrackerDAO { TrackerDeviceInfo trackerDeviceInfo = null; try { Connection conn = TrackerManagementDAOFactory.getConnection(); - String sql = "SELECT DM_EXT_DEVICE_MAPPING.ID, DM_EXT_DEVICE_MAPPING.TRACCAR_DEVICE_ID, DM_EXT_DEVICE_MAPPING.DEVICE_ID, DM_EXT_DEVICE_MAPPING.TENANT_ID, DM_EXT_DEVICE_MAPPING.STATUS FROM DM_EXT_DEVICE_MAPPING JOIN DM_DEVICE ON DM_EXT_DEVICE_MAPPING.DEVICE_ID=DM_DEVICE.ID WHERE " + - "DM_EXT_DEVICE_MAPPING.DEVICE_ID = ? AND DM_EXT_DEVICE_MAPPING.TENANT_ID = ? ORDER BY DM_EXT_DEVICE_MAPPING.ID DESC LIMIT 1"; + String sql = "SELECT " + + "DM_EXT_DEVICE_MAPPING.ID, " + + "DM_EXT_DEVICE_MAPPING.TRACCAR_DEVICE_ID, " + + "DM_EXT_DEVICE_MAPPING.DEVICE_ID, " + + "DM_EXT_DEVICE_MAPPING.TENANT_ID, " + + "DM_EXT_DEVICE_MAPPING.STATUS " + + "FROM DM_EXT_DEVICE_MAPPING " + + "JOIN DM_DEVICE ON DM_EXT_DEVICE_MAPPING.DEVICE_ID=DM_DEVICE.ID " + + "WHERE DM_EXT_DEVICE_MAPPING.DEVICE_ID = ? AND DM_EXT_DEVICE_MAPPING.TENANT_ID = ? " + + "ORDER BY DM_EXT_DEVICE_MAPPING.ID DESC LIMIT 1"; try (PreparedStatement stmt = conn.prepareStatement(sql)) { stmt.setInt(1, deviceId); stmt.setInt(2, tenantId); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 5ec33076b2..2f0439f8ca 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -3979,7 +3979,6 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv deviceLocation.setDistance(Double.parseDouble(distance)); deviceLocation.setSpeed(Float.parseFloat(speed)); deviceLocation.setBearing(Float.parseFloat(bearing)); -// deviceInformationManager.addDeviceLocation(device, deviceLocation); deviceInformationManager.addDeviceLocation(device, deviceLocation); } catch (DeviceDetailsMgtException e) { /***