Author: julien(a)jboss.com
Date: 2007-06-26 12:46:07 -0400 (Tue, 26 Jun 2007)
New Revision: 7558
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
Log:
on portlet app deployment put the key that is a duplicate or absent during add/remove
operations
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java 2007-06-26
16:30:55 UTC (rev 7557)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java 2007-06-26
16:46:07 UTC (rev 7558)
@@ -61,13 +61,14 @@
}
synchronized (this)
{
- if (portletApplications.containsKey(portletApplication.getId()))
+ String key = portletApplication.getId();
+ if (portletApplications.containsKey(key))
{
- throw new IllegalArgumentException("This portlet app is already
registered");
+ throw new IllegalArgumentException("This portlet app is already
registered: " + key);
}
PortletApplicationRegistrationContext ctx = new
PortletApplicationRegistrationContextImpl(portletApplication);
Map webAppsCopy = new HashMap(portletApplications);
- webAppsCopy.put(portletApplication.getId(), portletApplication);
+ webAppsCopy.put(key, portletApplication);
portletApplications = webAppsCopy;
return ctx;
}
@@ -81,12 +82,13 @@
}
synchronized (this)
{
- if (!portletApplications.containsKey(portletApplication.getId()))
+ String key = portletApplication.getId();
+ if (!portletApplications.containsKey(key))
{
- throw new IllegalArgumentException("This portlet app does not exist
here");
+ throw new IllegalArgumentException("This portlet app does not exist
here: " + key);
}
Map webAppsCopy = new HashMap(portletApplications);
- webAppsCopy.remove(portletApplication.getId());
+ webAppsCopy.remove(key);
portletApplications = webAppsCopy;
}
}
Show replies by date