myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1155087 - /myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
Date Mon, 08 Aug 2011 20:41:53 GMT
Author: lu4242
Date: Mon Aug  8 20:41:52 2011
New Revision: 1155087

URL: http://svn.apache.org/viewvc?rev=1155087&view=rev
Log:
MYFACES-3243 Improve warnings in HtmlImageRendererBase (thanks to Martin Koci for provide
this patch)

Modified:
    myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java

Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java?rev=1155087&r1=1155086&r2=1155087&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
Mon Aug  8 20:41:52 2011
@@ -95,7 +95,8 @@ public class HtmlImageRendererBase
         }
         else
         {
-          if (log.isLoggable(Level.WARNING)) log.warning("Graphic with id " + uiComponent.getClientId(facesContext)
+ " has no value (url or name).");
+          if (facesContext.isProjectStage(ProjectStage.Development) && log.isLoggable(Level.WARNING))

+              log.warning("Component UIGraphic " + uiComponent.getClientId(facesContext)
+ " has no attribute url, value, name or attribute resolves to null. Path to component " +
RendererUtils.getPathToComponent(uiComponent));
         }
 
         /* 
@@ -103,10 +104,8 @@ public class HtmlImageRendererBase
          */                
         if (uiComponent.getAttributes().get(HTML.ALT_ATTR) == null) 
         {
-            //we don't want to flood logs with warnings in production and system test environments
-            ProjectStage projectStage = facesContext.getApplication().getProjectStage();
-            if(projectStage.equals(ProjectStage.Development) || projectStage.equals(ProjectStage.UnitTest))
-                log.warning("ALT attribute is missing for : " + uiComponent.getId());
+            if(!facesContext.isProjectStage(ProjectStage.Development) && log.isLoggable(Level.WARNING))
+                log.warning("Component UIGraphic " + uiComponent.getClientId(facesContext)
+ " has no attribute alt or attribute resolves to null. Path to component " + RendererUtils.getPathToComponent(uiComponent));
         }
 
         if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))



Mime
View raw message