throws Throwable
  private static Value str_replace_impl(Env env,                                        Value search,                                        Value replace,                                        String subject,                                        Value count)    throws Throwable  {    if (! search.isArray()) {      String searchString = search.toString();      if (searchString.length() == 0)        return new StringValueImpl(subject);      if (replace instanceof ArrayValue) {        env.warning(L.l("Array to string conversion"));      }      subject = str_replace_impl(env,                                 searchString,                                 replace.toString(),                                 subject,                                 count);    }    else if (replace instanceof ArrayValue) {      ArrayValue searchArray = (ArrayValue) search;      ArrayValue replaceArray = (ArrayValue) replace;      Iterator<Value> searchIter = searchArray.values().iterator();      Iterator<Value> replaceIter = replaceArray.values().iterator();      while (searchIter.hasNext()) {        Value searchItem = searchIter.next();        Value replaceItem = replaceIter.next();        if (replaceItem == null)          replaceItem = NullValue.NULL;        subject = str_replace_impl(env,                                   searchItem.toString(),                                   replaceItem.toString(),                                   subject,                                   count);      }    }    else {      ArrayValue searchArray = (ArrayValue) search;      Iterator<Value> searchIter = searchArray.values().iterator();      while (searchIter.hasNext()) {        Value searchItem = searchIter.next();        subject = str_replace_impl(env,                                   searchItem.toString(),                                   replace.toString(),                                   subject,                                   count);      }    }    return new StringValueImpl(subject);  }