| 1726 | |
| 1727 | // No String.replace available in 1.4 |
| 1728 | static String replace(String s1, String s2, String str) { |
| 1729 | StringBuilder buf = new StringBuilder(); |
| 1730 | while (true) { |
| 1731 | int idx = str.indexOf(s1); |
| 1732 | if (idx == -1) { |
| 1733 | buf.append(str); |
| 1734 | break; |
| 1735 | } |
| 1736 | else { |
| 1737 | buf.append(str.substring(0, idx)); |
| 1738 | buf.append(s2); |
| 1739 | str = str.substring(idx + s1.length()); |
| 1740 | } |
| 1741 | } |
| 1742 | return buf.toString(); |
| 1743 | } |
| 1744 | |
| 1745 | /** Indicates whether the callback has an initializer. */ |
| 1746 | static final int CB_HAS_INITIALIZER = 1; |