[seam-commits] Seam SVN: r8877 - trunk/src/main/org/jboss/seam/international.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Sep 2 07:06:05 EDT 2008


Author: pete.muir at jboss.org
Date: 2008-09-02 07:06:05 -0400 (Tue, 02 Sep 2008)
New Revision: 8877

Modified:
   trunk/src/main/org/jboss/seam/international/StatusMessage.java
   trunk/src/main/org/jboss/seam/international/StatusMessages.java
Log:
Argh, another bug in adding messages!

Modified: trunk/src/main/org/jboss/seam/international/StatusMessage.java
===================================================================
--- trunk/src/main/org/jboss/seam/international/StatusMessage.java	2008-09-02 04:56:59 UTC (rev 8876)
+++ trunk/src/main/org/jboss/seam/international/StatusMessage.java	2008-09-02 11:06:05 UTC (rev 8877)
@@ -52,6 +52,11 @@
       }
    }
    
+   public boolean isEmpty()
+   {
+      return Strings.isEmpty(summary) || Strings.isEmpty(summaryTemplate);
+   }
+   
    public void interpolate(Object... params)
    {
       if (!Strings.isEmpty(summaryTemplate))

Modified: trunk/src/main/org/jboss/seam/international/StatusMessages.java
===================================================================
--- trunk/src/main/org/jboss/seam/international/StatusMessages.java	2008-09-02 04:56:59 UTC (rev 8876)
+++ trunk/src/main/org/jboss/seam/international/StatusMessages.java	2008-09-02 11:06:05 UTC (rev 8877)
@@ -14,7 +14,6 @@
 import org.jboss.seam.ScopeType;
 import org.jboss.seam.contexts.Contexts;
 import org.jboss.seam.international.StatusMessage.Severity;
-import org.jboss.seam.util.Strings;
 
 /**
  * Abstract base class for providing status messages. View layers should provide
@@ -73,16 +72,18 @@
    public void add(Severity severity, String key, String detailKey, String messageTemplate, String messageDetailTemplate, final Object... params)
    {
       final StatusMessage message = new StatusMessage(severity, key, detailKey, messageTemplate, messageDetailTemplate);
-      if (!Strings.isEmpty(message.getSummary()))
+      if (!message.isEmpty())
       {
          messages.add(message);
          getTasks().add(
                new Runnable() 
                {
+                  
                   public void run() 
                   {
                       message.interpolate(params);
                   }
+                  
                }
          );
       }
@@ -103,7 +104,7 @@
    public void addToControl(String id, Severity severity, String key, String messageTemplate, final Object... params)
    {
       final StatusMessage message = new StatusMessage(severity, key, null, messageTemplate, null);
-      if (!Strings.isEmpty(message.getSummary()))
+      if (!message.isEmpty())
       {         
          if (keyedMessages.containsKey(id))
          {




More information about the seam-commits mailing list