Author: julien_viet
Date: 2011-01-14 18:48:47 -0500 (Fri, 14 Jan 2011)
New Revision: 5753
Modified:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletContextImpl.java
Log:
GTNPC-52 : PortletContext setAttribute should throw an IAE when the name argument is null
Modified:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletContextImpl.java
===================================================================
---
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletContextImpl.java 2011-01-14
23:34:05 UTC (rev 5752)
+++
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletContextImpl.java 2011-01-14
23:48:47 UTC (rev 5753)
@@ -126,7 +126,7 @@
public Set<String> getResourcePaths(String s)
{
Set<String> paths = (Set<String>)servletContext.getResourcePaths(s);
- // Some container (jetty) may return an empty set instead of null
+ // Some container (jetty) may return an empty set instead of null
return (paths == null || paths.isEmpty()) ? null : paths;
}
@@ -188,6 +188,10 @@
public void setAttribute(String s, Object o)
{
+ if (s == null)
+ {
+ throw new IllegalArgumentException("attribute name must not be
null");
+ }
servletContext.setAttribute(s, o);
}
Show replies by date