W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2009

2002/css-validator/org/w3c/css/util Messages.java,1.28,1.29

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 24 Feb 2009 23:27:10 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Lc6gA-0005bc-IR@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/util
In directory hutz:/tmp/cvs-serv21411

Modified Files:
	Messages.java 
Log Message:
small modification of the replacement alg


Index: Messages.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- Messages.java	24 Feb 2009 22:22:07 -0000	1.28
+++ Messages.java	24 Feb 2009 23:27:08 -0000	1.29
@@ -168,12 +168,12 @@
 	}
 	String[] msg_parts = getString(message).split("%s");
 	Iterator<String> param_it = params.iterator();
-	StringBuilder sb = new StringBuilder(message.length());
-	for (int i=0; i<msg_parts.length; i++) {
-	    sb.append(msg_parts[i]);
+	StringBuilder sb = new StringBuilder(msg_parts[0]);
+	for (int i=1; i<msg_parts.length; i++) {
 	    if (param_it.hasNext()) {
 		sb.append(param_it.next());
 	    }
+	    sb.append(msg_parts[i]);
 	}
 	return sb.toString();
     }
Received on Tuesday, 24 February 2009 23:27:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:08 GMT