From 4135d1f851d06324c6c833a8c4f6eca59b520705 Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Mon, 30 Aug 2004 20:48:22 +0000 Subject: [PATCH] throw NullPointerException instead of IllegalArgumentException if appropriate git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150466 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/document/Field.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/lucene/document/Field.java b/src/java/org/apache/lucene/document/Field.java index 29897d3433a..ff81137d760 100644 --- a/src/java/org/apache/lucene/document/Field.java +++ b/src/java/org/apache/lucene/document/Field.java @@ -239,9 +239,9 @@ public final class Field implements java.io.Serializable { */ 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 final class Field implements java.io.Serializable { 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 @@ public final class Field implements java.io.Serializable { 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;