[seam-commits] Seam SVN: r12676 - in modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet: event and 1 other directory.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sat May 1 12:40:09 EDT 2010
Author: lincolnthree
Date: 2010-05-01 12:40:08 -0400 (Sat, 01 May 2010)
New Revision: 12676
Modified:
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/beanManager/ServletContextBeanManagerProvider.java
modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/event/ServletEventBridge.java
Log:
Fixed potential NullPointer if not operating in proper servlet environment.
Modified: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/beanManager/ServletContextBeanManagerProvider.java
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/beanManager/ServletContextBeanManagerProvider.java 2010-05-01 02:33:09 UTC (rev 12675)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/beanManager/ServletContextBeanManagerProvider.java 2010-05-01 16:40:08 UTC (rev 12676)
@@ -37,20 +37,25 @@
{
private static ThreadLocal<ServletContext> servletContext = new ThreadLocal<ServletContext>()
{
+ @Override
protected ServletContext initialValue()
{
return null;
}
};
- public static void setServletContext(ServletContext sc)
+ public static void setServletContext(final ServletContext sc)
{
servletContext.set(sc);
}
public BeanManager getBeanManager()
{
- return (BeanManager) servletContext.get().getAttribute(BeanManager.class.getName());
+ if (servletContext.get() != null)
+ {
+ return (BeanManager) servletContext.get().getAttribute(BeanManager.class.getName());
+ }
+ return null;
}
public int getPrecedence()
Modified: modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/event/ServletEventBridge.java
===================================================================
--- modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/event/ServletEventBridge.java 2010-05-01 02:33:09 UTC (rev 12675)
+++ modules/servlet/trunk/impl/src/main/java/org/jboss/seam/servlet/event/ServletEventBridge.java 2010-05-01 16:40:08 UTC (rev 12676)
@@ -316,7 +316,7 @@
return value;
}
- public AttributeLiteral(String value)
+ public AttributeLiteral(final String value)
{
this.value = value;
}
@@ -331,7 +331,7 @@
return value;
}
- public ValueLiteral(String value)
+ public ValueLiteral(final String value)
{
this.value = value;
}
More information about the seam-commits
mailing list