From c90f4471a838422a80796cbc1f1655e86d32285f Mon Sep 17 00:00:00 2001 From: dilanua Date: Tue, 17 May 2016 05:54:40 +0530 Subject: [PATCH] Replacing .equals with .isEmpty empty string check in Detdashboard analytics feature --- .../dashboard/dao/AbstractGadgetDataServiceDAO.java | 8 ++++---- .../dao/impl/GenericGadgetDataServiceDAOImpl.java | 2 +- .../dashboard/dao/impl/MSSQLGadgetDataServiceDAOImpl.java | 2 +- .../dao/impl/OracleGadgetDataServiceDAOImpl.java | 2 +- .../dao/impl/PostgreSQLGadgetDataServiceDAOImpl.java | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/AbstractGadgetDataServiceDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/AbstractGadgetDataServiceDAO.java index d41ba45a62..c36877d950 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/AbstractGadgetDataServiceDAO.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/AbstractGadgetDataServiceDAO.java @@ -116,7 +116,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD public DeviceCountByGroupEntry getFeatureNonCompliantDeviceCount(String nonCompliantFeatureCode, FilterSet filterSet) throws InvalidParameterValueException, SQLException { - if (nonCompliantFeatureCode == null || "".equals(nonCompliantFeatureCode)) { + if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) { throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty."); } @@ -302,7 +302,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD getFeatureNonCompliantDeviceCountsByPlatforms(String nonCompliantFeatureCode, FilterSet filterSet) throws InvalidParameterValueException, SQLException { - if (nonCompliantFeatureCode == null || "".equals(nonCompliantFeatureCode)) { + if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) { throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty."); } @@ -416,7 +416,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD getFeatureNonCompliantDeviceCountsByOwnershipTypes(String nonCompliantFeatureCode, FilterSet filterSet) throws InvalidParameterValueException, SQLException { - if (nonCompliantFeatureCode == null || "".equals(nonCompliantFeatureCode)) { + if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) { throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty."); } @@ -531,7 +531,7 @@ public abstract class AbstractGadgetDataServiceDAO implements GadgetDataServiceD public List getFeatureNonCompliantDevicesWithDetails(String nonCompliantFeatureCode, FilterSet filterSet) throws InvalidParameterValueException, SQLException { - if (nonCompliantFeatureCode == null || "".equals(nonCompliantFeatureCode)) { + if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) { throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty."); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/GenericGadgetDataServiceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/GenericGadgetDataServiceDAOImpl.java index feb8b7024a..9c2f693186 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/GenericGadgetDataServiceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/GenericGadgetDataServiceDAOImpl.java @@ -188,7 +188,7 @@ public class GenericGadgetDataServiceDAOImpl extends AbstractGadgetDataServiceDA FilterSet filterSet, int startIndex, int resultCount) throws InvalidParameterValueException, SQLException { - if (nonCompliantFeatureCode == null || "".equals(nonCompliantFeatureCode)) { + if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) { throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty."); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/MSSQLGadgetDataServiceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/MSSQLGadgetDataServiceDAOImpl.java index b1a725e2bf..74f0cc4ee6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/MSSQLGadgetDataServiceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/MSSQLGadgetDataServiceDAOImpl.java @@ -190,7 +190,7 @@ public class MSSQLGadgetDataServiceDAOImpl extends AbstractGadgetDataServiceDAO FilterSet filterSet, int startIndex, int resultCount) throws InvalidParameterValueException, SQLException { - if (nonCompliantFeatureCode == null || "".equals(nonCompliantFeatureCode)) { + if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) { throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty."); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/OracleGadgetDataServiceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/OracleGadgetDataServiceDAOImpl.java index a84b906f34..a4284938d2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/OracleGadgetDataServiceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/OracleGadgetDataServiceDAOImpl.java @@ -190,7 +190,7 @@ public class OracleGadgetDataServiceDAOImpl extends AbstractGadgetDataServiceDAO FilterSet filterSet, int startIndex, int resultCount) throws InvalidParameterValueException, SQLException { - if (nonCompliantFeatureCode == null || "".equals(nonCompliantFeatureCode)) { + if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) { throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty."); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/PostgreSQLGadgetDataServiceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/PostgreSQLGadgetDataServiceDAOImpl.java index 26986df2fe..e8c8570a0d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/PostgreSQLGadgetDataServiceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/src/main/java/org/wso2/carbon/device/mgt/analytics/dashboard/dao/impl/PostgreSQLGadgetDataServiceDAOImpl.java @@ -188,7 +188,7 @@ public class PostgreSQLGadgetDataServiceDAOImpl extends AbstractGadgetDataServic FilterSet filterSet, int startIndex, int resultCount) throws InvalidParameterValueException, SQLException { - if (nonCompliantFeatureCode == null || "".equals(nonCompliantFeatureCode)) { + if (nonCompliantFeatureCode == null || nonCompliantFeatureCode.isEmpty()) { throw new InvalidParameterValueException("Non-compliant feature code should not be either null or empty."); }