stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject git commit: Fixing sonar finding storing arrays directly
Date Wed, 08 Oct 2014 15:02:02 GMT
Repository: stratos
Updated Branches:
  refs/heads/master 40c0b3cd1 -> f01902e23


Fixing sonar finding storing arrays directly


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f01902e2
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f01902e2
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f01902e2

Branch: refs/heads/master
Commit: f01902e23e3824115825f549657218687b4dcd29
Parents: 40c0b3c
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Wed Oct 8 20:31:46 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Wed Oct 8 20:31:46 2014 +0530

----------------------------------------------------------------------
 .../autoscaler/NetworkPartitionContext.java     |  7 +++++-
 .../deployment/policy/DeploymentPolicy.java     | 10 +++++---
 .../autoscaler/partition/PartitionGroup.java    |  8 ++++--
 .../agent/data/publisher/DataContext.java       | 20 ++++++++++++---
 .../stratos/cli/beans/cartridge/Cartridge.java  | 13 ++++++++--
 .../controller/pojo/NetworkInterfaces.java      |  6 ++++-
 .../cloud/controller/pojo/Persistence.java      |  7 +++++-
 .../cloud/controller/pojo/Properties.java       |  6 ++++-
 .../common/kubernetes/KubernetesGroup.java      |  6 ++++-
 .../stratos/common/kubernetes/Properties.java   |  6 ++++-
 .../apache/stratos/manager/dto/Cartridge.java   | 15 ++++++++---
 .../manager/dto/RepositoryInformation.java      |  7 +++++-
 .../manager/service/RepositoryInfoBean.java     | 26 +++++++++-----------
 .../stratos/messaging/util/Properties.java      | 12 ++++++---
 .../endpoint/bean/kubernetes/Properties.java    |  6 ++++-
 .../activity/beans/PaginatedTenantDataBean.java |  7 +++++-
 .../mgt/beans/PaginatedTenantInfoBean.java      |  7 +++++-
 components/pom.xml                              |  2 +-
 18 files changed, 128 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java
