1 Reply Latest reply on Jan 15, 2007 8:28 PM by Gavin King

    org.jboss.seam.core.Interpolator

    Sean Radford Novice

      I may be being stupid, but is there a logic error here:

      public String interpolate(String string, Object... params) {
       if ( params.length>10 )
       {
       throw new IllegalArgumentException("more than 10 parameters");
       }
       if ( string.indexOf('#')>=0 )
       {
       string = interpolateExpressions(string, params);
       }
       if ( params.length>1 && string.indexOf('{')>=0 )
       {
       string = new MessageFormat(string, Locale.instance()).format(params);
       }
       return string;
      }


      Should the
      if ( params.length>1 && string.indexOf('{')>=0 )

      actually read
      if ( params.length>0 && string.indexOf('{')>=0 )