From: Eric P. <th...@us...> - 2010-10-17 17:14:25
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv5869 Modified Files: StringUtil.java Log Message: Fixed bug in replaceAll. If the tag to be replaced was at the end of the string this just looped. Index: StringUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/StringUtil.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** StringUtil.java 28 Sep 2010 23:50:49 -0000 1.41 --- StringUtil.java 17 Oct 2010 17:14:17 -0000 1.42 *************** *** 1134,1138 **** retval+=repl; int remindex=tagindex + tag.length(); ! if(remindex<remainder.length()) { remainder=remainder.substring(remindex); } tagindex=remainder.indexOf(tag); } --- 1134,1139 ---- retval+=repl; int remindex=tagindex + tag.length(); ! //if tag is at the end of remainder, then remindex==length ! if(remindex<=remainder.length()) { remainder=remainder.substring(remindex); } tagindex=remainder.indexOf(tag); } |