myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1509759 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Date Fri, 02 Aug 2013 16:14:59 GMT
Author: lu4242
Date: Fri Aug  2 16:14:58 2013
New Revision: 1509759

URL: http://svn.apache.org/r1509759
Log:
small fix ignore renderer element when renderer class is not defined

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java?rev=1509759&r1=1509758&r2=1509759&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Fri Aug  2 16:14:58 2013
@@ -1025,20 +1025,36 @@ public class FacesConfigurator
                 javax.faces.render.Renderer renderer;
                 Collection<ClientBehaviorRenderer> clientBehaviorRenderers
                         = dispenser.getClientBehaviorRenderers(renderKitId);
-
-                try
-                {
-                    renderer = (javax.faces.render.Renderer) ClassUtils.newInstance(element.getRendererClass());
+                
+                if (element.getRendererClass() != null)
+                {    
+                    try
+                    {
+                        renderer = (javax.faces.render.Renderer) ClassUtils.newInstance(element.getRendererClass());
+                    }
+                    catch (Throwable e)
+                    {
+                        // ignore the failure so that the render kit is configured
+                        log.log(Level.SEVERE, "failed to configure class " + element.getRendererClass(),
e);
+                        continue;
+                    }
+                    if (renderer != null)
+                    {
+                        renderKit.addRenderer(element.getComponentFamily(), element.getRendererType(),
renderer);
+                    }
+                    else
+                    {
+                        log.log(Level.INFO, "Renderer instance cannot be created for "+
+                                element.getRendererClass()+ ", ignoring..." + 
+                                element.getRendererClass());
+                    }
                 }
-                catch (Throwable e)
+                else
                 {
-                    // ignore the failure so that the render kit is configured
-                    log.log(Level.SEVERE, "failed to configure class " + element.getRendererClass(),
e);
-                    continue;
+                        log.log(Level.INFO, "Renderer element with no rendererClass found,
ignoring..." +
+                                element.getRendererClass());
                 }
 
-                renderKit.addRenderer(element.getComponentFamily(), element.getRendererType(),
renderer);
-
                 // Add in client behavior renderers.
 
                 for (ClientBehaviorRenderer clientBehaviorRenderer : clientBehaviorRenderers)



Mime
View raw message