diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java index 533a7fc2dcf..65ab0d46de2 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java @@ -44,7 +44,7 @@ public class APIPublisherUtil { private static List httpMethods; static { - httpMethods = new ArrayList(); + httpMethods = new ArrayList(5); httpMethods.add(HTTPMethod.GET); httpMethods.add(HTTPMethod.POST); httpMethods.add(HTTPMethod.DELETE); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java index c0a8318af1a..2fca27bffcd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java @@ -268,7 +268,7 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem log.debug("num of apps installed:" + installedAppList.size()); } List appsToAdd = new ArrayList<>(); - List appIdsToRemove = new ArrayList<>(); + List appIdsToRemove = new ArrayList<>(installedAppList.size()); for (Application installedApp : installedAppList) { if (!applications.contains(installedApp)) { diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java index f78feca333f..7fd9d04d75b 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java @@ -1282,11 +1282,6 @@ public class PolicyDAOImpl implements PolicyDAO { stmt.setInt(1, policyId); stmt.executeUpdate(); - String deleteComplianceStatus ="DELETE FROM DM_POLICY_COMPLIANCE_STATUS WHERE POLICY_ID =?"; - stmt = conn.prepareStatement(deleteComplianceStatus); - stmt.setInt(1, policyId); - stmt.executeUpdate(); - if (log.isDebugEnabled()) { log.debug("Policy (" + policyId + ") related configs deleted from database."); } diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql index 2ef6a292204..87e8b135272 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -308,12 +308,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( LAST_REQUESTED_TIME TIMESTAMP NULL, LAST_FAILED_TIME TIMESTAMP NULL, ATTEMPTS INT NULL, - PRIMARY KEY (ID), - CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY - FOREIGN KEY (POLICY_ID) - REFERENCES DM_POLICY (ID) - ON DELETE NO ACTION - ON UPDATE NO ACTION + PRIMARY KEY (ID) ); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql index fc5639649fe..b2f954f69e9 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql @@ -311,12 +311,7 @@ CREATE TABLE DM_POLICY_COMPLIANCE_STATUS ( LAST_REQUESTED_TIME DATETIME2(0) NULL, LAST_FAILED_TIME DATETIME2(0) NULL, ATTEMPTS INT NULL, - PRIMARY KEY (ID), - CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY - FOREIGN KEY (POLICY_ID) - REFERENCES DM_POLICY (ID) - ON DELETE NO ACTION - ON UPDATE NO ACTION + PRIMARY KEY (ID) ); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql index 2132a66d0ed..2c0fa846246 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql @@ -302,12 +302,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( LAST_REQUESTED_TIME TIMESTAMP NULL, LAST_FAILED_TIME TIMESTAMP NULL, ATTEMPTS INT NULL, - PRIMARY KEY (ID), - CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY - FOREIGN KEY (POLICY_ID) - REFERENCES DM_POLICY (ID) - ON DELETE NO ACTION - ON UPDATE NO ACTION + PRIMARY KEY (ID) )ENGINE = InnoDB; diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql index 10e92f5047b..728233d24b3 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql @@ -397,10 +397,7 @@ CREATE TABLE DM_DEVICE_POLICY_APPLIED ( CONSTRAINT PK_DM_POLICY_DEV_APPLIED PRIMARY KEY (ID) , CONSTRAINT FK_DM_POLICY_DEV_APPLIED FOREIGN KEY (DEVICE_ID ) - REFERENCES DM_DEVICE (ID ), - CONSTRAINT FK_DM_POLICY_DEV_APPLY_POLICY - FOREIGN KEY (POLICY_ID ) - REFERENCES DM_POLICY (ID ) + REFERENCES DM_DEVICE (ID ) ) / -- Generate ID using sequence and trigger @@ -503,10 +500,7 @@ CREATE TABLE DM_POLICY_COMPLIANCE_STATUS ( LAST_REQUESTED_TIME TIMESTAMP(0) NULL, LAST_FAILED_TIME TIMESTAMP(0) NULL, ATTEMPTS NUMBER(10) NULL, - CONSTRAINT PK_DM_POLICY_COMP_STATUS PRIMARY KEY (ID), - CONSTRAINT FK_POLICY_COMP_STATUS_POLICY - FOREIGN KEY (POLICY_ID) - REFERENCES DM_POLICY (ID) + CONSTRAINT PK_DM_POLICY_COMP_STATUS PRIMARY KEY (ID) ) / -- Generate ID using sequence and trigger diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql index 4299ac52b6c..2e3654d6d08 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql @@ -266,12 +266,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( LAST_SUCCESS_TIME TIMESTAMP NULL, LAST_REQUESTED_TIME TIMESTAMP NULL, LAST_FAILED_TIME TIMESTAMP NULL, - ATTEMPTS INTEGER NULL, - CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY - FOREIGN KEY (POLICY_ID) - REFERENCES DM_POLICY (ID) - ON DELETE NO ACTION - ON UPDATE NO ACTION + ATTEMPTS INTEGER NULL ); CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT ( diff --git a/pom.xml b/pom.xml index 37865f8aa5e..5c045450078 100644 --- a/pom.xml +++ b/pom.xml @@ -1519,7 +1519,7 @@ 4.6.0 - 5.0.5 + 5.0.7 4.5.0