Author: nfilotto
Date: 2010-06-17 05:03:54 -0400 (Thu, 17 Jun 2010)
New Revision: 2649
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
Log:
EXOJCR-795: Inconsistency issue between the methods getPortalContainerNames and
isScopeValid has been fixed
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-06-17
08:55:48 UTC (rev 2648)
+++
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-06-17
09:03:54 UTC (rev 2649)
@@ -539,26 +539,11 @@
*/
public boolean isScopeValid(String portalContainerName, String contextName)
{
- if (portalContainerNames.contains(contextName))
+ if (portalContainerName == null)
{
- // The given context name is a context name of a portal container
- return true;
- }
- else if (scopes.isEmpty())
- {
- // we assume that the old behavior is expected
- return defaultDefinition.getName().equals(portalContainerName);
+ throw new IllegalArgumentException("The portal container name cannot be
null");
}
- final List<String> result = scopes.get(contextName);
- if (result == null || result.isEmpty())
- {
- // This context has not been added as dependency of any portal containers
- return false;
- }
- else
- {
- return result.contains(portalContainerName);
- }
+ return getPortalContainerNames(contextName).contains(portalContainerName);
}
/**
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-06-17
08:55:48 UTC (rev 2648)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-06-17
09:03:54 UTC (rev 2649)
@@ -486,6 +486,7 @@
assertFalse(config.isScopeValid("foo", "foo"));
assertFalse(config.isScopeValid("myPortal", "foo"));
assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
+ assertFalse(config.isScopeValid("myPortal-pcdef",
"myPortal"));
assertFalse(config.isScopeValid("myPortal-pcdef", "fooY"));
assertTrue(config.hasDefinition());
Show replies by date