From 2d23eb86eb038bea3137b3181e0c14d22624c4d3 Mon Sep 17 00:00:00 2001 From: Kamidu Sachith Date: Mon, 21 Dec 2015 16:38:42 +0530 Subject: [PATCH] Improve runtime performance --- .../wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java | 2 +- .../mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 533a7fc2dc..65ab0d46de 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 c0a8318af1..2fca27bffc 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)) {