You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2004/03/11 00:31:54 UTC
cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang CharSetUtils.java
scolebourne 2004/03/10 15:31:53
Modified: lang/src/java/org/apache/commons/lang CharSetUtils.java
Log:
Improve javadoc of various methods
bug 27306, from Janek Bogucki
Revision Changes Path
1.33 +9 -6 jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java
Index: CharSetUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- CharSetUtils.java 19 Feb 2004 21:04:03 -0000 1.32
+++ CharSetUtils.java 10 Mar 2004 23:31:53 -0000 1.33
@@ -237,7 +237,7 @@
* <p>An example would be:</p>
* <ul>
* <li>keep("hello", {"c-f", "o"})
- * returns "hll"</li>
+ * returns "eo"</li>
* </ul>
*
* @see #evaluateSet(java.lang.String[]) for set-syntax.
@@ -267,8 +267,8 @@
* CharSetUtils.delete("", *) = ""
* CharSetUtils.delete(*, null) = *
* CharSetUtils.delete(*, "") = *
- * CharSetUtils.delete("hello", "hl") = "hll"
- * CharSetUtils.delete("hello", "le") = "ell"
+ * CharSetUtils.delete("hello", "hl") = "eo"
+ * CharSetUtils.delete("hello", "le") = "ho"
* </pre>
*
* @see #evaluateSet(java.lang.String[]) for set-syntax.
@@ -347,11 +347,14 @@
* @param searchChars a set of characters to search for, must not be null
* @param replaceChars a set of characters to replace, must not be null or empty ("")
* @return translated String, <code>null</code> if null string input
- * @throws NullPointerException if <code>with</code> or <code>repl</code>
+ * @throws NullPointerException if <code>searchChars</code> or <code>replaceChars</code>
* is <code>null</code>
- * @throws ArrayIndexOutOfBoundsException if <code>with</code> is empty ("")
+ * @throws ArrayIndexOutOfBoundsException if <code>replaceChars</code> is empty ("")
* @deprecated Use {@link StringUtils#replaceChars(String, String, String)}.
* Method will be removed in Commons Lang 3.0.
+ * NOTE: StringUtils#replaceChars behaves differently when 'searchChars' is longer
+ * than 'replaceChars'. CharSetUtils#translate will use the last char of the replacement
+ * string whereas StringUtils#replaceChars will delete
*/
public static String translate(String str, String searchChars, String replaceChars) {
if (StringUtils.isEmpty(str)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org