Author: chris.laprun(a)jboss.com
Date: 2011-04-08 16:24:23 -0400 (Fri, 08 Apr 2011)
New Revision: 6185
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
Log:
- GTNPC-58: Added constant for error message in case an id is interpreted as invalid to
facilitate downstream processing (i.e. allow discrimination of IllegalArgumentException
via exception message) :/
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-04-08
11:29:01 UTC (rev 6184)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-04-08
20:24:23 UTC (rev 6185)
@@ -48,6 +48,7 @@
public static final String CONSUMER_CLONE_ID = PRODUCER_CLONE_ID_PREFIX +
CONSUMER_CLONE_DUMMY_STATE_ID;
public final static PortletContext LOCAL_CONSUMER_CLONE =
PortletContext.createPortletContext(PortletInvoker.LOCAL_PORTLET_INVOKER_ID + SEPARATOR +
CONSUMER_CLONE_ID);
+ public static final String INVALID_PORTLET_CONTEXT = "Invalid portlet context:
";
protected final String id;
private final PortletContextComponents components;
@@ -169,13 +170,13 @@
}
catch (Exception e)
{
- throw new IllegalArgumentException("Couldn't interpret id
'" + id + "'", e);
+ throw new IllegalArgumentException(INVALID_PORTLET_CONTEXT + id, e);
}
}
if (interpret && !(isSimpleAppPortlet || isCompoundAppPortlet ||
isOpaquePortlet || isCloned))
{
- throw new IllegalArgumentException("Couldn't interpret id '" +
id + "'");
+ throw new IllegalArgumentException(INVALID_PORTLET_CONTEXT + id);
}
this.components = components;