index 0b75c49..3daf2c1 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java
@@ -26,6 +26,7 @@ import org.apache.stratos.autoscaler.policy.model.RequestsInFlight;
 import org.apache.stratos.cloud.controller.stub.deployment.partition.Partition;
 
 import java.io.Serializable;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -80,7 +81,11 @@ public class NetworkPartitionContext implements Serializable{
         super();
         this.id = id;
         this.partitionAlgorithm = partitionAlgo;
-        this.partitions = partitions;
+        if(partitions == null) {
+            this.partitions = new Partition[0];
+        } else {
+            this.partitions = Arrays.copyOf(partitions, partitions.length);
+        }
 //        this.setServiceToLBClusterId(new HashMap<String, String>());
 //        this.setClusterIdToLBClusterIdMap(new HashMap<String, String>());
 //        partitionToMemberCountMap = new HashMap<String, Integer>();

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/deployment/policy/DeploymentPolicy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/deployment/policy/DeploymentPolicy.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/deployment/policy/DeploymentPolicy.java
index a8a44d0..2fec9ac 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/deployment/policy/DeploymentPolicy.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/deployment/policy/DeploymentPolicy.java
@@ -100,7 +100,7 @@ public class DeploymentPolicy implements Serializable{
 	 /**
      * Sets the value of the isPublic property.
      * 
-     * @param description
+     * @param isPublic
      *     allowed object is boolean
      *     
      */
@@ -126,8 +126,12 @@ public class DeploymentPolicy implements Serializable{
 		this.tenantId = tenantId;
 	}
     
-    public void setPartitionGroups(PartitionGroup[] groups) {
-        this.partitionGroups = groups;
+    public void setPartitionGroups(PartitionGroup[] partitionGroups) {
+        if(partitionGroups == null) {
+            this.partitionGroups = new PartitionGroup[0];
+        } else {
+            this.partitionGroups = Arrays.copyOf(partitionGroups, partitionGroups.length);
+        }
     }
     
     public Partition[] getAllPartitions() {

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/partition/PartitionGroup.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/partition/PartitionGroup.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/partition/PartitionGroup.java
index 5abe7d4..eb01552 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/partition/PartitionGroup.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/partition/PartitionGroup.java
@@ -20,6 +20,7 @@
 package org.apache.stratos.autoscaler.partition;
 
 import java.io.Serializable;
+import java.util.Arrays;
 
 import org.apache.stratos.cloud.controller.stub.deployment.partition.Partition;
 import org.apache.stratos.cloud.controller.stub.pojo.Properties;
@@ -59,8 +60,11 @@ public class PartitionGroup implements Serializable{
     }
     
     public void setPartitions(Partition[] partitions) {
-        this.partitions = partitions;
-        partitions[0].setProperties(new Properties());
+        if(partitions == null) {
+            this.partitions = partitions;
+        } else {
+            this.partitions = Arrays.copyOf(partitions, partitions.length);
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataContext.java
b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataContext.java
index 0267bae..1cc02c8 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataContext.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataContext.java
@@ -19,6 +19,8 @@
 
 package org.apache.stratos.cartridge.agent.data.publisher;
 
+import java.util.Arrays;
+
 public class DataContext {
 
     private Object [] metaData;
@@ -31,7 +33,11 @@ public class DataContext {
     }
 
     public void setMetaData(Object[] metaData) {
-        this.metaData = metaData;
+        if(metaData == null) {
+            this.metaData = new Object[0];
+        } else {
+            this.metaData = Arrays.copyOf(metaData, metaData.length);
+        }
     }
 
     public Object[] getCorrelationData() {
@@ -39,7 +45,11 @@ public class DataContext {
     }
 
     public void setCorrelationData(Object[] correlationData) {
-        this.correlationData = correlationData;
+        if(correlationData == null) {
+            this.correlationData = new Object[0];
+        } else {
+            this.correlationData = Arrays.copyOf(correlationData, correlationData.length);
+        }
     }
 
     public Object[] getPayloadData() {
@@ -47,6 +57,10 @@ public class DataContext {
     }
 
     public void setPayloadData(Object[] payloadData) {
-        this.payloadData = payloadData;
+        if(payloadData == null) {
+            this.payloadData = new Object[0];
+        } else {
+            this.payloadData = Arrays.copyOf(payloadData, payloadData.length);
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/Cartridge.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/Cartridge.java
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/Cartridge.java
index ddbea1b..671ddb1 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/Cartridge.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/cartridge/Cartridge.java
@@ -20,6 +20,7 @@
 package org.apache.stratos.cli.beans.cartridge;
 
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Arrays;
 
 
 @XmlRootElement
@@ -181,7 +182,11 @@ public class Cartridge implements Comparable<Cartridge> {
     }
 
     public void setAccessURLs(String[] accessURLs) {
-        this.accessURLs = accessURLs;
+        if(accessURLs == null) {
+            this.accessURLs = new String[0];
+        } else {
+            this.accessURLs = Arrays.copyOf(accessURLs, accessURLs.length);
+        }
     }
 
     public void setDbUserName(String dbUserName) {
@@ -201,7 +206,11 @@ public class Cartridge implements Comparable<Cartridge> {
 	}
 
 	public void setPortMappings(PortMapping[] portMappings) {
-		this.portMappings = portMappings;
+        if(portMappings == null) {
+            this.portMappings = new PortMapping[0];
+        } else {
+            this.portMappings = Arrays.copyOf(portMappings, portMappings.length);
+        }
 	}
 	
 	public String getDbHost() {

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/NetworkInterfaces.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/NetworkInterfaces.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/NetworkInterfaces.java
index d22dc4c..a8165e6 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/NetworkInterfaces.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/NetworkInterfaces.java
@@ -43,7 +43,11 @@ public class NetworkInterfaces implements Serializable {
 	 * @param networkInterfaces the networkInterfaces to set
 	 */
 	public void setNetworkInterfaces(NetworkInterface[] networkInterfaces) {
-		this.networkInterfaces = networkInterfaces;
+        if(networkInterfaces == null) {
+            this.networkInterfaces = new NetworkInterface[0];
+        } else {
+            this.networkInterfaces = Arrays.copyOf(networkInterfaces, networkInterfaces.length);
+        }
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Persistence.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Persistence.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Persistence.java
index f6a53ea..128efbf 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Persistence.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Persistence.java
@@ -19,6 +19,7 @@
 package org.apache.stratos.cloud.controller.pojo;
 
 import java.io.Serializable;
+import java.util.Arrays;
 
 public class Persistence implements Serializable{
 	
@@ -43,6 +44,10 @@ public class Persistence implements Serializable{
     }
 
     public void setVolumes(Volume[] volumes) {
-        this.volumes = volumes;
+        if(volumes == null) {
+            this.volumes = new Volume[0];
+        } else {
+            this.volumes = Arrays.copyOf(volumes, volumes.length);
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java
index 6fab2d9..38ec5fb 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/pojo/Properties.java
@@ -37,7 +37,11 @@ public class Properties implements Serializable{
     }
 
     public void setProperties(Property[] properties) {
-        this.properties = ArrayUtils.clone(properties);
+        if(properties == null) {
+            this.properties = new Property[0];
+        } else {
+            this.properties = Arrays.copyOf(properties, properties.length);
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesGroup.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesGroup.java
b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesGroup.java
index d3cbcb1..7c42048 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesGroup.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/KubernetesGroup.java
@@ -47,7 +47,11 @@ public class KubernetesGroup implements Serializable {
     }
 
     public void setKubernetesHosts(KubernetesHost[] kubernetesHosts) {
-        this.kubernetesHosts = kubernetesHosts;
+        if(kubernetesHosts == null) {
+            this.kubernetesHosts = new KubernetesHost[0];
+        } else {
+            this.kubernetesHosts = Arrays.copyOf(kubernetesHosts, kubernetesHosts.length);
+        }
     }
 
     public KubernetesMaster getKubernetesMaster() {

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Properties.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Properties.java
b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Properties.java
index 9470508..146f6ca 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Properties.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/kubernetes/Properties.java
@@ -34,7 +34,11 @@ public class Properties implements Serializable {
     }
 
     public void setProperties(Property[] properties) {
-        this.properties = properties;
+        if(properties == null) {
+            this.properties = new Property[0];
+        } else {
+            this.properties = Arrays.copyOf(properties, properties.length);
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java
index af332ce..c0f07df 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/Cartridge.java
@@ -24,6 +24,7 @@ import org.apache.stratos.cloud.controller.stub.pojo.Persistence;
 import org.apache.stratos.cloud.controller.stub.pojo.PortMapping;
 
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Arrays;
 
 @XmlRootElement
 public class Cartridge implements Comparable<Cartridge> {
@@ -206,7 +207,11 @@ public class Cartridge implements Comparable<Cartridge> {
 	}
 
 	public void setAccessURLs(String[] accessURLs) {
-		this.accessURLs = accessURLs;
+        if(accessURLs == null) {
+            this.accessURLs = new String[0];
+        } else {
+            this.accessURLs = Arrays.copyOf(accessURLs, accessURLs.length);
+        }
 	}
 
 	public void setDbUserName(String dbUserName) {
@@ -246,8 +251,12 @@ public class Cartridge implements Comparable<Cartridge> {
 	}
 
 	public void setPortMappings(PortMapping[] portMappings) {
-		this.portMappings = portMappings;
-	}
+        if(portMappings == null) {
+            this.portMappings = new PortMapping[0];
+        } else {
+            this.portMappings = Arrays.copyOf(portMappings, portMappings.length);
+        }
+    }
 
     public String getLbClusterId() {
         return lbClusterId;

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/RepositoryInformation.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/RepositoryInformation.java
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/RepositoryInformation.java
index b3d029d..112117b 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/RepositoryInformation.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/dto/RepositoryInformation.java
@@ -19,6 +19,7 @@
 package org.apache.stratos.manager.dto;
 
 import java.io.Serializable;
+import java.util.Arrays;
 
 public class RepositoryInformation implements Serializable {
 
@@ -40,7 +41,11 @@ public class RepositoryInformation implements Serializable {
 	}
 
 	public void setRefName(String[] refName) {
-		this.refName = refName;
+        if(refName == null) {
+            this.refName = new String[0];
+        } else {
+            this.refName = Arrays.copyOf(refName, refName.length);
+        }
 	}
 
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/service/RepositoryInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/service/RepositoryInfoBean.java
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/service/RepositoryInfoBean.java
index d0ba946..c9a6ac0 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/service/RepositoryInfoBean.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/service/RepositoryInfoBean.java
@@ -1,9 +1,4 @@
-/**
- * 
- */
-package org.apache.stratos.manager.service;
 /*
- *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -12,7 +7,7 @@ package org.apache.stratos.manager.service;
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
@@ -20,10 +15,11 @@ package org.apache.stratos.manager.service;
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
-*/
+ */
 
+package org.apache.stratos.manager.service;
 
+import java.util.Arrays;
 
 /**
  *
@@ -36,8 +32,7 @@ public class RepositoryInfoBean {
 	private String userName;
 	private String password;
 	private String[] dirArray;
-	
-	
+
 	public RepositoryInfoBean(String repoURL, String cartridgeAlias, String tenantDomain,
                               String userName, String password, String[] dirArray) {
 	    this.repoURL = repoURL;
@@ -45,7 +40,7 @@ public class RepositoryInfoBean {
 	    this.tenantDomain = tenantDomain;
 	    this.userName = userName;
 	    this.setPassword(password);
-	    this.dirArray = dirArray;
+        setDirArray(dirArray);
     }
 	public String getRepoURL() {
     	return repoURL;
@@ -75,7 +70,11 @@ public class RepositoryInfoBean {
     	return dirArray;
     }
 	public void setDirArray(String[] dirArray) {
-    	this.dirArray = dirArray;
+        if(dirArray == null) {
+            this.dirArray = new String[0];
+        } else {
+            this.dirArray = Arrays.copyOf(dirArray, dirArray.length);
+        }
     }
     public String getPassword() {
         return password;
@@ -83,7 +82,4 @@ public class RepositoryInfoBean {
     public void setPassword(String password) {
         this.password = password;
     }
-	
-	
-	
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/util/Properties.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/util/Properties.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/util/Properties.java
index 3f2c5cf..5825006 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/util/Properties.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/util/Properties.java
@@ -18,10 +18,11 @@
  */
 package org.apache.stratos.messaging.util;
 
+import java.util.Arrays;
+
 /**
  * Had to wrap {@link Property} array using a class, since there's a bug in
- * current
- * stub generation.
+ * current stub generation.
  */
 public class Properties {
 
@@ -32,7 +33,10 @@ public class Properties {
 	}
 
 	public void setProperties(Property[] properties) {
-		this.properties = properties;
+        if(properties == null) {
+            this.properties = new Property[0];
+        } else {
+            this.properties = Arrays.copyOf(properties, properties.length);
+        }
 	}
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Properties.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Properties.java
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Properties.java
index 93e1e68..643e1db 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Properties.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/bean/kubernetes/Properties.java
@@ -35,7 +35,11 @@ public class Properties implements Serializable{
     }
 
     public void setProperties(Property[] properties) {
-        this.properties = properties;
+        if(properties == null) {
+            this.properties = new Property[0];
+        } else {
+            this.properties = Arrays.copyOf(properties, properties.length);
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/PaginatedTenantDataBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/PaginatedTenantDataBean.java
b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/PaginatedTenantDataBean.java
index 01f10ed..c7ea51b 100644
--- a/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/PaginatedTenantDataBean.java
+++ b/components/org.apache.stratos.tenant.activity/src/main/java/org/apache/stratos/tenant/activity/beans/PaginatedTenantDataBean.java
@@ -21,6 +21,7 @@ package org.apache.stratos.tenant.activity.beans;
 import org.wso2.carbon.utils.Pageable;
 
 import java.io.Serializable;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -35,7 +36,11 @@ public class PaginatedTenantDataBean implements Pageable, Serializable
{
     }
 
     public void setTenantInfoBeans(TenantDataBean[] tenantInfoBeans) {
-        this.tenantInfoBeans = tenantInfoBeans;
+        if(tenantInfoBeans == null) {
+            this.tenantInfoBeans = new TenantDataBean[0];
+        } else {
+            this.tenantInfoBeans = Arrays.copyOf(tenantInfoBeans, tenantInfoBeans.length);
+        }
     }
 
     public int getNumberOfPages() {

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/beans/PaginatedTenantInfoBean.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/beans/PaginatedTenantInfoBean.java
b/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/beans/PaginatedTenantInfoBean.java
index f0c0b58..a5eb668 100644
--- a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/beans/PaginatedTenantInfoBean.java
+++ b/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/beans/PaginatedTenantInfoBean.java
@@ -21,6 +21,7 @@ package org.apache.stratos.tenant.mgt.beans;
 import org.apache.stratos.common.beans.TenantInfoBean;
 import org.wso2.carbon.utils.Pageable;
 
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -35,7 +36,11 @@ public class PaginatedTenantInfoBean implements Pageable {
     }
 
     public void setTenantInfoBeans(TenantInfoBean[] tenantInfoBeans) {
-        this.tenantInfoBeans = tenantInfoBeans;
+        if(tenantInfoBeans == null) {
+            this.tenantInfoBeans = new TenantInfoBean[0];
+        } else {
+            this.tenantInfoBeans = Arrays.copyOf(tenantInfoBeans, tenantInfoBeans.length);
+        }
     }
 
     public int getNumberOfPages() {

http://git-wip-us.apache.org/repos/asf/stratos/blob/f01902e2/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index 00c9188..4766c1e 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -31,7 +31,7 @@
 	<groupId>org.apache.stratos</groupId>
 	<artifactId>stratos-components-parent</artifactId>
 	<packaging>pom</packaging>
-	<name>Apache Stratos - Components - Parent Module</name>
+	<name>Apache Stratos - Components</name>
 	<url>http://apache.org</url>
 
     <modules>


Mime
View raw message