[jboss-user] [JBoss Seam] - org.jboss.seam.core.Interpolator

sradford do-not-reply at jboss.com
Mon Jan 15 13:47:19 EST 2007


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 )

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4001868#4001868

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4001868



More information about the jboss-user mailing list