Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Auge2015-06-11 18:34:06 +0000
committerRaymond Auge2015-07-02 03:08:34 +0000
commit9617717b1b3ad2feb417c07e35db169c041394c1 (patch)
tree7356842bf2628dad535f0165fbcb11b551a422f8 /bundles
parenta7d895eec59646516a89bfe020b23546cd7f3c1e (diff)
downloadrt.equinox.bundles-9617717b1b3ad2feb417c07e35db169c041394c1.tar.gz
rt.equinox.bundles-9617717b1b3ad2feb417c07e35db169c041394c1.tar.xz
rt.equinox.bundles-9617717b1b3ad2feb417c07e35db169c041394c1.zip
Bug 469988 - [http] calling servletContext.setAttribute(name, null) causes NPE
Signed-off-by: Raymond Auge <raymond.auge@liferay.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java
index e0f497df0..3430a2ba2 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ServletContextAdaptor.java
@@ -299,7 +299,13 @@ public class ServletContextAdaptor {
throw new UnsupportedOperationException();
}
- public void setAttribute(String attributeName, Object attributeValue) {
+ public void setAttribute(String attributeName, Object attributeValue) {
+ if (attributeValue == null) {
+ removeAttribute(attributeName);
+
+ return;
+ }
+
Dictionary<String, Object> attributes = getContextAttributes();
boolean added = (attributes.get(attributeName) == null);
attributes.put(attributeName, attributeValue);

Back to the top