lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/3] lucenenet git commit: Some treatment to exceptions thrown from Field
Date Sun, 25 Jan 2015 12:28:17 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 593231b3b -> 1b806ebf5


Some treatment to exceptions thrown from Field


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/a6aa4e2d
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/a6aa4e2d
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/a6aa4e2d

Branch: refs/heads/master
Commit: a6aa4e2da59103ea238f2b6a0359586c0d615490
Parents: 593231b
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Sun Jan 25 14:13:22 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Sun Jan 25 14:13:22 2015 +0200

----------------------------------------------------------------------
 .../Document/BinaryDocValuesField.cs            |  7 ++-
 src/Lucene.Net.Core/Document/Field.cs           | 46 ++++++++++----------
 .../Document/NumericDocValuesField.cs           |  2 +-
 .../Document/SortedDocValuesField.cs            |  4 +-
 4 files changed, 29 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a6aa4e2d/src/Lucene.Net.Core/Document/BinaryDocValuesField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Document/BinaryDocValuesField.cs b/src/Lucene.Net.Core/Document/BinaryDocValuesField.cs
index 0001003..0c3edfe 100644
--- a/src/Lucene.Net.Core/Document/BinaryDocValuesField.cs
+++ b/src/Lucene.Net.Core/Document/BinaryDocValuesField.cs
@@ -1,4 +1,4 @@
-
+using System;
 using Lucene.Net.Index;
 using Lucene.Net.Util;
 
@@ -37,8 +37,7 @@ namespace Lucene.Net.Documents
     /// If you also need to store the value, you should add a
     /// separate <seealso cref="StoredField"/> instance.
     /// </summary>
