diff --git a/src/java/org/apache/commons/lang/CharSet.java b/src/java/org/apache/commons/lang/CharSet.java index d0edfa17e..c42a6dbc2 100644 --- a/src/java/org/apache/commons/lang/CharSet.java +++ b/src/java/org/apache/commons/lang/CharSet.java @@ -63,14 +63,16 @@ import java.util.LinkedList; * * @author Henri Yandell * @author Stephen Colebourne - * @version $Id: CharSet.java,v 1.1 2002/07/19 03:35:54 bayard Exp $ + * @version $Id: CharSet.java,v 1.2 2002/09/28 10:34:54 scolebourne Exp $ */ public class CharSet { private LinkedList set = new LinkedList(); /** - * Restricted consructor. Use the factory method evaluateSet(). + * Restricted constructor. Use the factory method evaluateSet(). + * + * @throws NullPointerException if any of set[i] is null or if set is null */ protected CharSet(String[] set) { int sz = set.length; @@ -107,6 +109,7 @@ public class CharSet { * Add a set definition string to the set * * @param str set definition string + * @throws NullPointerException if str is null */ protected void add(String str) { int sz = str.length(); diff --git a/src/java/org/apache/commons/lang/CharSetUtils.java b/src/java/org/apache/commons/lang/CharSetUtils.java index 648b7d796..1b0b7f4a5 100644 --- a/src/java/org/apache/commons/lang/CharSetUtils.java +++ b/src/java/org/apache/commons/lang/CharSetUtils.java @@ -63,7 +63,7 @@ import java.util.LinkedList; * * @author Henri Yandell * @author Stephen Colebourne - * @version $Id: CharSetUtils.java,v 1.4 2002/09/18 19:55:32 scolebourne Exp $ + * @version $Id: CharSetUtils.java,v 1.5 2002/09/28 10:34:54 scolebourne Exp $ */ public class CharSetUtils { @@ -84,6 +84,11 @@ public class CharSetUtils { * "^e" implies not e. However it only negates, it's not * a set in itself due to the size of that set in unicode. * "ej-m" implies e,j->m. e,j,k,l,m. + * @param set + * @return CharSet + * @throws NullPointerException if any of set[i] is null or if set is null + * @param set + * @return CharSet */ public static CharSet evaluateSet(String[] set) { return new CharSet(set); @@ -112,6 +117,7 @@ public class CharSetUtils { * * @param str the string to work from * @param set the character set to use for manipulation + * @throws NullPointerException if str is null */ public static String squeeze(String str, String[] set) { CharSet chars = evaluateSet(set); @@ -189,6 +195,7 @@ public class CharSetUtils { * * @param str String target to delete characters from * @param set String[] set of characters to delete + * @throws NullPointerException of str is null */ public static String delete(String str, String[] set) { CharSet chars = evaluateSet(set); @@ -204,7 +211,6 @@ public class CharSetUtils { } /** - * NEEDS TO TAKE A CHAR-SET. * Translate characters in a String. * An example is: translate("hello", "ho", "jy") => jelly * If the length of characters to search for is greater than the @@ -214,6 +220,7 @@ public class CharSetUtils { * @param target String to replace characters in * @param repl String to find that will be replaced * @param with String to put into the target String + * @throws NullPointerException if target, with or repl is null */ public static String translate(String target, String repl, String with) { StringBuffer buffer = new StringBuffer(target.length()); diff --git a/src/java/org/apache/commons/lang/NumberUtils.java b/src/java/org/apache/commons/lang/NumberUtils.java index 4bb7a6e8a..09355264c 100644 --- a/src/java/org/apache/commons/lang/NumberUtils.java +++ b/src/java/org/apache/commons/lang/NumberUtils.java @@ -63,7 +63,7 @@ import java.math.BigDecimal; * @author Rand McNeely * @author Stephen Colebourne * @author Steve Downey - * @version $Id: NumberUtils.java,v 1.2 2002/09/15 10:26:42 scolebourne Exp $ + * @version $Id: NumberUtils.java,v 1.3 2002/09/28 10:34:54 scolebourne Exp $ */ public final class NumberUtils { @@ -491,8 +491,8 @@ public final class NumberUtils { *
+ * If set is not null, characters between start and end are chosen. + *
* * @param count int length of random string to create * @param start int position in set of chars to start at @@ -187,6 +193,8 @@ public class RandomStringUtils { * @param set char[] set of chars to choose randoms from. * If null, then it will use the set of all chars. * @return the random string + * @throws ArrayIndexOutOfBoundsException if there are not (end - start) + 1 + * characters in the set array. */ public static String random(int count, int start, int end, boolean letters, boolean numbers, char[] set) { if( (start == 0) && (end == 0) ) { diff --git a/src/java/org/apache/commons/lang/StringUtils.java b/src/java/org/apache/commons/lang/StringUtils.java index fdb9eed2e..805ed7200 100644 --- a/src/java/org/apache/commons/lang/StringUtils.java +++ b/src/java/org/apache/commons/lang/StringUtils.java @@ -73,15 +73,10 @@ import java.util.Iterator; * @author Stephen Colebourne * @author .