From 892d5cee205400fa936baf05b5e21e020c34f5d9 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Mon, 15 Aug 2016 15:13:39 +0530 Subject: [PATCH 1/3] avoided lazy inialization --- .../wso2/carbon/apimgt/webapp/publisher/config/Profiles.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/config/Profiles.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/config/Profiles.java index 61dfe237f2..442d7b2474 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/config/Profiles.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/config/Profiles.java @@ -41,16 +41,13 @@ import java.util.List; public class Profiles { @XmlElement(name = "Profile") - protected List profile; + protected List profile = new ArrayList();; /** * Gets the value of the profile property. * */ public List getProfile() { - if (profile == null) { - profile = new ArrayList(); - } return this.profile; } From 442c2b86da6ba1373ef723b3244a203267ecbcf8 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Mon, 15 Aug 2016 15:19:18 +0530 Subject: [PATCH 2/3] fixed formatting issues --- .../device/mgt/jaxrs/service/impl/util/FilteringUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/FilteringUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/FilteringUtil.java index 3cc650029c..c0f578be39 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/FilteringUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/FilteringUtil.java @@ -32,7 +32,7 @@ public class FilteringUtil { * This is used to filter from the cached policies. */ public static List getFilteredList(List sourceList, int offset, int limit) { - if(sourceList == null || sourceList.size() < offset){ + if (sourceList == null || sourceList.size() < offset) { return Collections.emptyList(); } return sourceList.subList(offset, Math.min(offset + limit, sourceList.size())); From a7c201363c20fa63dbbca91479828aca4ff4f40f Mon Sep 17 00:00:00 2001 From: ayyoob Date: Mon, 15 Aug 2016 15:20:37 +0530 Subject: [PATCH 3/3] logged exception trace --- .../client/extension/service/JWTClientManagerServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/service/JWTClientManagerServiceImpl.java b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/service/JWTClientManagerServiceImpl.java index f12d295b7a..51c19212a3 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/service/JWTClientManagerServiceImpl.java +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/service/JWTClientManagerServiceImpl.java @@ -81,7 +81,7 @@ public class JWTClientManagerServiceImpl implements JWTClientManagerService { addJWTClient(tenantDomain, jwtClient); } catch (JWTClientAlreadyExistsException e) { log.warn("Attempting to register a jwt client for the tenant " + tenantDomain + - " when one already exists. Returning existing jwt client"); + " when one already exists. Returning existing jwt client", e); return getJWTClient(tenantDomain); } catch (JWTClientConfigurationException e) { throw new JWTClientException("Failed to parse jwt configuration for tenant " + tenantDomain, e); @@ -110,7 +110,7 @@ public class JWTClientManagerServiceImpl implements JWTClientManagerService { addJWTClient(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, defaultJWTClient); } catch (JWTClientAlreadyExistsException e) { log.warn("Attempting to register a jwt client for the super tenant" + - " when one already exists. Returning existing jwt client"); + " when one already exists. Returning existing jwt client", e); } } }