2 Replies Latest reply on Sep 2, 2008 3:15 PM by he youlin

    Seam 2.1 build 298 StatusMessages.add still exsits bug

    he youlin Novice
      In StatusMessages.java
      
         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()))
            {
               messages.add(message);
               getTasks().add(
                     new Runnable() 
                     {
                        public void run() 
                        {
                            message.interpolate(params);
                        }
                     }
               );
            }
         }
      
      there if (!Strings.isEmpty(message.getSummary())) always false until message.interpolate(params).
      
      to fix it must fix StatusMessage.java
      
      45   public StatusMessage(Severity severity, String key, String detailKey, String defaultMessageTemplate, String defaultMessageDetailTemplate)
      46   {
      47      this.summaryTemplate = getBundleMessage(key, defaultMessageTemplate);
      48      this.detailTemplate = getBundleMessage(detailKey, defaultMessageDetailTemplate);
      49      if ( !Strings.isEmpty(summaryTemplate) )
      50      {
      +            this.summary=summaryTemplate;
      51         this.severity = severity;
      52      }
      53   }