document throws in CharSet, and a bubbled up NPE in CharSetUtil
Index: CharSet.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSet.java,v
retrieving revision 1.1
diff -u -w -r1.1 CharSet.java
--- CharSet.java 19 Jul 2002 03:35:54 -0000 1.1
+++ CharSet.java 28 Sep 2002 02:42:50 -0000
@@ -70,7 +70,9 @@
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 @@
* 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();
Index: CharSetUtils.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java,v
retrieving revision 1.4
diff -u -w -r1.4 CharSetUtils.java
--- CharSetUtils.java 18 Sep 2002 19:55:32 -0000 1.4
+++ CharSetUtils.java 28 Sep 2002 02:42:51 -0000
@@ -84,6 +84,9 @@
* "^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
*/
public static CharSet evaluateSet(String[] set) {
return new CharSet(set);
@@ -112,6 +115,7 @@
*
* @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 +193,7 @@
*
* @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 +209,6 @@
}
/**
- * 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 +218,7 @@
* @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());
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>