3 Replies Latest reply on Mar 22, 2011 11:04 AM by Ben Utzer

    Logger in Seam 2.2.1 Snapshot

    Pjot Andreev Newbie
      I`ve just downloaded snapshot from http://hudson.jboss.org/hudson/job/Seam-2.2.X-nightly/lastSuccessfulBuild/ and the LogImpl seems to be broken, it logs un-interpolated messages.
      In org.jboss.seam.log.LogImpl, method:

        private Object interpolate(Object object, Object... params)
         {
            if (object instanceof String)
            {
               try {
                  return Interpolator.instance().interpolate( (String) object, params );
               } catch (Exception e) {
                  log.error("exception interpolating string: " + object, e);
               } finally {
                  return object;
               }
              
            }
            else
            {
               return object;
            }
         }



      should be:


      private Object interpolate(Object object, Object... params)
                 {
                    if (object instanceof String)
                    {
                       try {
                          return Interpolator.instance().interpolate( (String) object, params );
                       } catch (Exception e) {
                          log.error("exception interpolating string: " + object, e);
                          return object;
                       }              
                    }
                    else
                    {
                       return object;
                    }
                 }

      i.e. finally
      always overwrites the interpolated value!