modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java
| 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 0e07e711e02884bc81f9b5929290bb448857aaf7
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Nov 22 11:16:57 2010 -0500
Fix issue with render of empty groups. Protect ClusterFlyWeight when there
are no children.
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java
index 5e2e207..5422c95 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java
@@ -23,6 +23,7 @@
package org.rhq.core.domain.resource.group.composite;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -38,7 +39,7 @@ public class ClusterFlyweight implements Serializable {
private String name;
- private List<ClusterFlyweight> children;
+ private List<ClusterFlyweight> children = new
ArrayList<ClusterFlyweight>(0);
private int members;
@@ -70,7 +71,7 @@ public class ClusterFlyweight implements Serializable {
}
public void setChildren(List<ClusterFlyweight> clusterKeyFlyweights) {
- this.children = clusterKeyFlyweights;
+ this.children = (null != clusterKeyFlyweights) ? clusterKeyFlyweights : new
ArrayList<ClusterFlyweight>(0);
}
public int getGroupId() {
Show replies by date