dnaber 2004/08/30 13:48:22 Modified: src/java/org/apache/lucene/document Field.java Log: throw NullPointerException instead of IllegalArgumentException if appropriate Revision Changes Path 1.18 +6 -6 jakarta-lucene/src/java/org/apache/lucene/document/Field.java Index: Field.java =================================================================== RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/document/Field.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- Field.java 30 Aug 2004 20:45:02 -0000 1.17 +++ Field.java 30 Aug 2004 20:48:22 -0000 1.18 @@ -239,9 +239,9 @@ */ public Field(String name, String value, Store store, Index index, TermVector termVector) { if (name == null) - throw new IllegalArgumentException("name cannot be null"); + throw new NullPointerException("name cannot be null"); if (value == null) - throw new IllegalArgumentException("value cannot be null"); + throw new NullPointerException("value cannot be null"); if (index == Index.NO && store == Store.NO) throw new IllegalArgumentException("it doesn't make sense to have a field that " + "is neither indexed nor stored"); @@ -302,9 +302,9 @@ public Field(String name, String string, boolean store, boolean index, boolean token, boolean storeTermVector) { if (name == null) - throw new IllegalArgumentException("name cannot be null"); + throw new NullPointerException("name cannot be null"); if (string == null) - throw new IllegalArgumentException("value cannot be null"); + throw new NullPointerException("value cannot be null"); if (!index && storeTermVector) throw new IllegalArgumentException("cannot store a term vector for fields that are not indexed"); @@ -318,9 +318,9 @@ Field(String name, Reader reader) { if (name == null) - throw new IllegalArgumentException("name cannot be null"); + throw new NullPointerException("name cannot be null"); if (reader == null) - throw new IllegalArgumentException("value cannot be null"); + throw new NullPointerException("value cannot be null"); this.name = name.intern(); // field names are interned this.readerValue = reader;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]