-    /// <seealso cref= BinaryDocValues
-    ///  </seealso>
+    /// <seealso cref= BinaryDocValues</seealso>
     public class BinaryDocValuesField : Field
     {
         /// <summary>
@@ -56,7 +55,7 @@ namespace Lucene.Net.Documents
         /// Create a new binary DocValues field. </summary>
         /// <param name="name"> field name </param>
         /// <param name="value"> binary content </param>
-        /// <exception cref="IllegalArgumentException"> if the field name is null </exception>
+        /// <exception cref="ArgumentNullException"> if the field name is null </exception>
         public BinaryDocValuesField(string name, BytesRef value)
             : base(name, fType)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a6aa4e2d/src/Lucene.Net.Core/Document/Field.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Document/Field.cs b/src/Lucene.Net.Core/Document/Field.cs
index 2c20987..8dd42b8 100644
--- a/src/Lucene.Net.Core/Document/Field.cs
+++ b/src/Lucene.Net.Core/Document/Field.cs
@@ -87,18 +87,18 @@ namespace Lucene.Net.Documents
         /// Intended only for custom Field subclasses. </summary>
         /// <param name="name"> field name </param>
         /// <param name="type"> field type </param>
-        /// <exception cref="IllegalArgumentException"> if either the name or type
+        /// <exception cref="ArgumentNullException"> if either the name or type
         ///         is null. </exception>
         protected internal Field(string name, FieldType type)
         {
             if (name == null)
             {
-                throw new System.ArgumentException("name cannot be null");
+                throw new System.ArgumentNullException("name", "name cannot be null");
             }
             this.Name_Renamed = name;
             if (type == null)
             {
-                throw new System.ArgumentException("type cannot be null");
+                throw new System.ArgumentNullException("type", "type cannot be null");
             }
             this.Type = type;
         }
@@ -108,23 +108,23 @@ namespace Lucene.Net.Documents
         /// <param name="name"> field name </param>
         /// <param name="reader"> reader value </param>
         /// <param name="type"> field type </param>
-        /// <exception cref="IllegalArgumentException"> if either the name or type
+        /// <exception cref="ArgumentNullException"> if either the name or type
         ///         is null, or if the field's type is stored(), or
         ///         if tokenized() is false. </exception>
-        /// <exception cref="NullPointerException"> if the reader is null </exception>
+        /// <exception cref="ArgumentNullException"> if the reader is null </exception>
         public Field(string name, TextReader reader, FieldType type)
         {
             if (name == null)
             {
-                throw new System.ArgumentException("name cannot be null");
+                throw new System.ArgumentNullException("name", "name cannot be null");
             }
             if (type == null)
             {
-                throw new System.ArgumentException("type cannot be null");
+                throw new System.ArgumentNullException("type", "type cannot be null");
             }
             if (reader == null)
             {
-                throw new System.NullReferenceException("reader cannot be null");
+                throw new System.ArgumentNullException("reader", "reader cannot be null");
             }
             if (type.Stored)
             {
@@ -145,19 +145,19 @@ namespace Lucene.Net.Documents
         /// <param name="name"> field name </param>
         /// <param name="tokenStream"> TokenStream value </param>
         /// <param name="type"> field type </param>
-        /// <exception cref="IllegalArgumentException"> if either the name or type
+        /// <exception cref="ArgumentException"> if either the name or type
         ///         is null, or if the field's type is stored(), or
         ///         if tokenized() is false, or if indexed() is false. </exception>
-        /// <exception cref="NullPointerException"> if the tokenStream is null </exception>
+        /// <exception cref="ArgumentNullException"> if the tokenStream is null </exception>
         public Field(string name, TokenStream tokenStream, FieldType type)
         {
             if (name == null)
             {
-                throw new System.ArgumentException("name cannot be null");
+                throw new System.ArgumentNullException("name", "name cannot be null");
             }
             if (tokenStream == null)
             {
-                throw new System.NullReferenceException("tokenStream cannot be null");
+                throw new System.ArgumentNullException("tokenStream","tokenStream cannot
be null");
             }
             if (!type.Indexed || !type.Tokenized)
             {
@@ -182,9 +182,9 @@ namespace Lucene.Net.Documents
         /// <param name="name"> field name </param>
         /// <param name="value"> byte array pointing to binary content (not copied)
</param>
         /// <param name="type"> field type </param>
-        /// <exception cref="IllegalArgumentException"> if the field name is null,
+        /// <exception cref="ArgumentException"> if the field name is null,
         ///         or the field's type is indexed() </exception>
-        /// <exception cref="NullPointerException"> if the type is null </exception>
+        /// <exception cref="ArgumentNullException"> if the type is null </exception>
         public Field(string name, byte[] value, FieldType type)
             : this(name, value, 0, value.Length, type)
         {
@@ -200,9 +200,9 @@ namespace Lucene.Net.Documents
         /// <param name="offset"> starting position of the byte array </param>
         /// <param name="length"> valid length of the byte array </param>
         /// <param name="type"> field type </param>
-        /// <exception cref="IllegalArgumentException"> if the field name is null,
+        /// <exception cref="ArgumentException"> if the field name is null,
         ///         or the field's type is indexed() </exception>
-        /// <exception cref="NullPointerException"> if the type is null </exception>
+        /// <exception cref="ArgumentNullException"> if the type is null </exception>
         public Field(string name, byte[] value, int offset, int length, FieldType type)
             : this(name, new BytesRef(value, offset, length), type)
         {
@@ -216,14 +216,14 @@ namespace Lucene.Net.Documents
         /// <param name="name"> field name </param>
         /// <param name="bytes"> BytesRef pointing to binary content (not copied) </param>
         /// <param name="type"> field type </param>
-        /// <exception cref="IllegalArgumentException"> if the field name is null,
+        /// <exception cref="ArgumentException"> if the field name is null,
         ///         or the field's type is indexed() </exception>
-        /// <exception cref="NullPointerException"> if the type is null </exception>
+        /// <exception cref="ArgumentNullException"> if the type is null </exception>
         public Field(string name, BytesRef bytes, FieldType type)
         {
             if (name == null)
             {
-                throw new System.ArgumentException("name cannot be null");
+                throw new System.ArgumentNullException("name", "name cannot be null");
             }
             if (type.Indexed)
             {
@@ -241,19 +241,19 @@ namespace Lucene.Net.Documents
         /// <param name="name"> field name </param>
         /// <param name="value"> string value </param>
         /// <param name="type"> field type </param>
-        /// <exception cref="IllegalArgumentException"> if either the name or value
+        /// <exception cref="ArgumentException"> if either the name or value
         ///         is null, or if the field's type is neither indexed() nor stored(),
         ///         or if indexed() is false but storeTermVectors() is true. </exception>
-        /// <exception cref="NullPointerException"> if the type is null </exception>
+        /// <exception cref="ArgumentNullException"> if the type is null </exception>
         public Field(string name, string value, FieldType type)
         {
             if (name == null)
             {
-                throw new System.ArgumentException("name cannot be null");
+                throw new System.ArgumentNullException("name", "name cannot be null");
             }
             if (value == null)
             {
-                throw new System.ArgumentException("value cannot be null");
+                throw new System.ArgumentNullException("value", "value cannot be null");
             }
             if (!type.Stored && !type.Indexed)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a6aa4e2d/src/Lucene.Net.Core/Document/NumericDocValuesField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Document/NumericDocValuesField.cs b/src/Lucene.Net.Core/Document/NumericDocValuesField.cs
index ac3da29..2327654 100644
--- a/src/Lucene.Net.Core/Document/NumericDocValuesField.cs
+++ b/src/Lucene.Net.Core/Document/NumericDocValuesField.cs
@@ -52,7 +52,7 @@ namespace Lucene.Net.Documents
         /// Creates a new DocValues field with the specified 64-bit long value </summary>
         /// <param name="name"> field name </param>
         /// <param name="value"> 64-bit long value </param>
-        /// <exception cref="IllegalArgumentException"> if the field name is null </exception>
+        /// <exception cref="ArgumentNullException"> if the field name is null </exception>
         public NumericDocValuesField(string name, long value)
             : base(name, TYPE)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a6aa4e2d/src/Lucene.Net.Core/Document/SortedDocValuesField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Document/SortedDocValuesField.cs b/src/Lucene.Net.Core/Document/SortedDocValuesField.cs
index 04afea2..9bf2af8 100644
--- a/src/Lucene.Net.Core/Document/SortedDocValuesField.cs
+++ b/src/Lucene.Net.Core/Document/SortedDocValuesField.cs
@@ -1,4 +1,4 @@
-
+using System;
 using Lucene.Net.Index;
 using Lucene.Net.Util;
 
@@ -54,7 +54,7 @@ namespace Lucene.Net.Documents
         /// Create a new sorted DocValues field. </summary>
         /// <param name="name"> field name </param>
         /// <param name="bytes"> binary content </param>
-        /// <exception cref="IllegalArgumentException"> if the field name is null </exception>
+        /// <exception cref="ArgumentNullException"> if the field name is null </exception>
         public SortedDocValuesField(string name, BytesRef bytes)
             : base(name, TYPE)
         {


Mime
View raw message