Author: chris.laprun(a)jboss.com
Date: 2008-04-21 18:20:27 -0400 (Mon, 21 Apr 2008)
New Revision: 10680
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
Log:
- add* methods now properly create a collection even if the given collection is empty.
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-04-21
22:13:52 UTC (rev 10679)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2008-04-21
22:20:27 UTC (rev 10680)
@@ -491,15 +491,12 @@
if (modes != null)
{
int size = modes.size();
- if (size != 0)
+ if (this.modes == null)
{
- if (this.modes == null)
- {
- this.modes = new HashSet(size);
- }
-
- this.modes.addAll(modes);
+ this.modes = new HashSet(size);
}
+
+ this.modes.addAll(modes);
}
}
@@ -508,15 +505,12 @@
if (windowStates != null)
{
int size = windowStates.size();
- if (size != 0)
+ if (this.windowStates == null)
{
- if (this.windowStates == null)
- {
- this.windowStates = new HashSet(size);
- }
-
- this.windowStates.addAll(windowStates);
+ this.windowStates = new HashSet(size);
}
+
+ this.windowStates.addAll(windowStates);
}
}
@@ -525,15 +519,12 @@
if (locales != null)
{
int size = locales.size();
- if (size != 0)
+ if (this.locales == null)
{
- if (this.locales == null)
- {
- this.locales = new HashSet(size);
- }
-
- this.locales.addAll(locales);
+ this.locales = new HashSet(size);
}
+
+ this.locales.addAll(locales);
}
}
}
Show replies by date