Author: julien(a)jboss.com
Date: 2007-11-12 10:30:47 -0500 (Mon, 12 Nov 2007)
New Revision: 8883
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/portlet/PortletContextFactory.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalNodeTestCase.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
Log:
fix the thing I did not fix before
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/portlet/PortletContextFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/portlet/PortletContextFactory.java 2007-11-12
15:24:46 UTC (rev 8882)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/portlet/PortletContextFactory.java 2007-11-12
15:30:47 UTC (rev 8883)
@@ -123,8 +123,8 @@
public PortalContextImpl()
{
- windowStates = Collections.unmodifiableSet(new
CollectionBuilder().add(WindowState.MAXIMIZED).add(WindowState.MINIMIZED).add(WindowState.NORMAL).toHashSet());
- modes = Collections.unmodifiableSet(new
CollectionBuilder().add(Mode.EDIT).add(Mode.HELP).add(Mode.VIEW).toHashSet());
+ windowStates =
Collections.unmodifiableSet((Set)CollectionBuilder.hashSet().add(WindowState.MAXIMIZED).add(WindowState.MINIMIZED).add(WindowState.NORMAL).get());
+ modes =
Collections.unmodifiableSet((Set)CollectionBuilder.hashSet().add(Mode.EDIT).add(Mode.HELP).add(Mode.VIEW).get());
props = Collections.EMPTY_MAP;
}
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalNodeTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalNodeTestCase.java 2007-11-12
15:24:46 UTC (rev 8882)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalNodeTestCase.java 2007-11-12
15:30:47 UTC (rev 8883)
@@ -25,7 +25,6 @@
import junit.framework.TestSuite;
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.common.junit.TransactionAssert;
-import org.jboss.portal.common.util.CollectionBuilder;
import org.jboss.portal.core.impl.api.node.PortalNodeImpl;
import org.jboss.portal.core.model.portal.Context;
import org.jboss.portal.core.model.portal.Page;
@@ -39,6 +38,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
+import java.util.Collections;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -76,7 +76,7 @@
AuthorizationDomain auth = container.getAuthorizationDomain();
DomainConfigurator cfg = auth.getConfigurator();
Portal p_1 = (Portal)container.getObject(PortalObjectId.parse("/1",
PortalObjectPath.CANONICAL_FORMAT));
- cfg.setSecurityBindings(p_1.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
CollectionBuilder.singleton(new RoleSecurityBinding("view",
"admin")).toHashSet());
+ cfg.setSecurityBindings(p_1.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
Collections.singleton(new RoleSecurityBinding("view", "admin")));
TransactionAssert.commitTransaction();
//
@@ -103,7 +103,7 @@
AuthorizationDomain auth = container.getAuthorizationDomain();
DomainConfigurator cfg = auth.getConfigurator();
Portal tmp = (Portal)container.getObject(PortalObjectId.parse("/1",
PortalObjectPath.CANONICAL_FORMAT));
- cfg.setSecurityBindings(tmp.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
CollectionBuilder.singleton(new RoleSecurityBinding("viewrecursive",
"admin")).toHashSet());
+ cfg.setSecurityBindings(tmp.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
Collections.singleton(new RoleSecurityBinding("viewrecursive",
"admin")));
TransactionAssert.commitTransaction();
//
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-11-12
15:24:46 UTC (rev 8882)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-11-12
15:30:47 UTC (rev 8883)
@@ -296,19 +296,19 @@
PortalObject o_1_1_4 = o_1_1.getChild("4");
List l1 = new ArrayList(o_1_1.getChildren());
Collections.sort(l1, new PortalObjectComparator());
- assertEquals(new
CollectionBuilder().add(o_1_1_1).add(o_1_1_2).add(o_1_1_3).add(o_1_1_4).toArrayList(),
l1);
+
assertEquals(CollectionBuilder.arrayList().add(o_1_1_1).add(o_1_1_2).add(o_1_1_3).add(o_1_1_4).get(),
l1);
List l2 = new ArrayList(o_1_1.getChildren(PortalObject.PAGE_MASK));
Collections.sort(l2, new PortalObjectComparator());
- assertEquals(new CollectionBuilder().add(o_1_1_1).add(o_1_1_3).toArrayList(), l2);
+ assertEquals(CollectionBuilder.arrayList().add(o_1_1_1).add(o_1_1_3).get(), l2);
List l3 = new ArrayList(o_1_1.getChildren(PortalObject.WINDOW_MASK));
Collections.sort(l3, new PortalObjectComparator());
- assertEquals(new CollectionBuilder().add(o_1_1_2).add(o_1_1_4).toArrayList(), l3);
+ assertEquals(CollectionBuilder.arrayList().add(o_1_1_2).add(o_1_1_4).get(), l3);
List l4 = new ArrayList(o_1_1.getChildren(0));
Collections.sort(l4, new PortalObjectComparator());
- assertEquals(new CollectionBuilder().toArrayList(), l4);
+ assertEquals(CollectionBuilder.arrayList().get(), l4);
List l5 = new ArrayList(o_1_1.getChildren(PortalObject.PORTAL_MASK));
Collections.sort(l5, new PortalObjectComparator());
- assertEquals(new CollectionBuilder().toArrayList(), l5);
+ assertEquals(CollectionBuilder.arrayList().get(), l5);
TransactionAssert.commitTransaction();
}
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-11-12
15:24:46 UTC (rev 8882)
+++
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-11-12
15:30:47 UTC (rev 8883)
@@ -25,6 +25,7 @@
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
+import java.util.List;
import org.jboss.portal.common.util.CollectionBuilder;
import org.jboss.portal.widget.AbstractWidgetProvider;
@@ -37,7 +38,7 @@
public final class GGProvider extends AbstractWidgetProvider
{
/** The google categories */
- private static final Collection CATEGORIES = Collections.unmodifiableList(new
CollectionBuilder()
+ private static final Collection CATEGORIES =
Collections.unmodifiableList((List)CollectionBuilder.arrayList()
.add(new GGWidgetCategoryInfo("all", "Popular"))
.add(new GGWidgetCategoryInfo("news", "News"))
.add(new GGWidgetCategoryInfo("communication",
"Communication"))
@@ -47,7 +48,7 @@
.add(new GGWidgetCategoryInfo("lifestyle", "Lifestyle"))
.add(new GGWidgetCategoryInfo("technology", "Technology"))
.add(new GGWidgetCategoryInfo("new", "New stuff"))
- .toArrayList());
+ .get());
public Collection getCategories()
{