if (add < 1) add = 1;
  public String transform(String word) {    if (ruleArray == null)      return null;    TransformationRule rule;    StringBuffer str = new StringBuffer(word.toUpperCase());    int strLength = str.length();    int startPos = 0, add = 1;    while (startPos < strLength) {      if (Character.isDigit(str.charAt(startPos))) {        StringUtility.replace(str, startPos, startPos + DIGITCODE.length(), DIGITCODE);        startPos += add;        continue;      }      add = 1;      for (int i = 0; i < ruleArray.length; i++) {        //System.out.println("Testing rule#:"+i);        rule = (TransformationRule) ruleArray[i];        if (rule.startsWithExp() && startPos > 0)          continue;        if (startPos + rule.lengthOfMatch() > strLength) {          continue;        }        if (rule.isMatching(str, startPos)) {          String replaceExp = rule.getReplaceExp();          add = replaceExp.length();          StringUtility.replace(str, startPos, startPos + rule.getTakeOut(), replaceExp);          strLength -= rule.getTakeOut();          strLength += add;          //System.out.println("Replacing with rule#:"+i+" add="+add);          break;        }      }      if (add < 1) //wrs: there used to be an infinite loop on "user7" since replaceExp.length returned 0        add = 1;      startPos += add;    }    return str.toString();  }