[seam-commits] Seam SVN: r12492 - in modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces: event and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Apr 14 08:21:27 EDT 2010


Author: nickarls
Date: 2010-04-14 08:21:26 -0400 (Wed, 14 Apr 2010)
New Revision: 12492

Modified:
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/ServletContextBeanManagerProvider.java
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java
Log:
bad cast + opt out if no BeanManager

Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/ServletContextBeanManagerProvider.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/ServletContextBeanManagerProvider.java	2010-04-14 10:27:46 UTC (rev 12491)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/ServletContextBeanManagerProvider.java	2010-04-14 12:21:26 UTC (rev 12492)
@@ -38,7 +38,7 @@
    @Override
    public BeanManager getBeanManager()
    {
-      ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext();
+      ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
       return (BeanManager) servletContext.getAttribute(BeanManager.class.getName());
    }
 

Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java	2010-04-14 10:27:46 UTC (rev 12491)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java	2010-04-14 12:21:26 UTC (rev 12492)
@@ -62,8 +62,12 @@
    @SuppressWarnings("unchecked")
    private List<SystemEventListener> getEventListeners()
    {
+      List<SystemEventListener> result = new ArrayList<SystemEventListener>();
       BeanManager manager = getBeanManager();
-      List<SystemEventListener> result = new ArrayList<SystemEventListener>();
+      if (manager == null)
+      {
+         return result;
+      }
 
       Bean<SystemEventBridge> bean = (Bean<SystemEventBridge>) manager.getBeans(SystemEventBridge.class).iterator().next();
       CreationalContext<SystemEventBridge> context = manager.createCreationalContext(bean);



More information about the seam-commits mailing list