lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [17/34] lucenenet git commit: Changed IndexableField.Name() to IndexableField.Name (method into a property) for API consistency.
Date Fri, 12 Aug 2016 13:20:31 GMT
Changed IndexableField.Name() to IndexableField.Name (method into a property) for API consistency.


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

Branch: refs/heads/lucenenet-indexablefield-api
Commit: 3c2c4f470ee8db976c03757e79be9303bc78b4d9
Parents: 1d8582f
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Fri Jul 29 00:28:02 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Fri Jul 29 00:28:02 2016 +0700

----------------------------------------------------------------------
 .../Utils/DatasetSplitter.cs                        |  8 ++++----
 .../SimpleText/SimpleTextStoredFieldsWriter.cs      |  4 ++--
 .../Compressing/CompressingStoredFieldsWriter.cs    |  2 +-
 .../Codecs/Lucene40/Lucene40StoredFieldsWriter.cs   |  2 +-
 src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs    |  2 +-
 src/Lucene.Net.Core/Document/Document.cs            | 16 ++++++++--------
 src/Lucene.Net.Core/Document/Field.cs               |  8 ++++----
 src/Lucene.Net.Core/Index/DocFieldProcessor.cs      |  2 +-
 src/Lucene.Net.Core/Index/DocInverterPerField.cs    | 12 ++++++------
 src/Lucene.Net.Core/Index/IndexableField.cs         |  2 +-
 .../Index/TermVectorsConsumerPerField.cs            | 16 ++++++++--------
 .../Codecs/lucene3x/PreFlexRWStoredFieldsWriter.cs  |  2 +-
 .../Index/BaseStoredFieldsFormatTestCase.cs         |  8 ++++----
 src/Lucene.Net.TestFramework/Index/DocHelper.cs     |  2 +-
 src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs |  6 +++---
 src/Lucene.Net.TestFramework/Util/TestUtil.cs       | 16 ++++++++--------
 .../Codecs/Lucene41/TestBlockPostingsFormat2.cs     |  8 ++++----
 .../core/Index/TestDirectoryReader.cs               |  2 +-
 src/Lucene.Net.Tests/core/Index/TestFieldInfos.cs   |  2 +-
 src/Lucene.Net.Tests/core/Index/TestFieldsReader.cs |  4 ++--
 .../core/Index/TestIndexWriterExceptions.cs         |  4 ++--
 .../core/Index/TestIndexableField.cs                |  6 +++---
 .../core/Index/TestSegmentReader.cs                 | 10 +++++-----
 .../core/Index/TestStressIndexing2.cs               |  2 +-
 24 files changed, 73 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Classification/Utils/DatasetSplitter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Classification/Utils/DatasetSplitter.cs b/src/Lucene.Net.Classification/Utils/DatasetSplitter.cs
index ba4385f..3b91dc4 100644
--- a/src/Lucene.Net.Classification/Utils/DatasetSplitter.cs
+++ b/src/Lucene.Net.Classification/Utils/DatasetSplitter.cs
@@ -97,19 +97,19 @@ namespace Lucene.Net.Classification.Utils
                         {
                             if (storableField.ReaderValue != null)
                             {
-                                doc.Add(new Field(storableField.Name(), storableField.ReaderValue,
ft));
+                                doc.Add(new Field(storableField.Name, storableField.ReaderValue,
ft));
                             }
                             else if (storableField.BinaryValue() != null)
                             {
-                                doc.Add(new Field(storableField.Name(), storableField.BinaryValue(),
ft));
+                                doc.Add(new Field(storableField.Name, storableField.BinaryValue(),
ft));
                             }
                             else if (storableField.StringValue != null)
                             {
-                                doc.Add(new Field(storableField.Name(), storableField.StringValue,
ft));
+                                doc.Add(new Field(storableField.Name, storableField.StringValue,
ft));
                             }
                             else if (storableField.NumericValue != null)
                             {
-                                doc.Add(new Field(storableField.Name(), storableField.NumericValue.ToString(),
ft));
+                                doc.Add(new Field(storableField.Name, storableField.NumericValue.ToString(),
ft));
                             }
                         }
                     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsWriter.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsWriter.cs
index 80a55c2..c298ccc 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsWriter.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsWriter.cs
@@ -102,7 +102,7 @@ namespace Lucene.Net.Codecs.SimpleText
             NewLine();
 
             Write(NAME);
-            Write(field.Name());
+            Write(field.Name);
             NewLine();
 
             Write(TYPE);
@@ -166,7 +166,7 @@ namespace Lucene.Net.Codecs.SimpleText
                 }
                 else if (field.StringValue == null)
                 {
-                    throw new ArgumentException("field " + field.Name() +
+                    throw new ArgumentException("field " + field.Name +
                                                        " is stored but does not have binaryValue,
stringValue nor numericValue");
                 }
                 else

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs b/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs
index c556d59..c234dbb 100644
--- a/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs
@@ -328,7 +328,7 @@ namespace Lucene.Net.Codecs.Compressing
                     @string = field.StringValue;
                     if (@string == null)
                     {
-                        throw new System.ArgumentException("field " + field.Name() + " is
stored but does not have binaryValue, stringValue nor numericValue");
+                        throw new System.ArgumentException("field " + field.Name + " is stored
but does not have binaryValue, stringValue nor numericValue");
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
index 0a548d7..45eede8 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
@@ -199,7 +199,7 @@ namespace Lucene.Net.Codecs.Lucene40
                     @string = field.StringValue;
                     if (@string == null)
                     {
-                        throw new System.ArgumentException("field " + field.Name() + " is
stored but does not have binaryValue, stringValue nor numericValue");
+                        throw new System.ArgumentException("field " + field.Name + " is stored
but does not have binaryValue, stringValue nor numericValue");
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs b/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
index 02a52b7..9a60977 100644
--- a/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
@@ -145,7 +145,7 @@ namespace Lucene.Net.Codecs
             {
                 if (field.FieldType().Stored)
                 {
-                    WriteField(fieldInfos.FieldInfo(field.Name()), field);
+                    WriteField(fieldInfos.FieldInfo(field.Name), field);
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Core/Document/Document.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Document/Document.cs b/src/Lucene.Net.Core/Document/Document.cs
index 637b886..a8e8348 100644
--- a/src/Lucene.Net.Core/Document/Document.cs
+++ b/src/Lucene.Net.Core/Document/Document.cs
@@ -88,7 +88,7 @@ namespace Lucene.Net.Documents
             {
                 IndexableField field = fields[i];
 
-                if (field.Name().Equals(name))
+                if (field.Name.Equals(name))
                 {
                     fields.RemoveAt(i);
                     return;
@@ -111,7 +111,7 @@ namespace Lucene.Net.Documents
             {
                 IndexableField field = fields[i];
 
-                if (field.Name().Equals(name))
+                if (field.Name.Equals(name))
                 {
                     fields.RemoveAt(i);
                 }
@@ -132,7 +132,7 @@ namespace Lucene.Net.Documents
 
             foreach (IndexableField field in fields)
             {
-                if (field.Name().Equals(name))
+                if (field.Name.Equals(name))
                 {
                     BytesRef bytes = field.BinaryValue();
 
@@ -158,7 +158,7 @@ namespace Lucene.Net.Documents
         {
             foreach (IndexableField field in fields)
             {
-                if (field.Name().Equals(name))
+                if (field.Name.Equals(name))
                 {
                     BytesRef bytes = field.BinaryValue();
                     if (bytes != null)
@@ -179,7 +179,7 @@ namespace Lucene.Net.Documents
         {
             foreach (IndexableField field in fields)
             {
-                if (field.Name().Equals(name))
+                if (field.Name.Equals(name))
                 {
                     return field;
                 }
@@ -199,7 +199,7 @@ namespace Lucene.Net.Documents
             var result = new List<IndexableField>();
             foreach (IndexableField field in fields)
             {
-                if (field.Name().Equals(name))
+                if (field.Name.Equals(name))
                 {
                     result.Add(field);
                 }
@@ -239,7 +239,7 @@ namespace Lucene.Net.Documents
             var result = new List<string>();
             foreach (IndexableField field in fields)
             {
-                if (field.Name().Equals(name) && field.StringValue != null)
+                if (field.Name.Equals(name) && field.StringValue != null)
                 {
                     result.Add(field.StringValue);
                 }
@@ -266,7 +266,7 @@ namespace Lucene.Net.Documents
         {
             foreach (IndexableField field in fields)
             {
-                if (field.Name().Equals(name) && field.StringValue != null)
+                if (field.Name.Equals(name) && field.StringValue != null)
                 {
                     return field.StringValue;
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/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 8dd42b8..d29f8e7 100644
--- a/src/Lucene.Net.Core/Document/Field.cs
+++ b/src/Lucene.Net.Core/Document/Field.cs
@@ -480,9 +480,9 @@ namespace Lucene.Net.Documents
             }
         }
 
-        public string Name()
+        public string Name
         {
-            return Name_Renamed;
+            get { return Name_Renamed; }
         }
 
         /// <summary>
@@ -640,12 +640,12 @@ namespace Lucene.Net.Documents
             }
             else if (ReaderValue != null)
             {
-                return analyzer.TokenStream(Name(), ReaderValue);
+                return analyzer.TokenStream(Name, ReaderValue);
             }
             else if (StringValue != null)
             {
                 TextReader sr = new StringReader(StringValue);
-                return analyzer.TokenStream(Name(), sr);
+                return analyzer.TokenStream(Name, sr);
             }
 
             throw new System.ArgumentException("Field must have either TokenStream, String,
Reader or Number value; got " + this);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Core/Index/DocFieldProcessor.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/DocFieldProcessor.cs b/src/Lucene.Net.Core/Index/DocFieldProcessor.cs
index 8eeceb4..301277f 100644
--- a/src/Lucene.Net.Core/Index/DocFieldProcessor.cs
+++ b/src/Lucene.Net.Core/Index/DocFieldProcessor.cs
@@ -208,7 +208,7 @@ namespace Lucene.Net.Index
 
             foreach (IndexableField field in DocState.Doc)
             {
-                string fieldName = field.Name();
+                string fieldName = field.Name;
 
                 // Make sure we have a PerField allocated
                 int hashPos = fieldName.GetHashCode() & HashMask;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Core/Index/DocInverterPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/DocInverterPerField.cs b/src/Lucene.Net.Core/Index/DocInverterPerField.cs
index 18f0ff6..808dbda 100644
--- a/src/Lucene.Net.Core/Index/DocInverterPerField.cs
+++ b/src/Lucene.Net.Core/Index/DocInverterPerField.cs
@@ -81,7 +81,7 @@ namespace Lucene.Net.Index
                     // if the field omits norms, the boost cannot be indexed.
                     if (fieldType.OmitNorms && field.GetBoost() != 1.0f)
                     {
-                        throw new System.NotSupportedException("You cannot set an index-time
boost: norms are omitted for field '" + field.Name() + "'");
+                        throw new System.NotSupportedException("You cannot set an index-time
boost: norms are omitted for field '" + field.Name + "'");
                     }
 
                     // only bother checking offsets if something will consume them.
@@ -131,11 +131,11 @@ namespace Lucene.Net.Index
                                 int posIncr = posIncrAttribute.PositionIncrement;
                                 if (posIncr < 0)
                                 {
-                                    throw new System.ArgumentException("position increment
must be >=0 (got " + posIncr + ") for field '" + field.Name() + "'");
+                                    throw new System.ArgumentException("position increment
must be >=0 (got " + posIncr + ") for field '" + field.Name + "'");
                                 }
                                 if (FieldState.Position_Renamed == 0 && posIncr ==
0)
                                 {
-                                    throw new System.ArgumentException("first position increment
must be > 0 (got 0) for field '" + field.Name() + "'");
+                                    throw new System.ArgumentException("first position increment
must be > 0 (got 0) for field '" + field.Name + "'");
                                 }
                                 int position = FieldState.Position_Renamed + posIncr;
                                 if (position > 0)
@@ -146,7 +146,7 @@ namespace Lucene.Net.Index
                                 }
                                 else if (position < 0)
                                 {
-                                    throw new System.ArgumentException("position overflow
for field '" + field.Name() + "'");
+                                    throw new System.ArgumentException("position overflow
for field '" + field.Name + "'");
                                 }
 
                                 // position is legal, we can safely place it in fieldState
now.
@@ -164,11 +164,11 @@ namespace Lucene.Net.Index
                                     int endOffset = FieldState.Offset_Renamed + offsetAttribute.EndOffset();
                                     if (startOffset < 0 || endOffset < startOffset)
                                     {
-                                        throw new System.ArgumentException("startOffset must
be non-negative, and endOffset must be >= startOffset, " + "startOffset=" + startOffset
+ ",endOffset=" + endOffset + " for field '" + field.Name() + "'");
+                                        throw new System.ArgumentException("startOffset must
be non-negative, and endOffset must be >= startOffset, " + "startOffset=" + startOffset
+ ",endOffset=" + endOffset + " for field '" + field.Name + "'");
                                     }
                                     if (startOffset < lastStartOffset)
                                     {
-                                        throw new System.ArgumentException("offsets must
not go backwards startOffset=" + startOffset + " is < lastStartOffset=" + lastStartOffset
+ " for field '" + field.Name() + "'");
+                                        throw new System.ArgumentException("offsets must
not go backwards startOffset=" + startOffset + " is < lastStartOffset=" + lastStartOffset
+ " for field '" + field.Name + "'");
                                     }
                                     lastStartOffset = startOffset;
                                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Core/Index/IndexableField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/IndexableField.cs b/src/Lucene.Net.Core/Index/IndexableField.cs
index d26c639..d28f80a 100644
--- a/src/Lucene.Net.Core/Index/IndexableField.cs
+++ b/src/Lucene.Net.Core/Index/IndexableField.cs
@@ -43,7 +43,7 @@ namespace Lucene.Net.Index
     {
         /// <summary>
         /// Field name </summary>
-        string Name();
+        string Name { get; }
 
         /// <summary>
         /// <seealso cref="IndexableFieldType"/> describing the properties

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Core/Index/TermVectorsConsumerPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/TermVectorsConsumerPerField.cs b/src/Lucene.Net.Core/Index/TermVectorsConsumerPerField.cs
index 2c50ae7..fd1b1d3 100644
--- a/src/Lucene.Net.Core/Index/TermVectorsConsumerPerField.cs
+++ b/src/Lucene.Net.Core/Index/TermVectorsConsumerPerField.cs
@@ -89,22 +89,22 @@ namespace Lucene.Net.Index
                         else if (field.FieldType().StoreTermVectorPayloads)
                         {
                             // TODO: move this check somewhere else, and impl the other missing
ones
-                            throw new System.ArgumentException("cannot index term vector
payloads without term vector positions (field=\"" + field.Name() + "\")");
+                            throw new System.ArgumentException("cannot index term vector
payloads without term vector positions (field=\"" + field.Name + "\")");
                         }
                     }
                     else
                     {
                         if (field.FieldType().StoreTermVectorOffsets)
                         {
-                            throw new System.ArgumentException("cannot index term vector
offsets when term vectors are not indexed (field=\"" + field.Name() + "\")");
+                            throw new System.ArgumentException("cannot index term vector
offsets when term vectors are not indexed (field=\"" + field.Name + "\")");
                         }
                         if (field.FieldType().StoreTermVectorPositions)
                         {
-                            throw new System.ArgumentException("cannot index term vector
positions when term vectors are not indexed (field=\"" + field.Name() + "\")");
+                            throw new System.ArgumentException("cannot index term vector
positions when term vectors are not indexed (field=\"" + field.Name + "\")");
                         }
                         if (field.FieldType().StoreTermVectorPayloads)
                         {
-                            throw new System.ArgumentException("cannot index term vector
payloads when term vectors are not indexed (field=\"" + field.Name() + "\")");
+                            throw new System.ArgumentException("cannot index term vector
payloads when term vectors are not indexed (field=\"" + field.Name + "\")");
                         }
                     }
                 }
@@ -112,19 +112,19 @@ namespace Lucene.Net.Index
                 {
                     if (field.FieldType().StoreTermVectors)
                     {
-                        throw new System.ArgumentException("cannot index term vectors when
field is not indexed (field=\"" + field.Name() + "\")");
+                        throw new System.ArgumentException("cannot index term vectors when
field is not indexed (field=\"" + field.Name + "\")");
                     }
                     if (field.FieldType().StoreTermVectorOffsets)
                     {
-                        throw new System.ArgumentException("cannot index term vector offsets
when field is not indexed (field=\"" + field.Name() + "\")");
+                        throw new System.ArgumentException("cannot index term vector offsets
when field is not indexed (field=\"" + field.Name + "\")");
                     }
                     if (field.FieldType().StoreTermVectorPositions)
                     {
-                        throw new System.ArgumentException("cannot index term vector positions
when field is not indexed (field=\"" + field.Name() + "\")");
+                        throw new System.ArgumentException("cannot index term vector positions
when field is not indexed (field=\"" + field.Name + "\")");
                     }
                     if (field.FieldType().StoreTermVectorPayloads)
                     {
-                        throw new System.ArgumentException("cannot index term vector payloads
when field is not indexed (field=\"" + field.Name() + "\")");
+                        throw new System.ArgumentException("cannot index term vector payloads
when field is not indexed (field=\"" + field.Name + "\")");
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.TestFramework/Codecs/lucene3x/PreFlexRWStoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Codecs/lucene3x/PreFlexRWStoredFieldsWriter.cs b/src/Lucene.Net.TestFramework/Codecs/lucene3x/PreFlexRWStoredFieldsWriter.cs
index 9084363..6e36184 100644
--- a/src/Lucene.Net.TestFramework/Codecs/lucene3x/PreFlexRWStoredFieldsWriter.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/lucene3x/PreFlexRWStoredFieldsWriter.cs
@@ -153,7 +153,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                     @string = field.StringValue;
                     if (@string == null)
                     {
-                        throw new System.ArgumentException("field " + field.Name() + " is
stored but does not have binaryValue, stringValue nor numericValue");
+                        throw new System.ArgumentException("field " + field.Name + " is stored
but does not have binaryValue, stringValue nor numericValue");
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
index db140dd..38ad4e1 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
@@ -208,17 +208,17 @@ namespace Lucene.Net.Index
             IEnumerator<IndexableField> it = doc2.Fields.GetEnumerator();
             Assert.IsTrue(it.MoveNext());
             Field f = (Field)it.Current;
-            Assert.AreEqual(f.Name(), "zzz");
+            Assert.AreEqual(f.Name, "zzz");
             Assert.AreEqual(f.StringValue, "a b c");
 
             Assert.IsTrue(it.MoveNext());
             f = (Field)it.Current;
-            Assert.AreEqual(f.Name(), "aaa");
+            Assert.AreEqual(f.Name, "aaa");
             Assert.AreEqual(f.StringValue, "a b c");
 
             Assert.IsTrue(it.MoveNext());
             f = (Field)it.Current;
-            Assert.AreEqual(f.Name(), "zzz");
+            Assert.AreEqual(f.Name, "zzz");
             Assert.AreEqual(f.StringValue, "1 2 3");
             Assert.IsFalse(it.MoveNext());
             r.Dispose();
@@ -400,7 +400,7 @@ namespace Lucene.Net.Index
             int docID = Random().Next(100);
             foreach (Field fld in fields)
             {
-                string fldName = fld.Name();
+                string fldName = fld.Name;
                 Document sDoc = reader.Document(docID, Collections.Singleton(fldName));
                 IndexableField sField = sDoc.GetField(fldName);
                 if (typeof(Field) == fld.GetType())

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.TestFramework/Index/DocHelper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/DocHelper.cs b/src/Lucene.Net.TestFramework/Index/DocHelper.cs
index 986de18..e2afbe0 100644
--- a/src/Lucene.Net.TestFramework/Index/DocHelper.cs
+++ b/src/Lucene.Net.TestFramework/Index/DocHelper.cs
@@ -131,7 +131,7 @@ namespace Lucene.Net.Index
 
         private static void Add(IDictionary<string, IndexableField> map, IndexableField
field)
         {
-            map[field.Name()] = field;
+            map[field.Name] = field;
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index 147c4a7..63100f0 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -2206,7 +2206,7 @@ namespace Lucene.Net.Util
                 // in whatever way it wants (e.g. maybe it packs related fields together
or something)
                 // To fix this, we sort the fields in both documents by name, but
                 // we still assume that all instances with same name are in order:
-                Comparison<IndexableField> comp = (a, b) => String.Compare(a.Name(),
b.Name(), StringComparison.Ordinal);
+                Comparison<IndexableField> comp = (a, b) => String.Compare(a.Name,
b.Name, StringComparison.Ordinal);
                 leftDoc.Fields.Sort(comp);
                 rightDoc.Fields.Sort(comp);
 
@@ -2226,7 +2226,7 @@ namespace Lucene.Net.Util
         /// </summary>
         public void AssertStoredFieldEquals(string info, IndexableField leftField, IndexableField
rightField)
         {
-            Assert.AreEqual(leftField.Name(), rightField.Name(), info);
+            Assert.AreEqual(leftField.Name, rightField.Name, info);
             Assert.AreEqual(leftField.BinaryValue(), rightField.BinaryValue(), info);
             Assert.AreEqual(leftField.StringValue, rightField.StringValue, info);
             Assert.AreEqual(leftField.NumericValue, rightField.NumericValue, info);
@@ -2726,7 +2726,7 @@ namespace Lucene.Net.Util
 
         public virtual int Compare(object arg0, object arg1)
         {
-            return System.String.Compare(((IndexableField)arg0).Name(), ((IndexableField)arg1).Name(),
System.StringComparison.Ordinal);
+            return System.String.Compare(((IndexableField)arg0).Name, ((IndexableField)arg1).Name,
System.StringComparison.Ordinal);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.TestFramework/Util/TestUtil.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/TestUtil.cs b/src/Lucene.Net.TestFramework/Util/TestUtil.cs
index c0db864..a0c46ac 100644
--- a/src/Lucene.Net.TestFramework/Util/TestUtil.cs
+++ b/src/Lucene.Net.TestFramework/Util/TestUtil.cs
@@ -1000,15 +1000,15 @@ namespace Lucene.Net.Util
                     switch (dvType)
                     {
                         case DocValuesType_e.NUMERIC:
-                            field2 = new NumericDocValuesField(field1.Name(), (long)field1.NumericValue);
+                            field2 = new NumericDocValuesField(field1.Name, (long)field1.NumericValue);
                             break;
 
                         case DocValuesType_e.BINARY:
-                            field2 = new BinaryDocValuesField(field1.Name(), field1.BinaryValue());
+                            field2 = new BinaryDocValuesField(field1.Name, field1.BinaryValue());
                             break;
 
                         case DocValuesType_e.SORTED:
-                            field2 = new SortedDocValuesField(field1.Name(), field1.BinaryValue());
+                            field2 = new SortedDocValuesField(field1.Name, field1.BinaryValue());
                             break;
 
                         default:
@@ -1020,19 +1020,19 @@ namespace Lucene.Net.Util
                     switch (numType)
                     {
                         case NumericType.INT:
-                            field2 = new IntField(field1.Name(), (int)field1.NumericValue,
(FieldType)field1.FieldType());
+                            field2 = new IntField(field1.Name, (int)field1.NumericValue,
(FieldType)field1.FieldType());
                             break;
 
                         case NumericType.FLOAT:
-                            field2 = new FloatField(field1.Name(), (int)field1.NumericValue,
(FieldType)field1.FieldType());
+                            field2 = new FloatField(field1.Name, (int)field1.NumericValue,
(FieldType)field1.FieldType());
                             break;
 
                         case NumericType.LONG:
-                            field2 = new LongField(field1.Name(), (int)field1.NumericValue,
(FieldType)field1.FieldType());
+                            field2 = new LongField(field1.Name, (int)field1.NumericValue,
(FieldType)field1.FieldType());
                             break;
 
                         case NumericType.DOUBLE:
-                            field2 = new DoubleField(field1.Name(), (int)field1.NumericValue,
(FieldType)field1.FieldType());
+                            field2 = new DoubleField(field1.Name, (int)field1.NumericValue,
(FieldType)field1.FieldType());
                             break;
 
                         default:
@@ -1041,7 +1041,7 @@ namespace Lucene.Net.Util
                 }
                 else
                 {
-                    field2 = new Field(field1.Name(), field1.StringValue, (FieldType)field1.FieldType());
+                    field2 = new Field(field1.Name, field1.StringValue, (FieldType)field1.FieldType());
                 }
                 doc2.Add(field2);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat2.cs b/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat2.cs
index 3e07c69..13ff926 100644
--- a/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat2.cs
+++ b/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat2.cs
@@ -100,7 +100,7 @@ namespace Lucene.Net.Codecs.Lucene41
             {
                 foreach (IndexableField f in doc.Fields)
                 {
-                    ((Field)f).StringValue = f.Name() + " " + f.Name() + "_2";
+                    ((Field)f).StringValue = f.Name + " " + f.Name + "_2";
                 }
                 Iw.AddDocument(doc);
             }
@@ -116,7 +116,7 @@ namespace Lucene.Net.Codecs.Lucene41
             {
                 foreach (IndexableField f in doc.Fields)
                 {
-                    ((Field)f).StringValue = f.Name() + " " + f.Name() + "_2";
+                    ((Field)f).StringValue = f.Name + " " + f.Name + "_2";
                 }
                 Iw.AddDocument(doc);
             }
@@ -132,7 +132,7 @@ namespace Lucene.Net.Codecs.Lucene41
             {
                 foreach (IndexableField f in doc.Fields)
                 {
-                    ((Field)f).StringValue = f.Name() + " " + f.Name() + " " + f.Name() +
"_2 " + f.Name() + "_2";
+                    ((Field)f).StringValue = f.Name + " " + f.Name + " " + f.Name + "_2 "
+ f.Name + "_2";
                 }
                 Iw.AddDocument(doc);
             }
@@ -148,7 +148,7 @@ namespace Lucene.Net.Codecs.Lucene41
             {
                 foreach (IndexableField f in doc.Fields)
                 {
-                    string proto = (f.Name() + " " + f.Name() + " " + f.Name() + " " + f.Name()
+ " " + f.Name() + "_2 " + f.Name() + "_2 " + f.Name() + "_2 " + f.Name() + "_2");
+                    string proto = (f.Name + " " + f.Name + " " + f.Name + " " + f.Name +
" " + f.Name + "_2 " + f.Name + "_2 " + f.Name + "_2 " + f.Name + "_2");
                     StringBuilder val = new StringBuilder();
                     for (int j = 0; j < 16; j++)
                     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
index a3d0c49..925995e 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
@@ -620,7 +620,7 @@ namespace Lucene.Net.Index
                         Field curField1 = (Field)itField1.Current;
                         itField2.MoveNext();
                         Field curField2 = (Field)itField2.Current;
-                        Assert.AreEqual(curField1.Name(), curField2.Name(), "Different fields
names for doc " + i + ".");
+                        Assert.AreEqual(curField1.Name, curField2.Name, "Different fields
names for doc " + i + ".");
                         Assert.AreEqual(curField1.StringValue, curField2.StringValue, "Different
field values for doc " + i + ".");
                     }
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Tests/core/Index/TestFieldInfos.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestFieldInfos.cs b/src/Lucene.Net.Tests/core/Index/TestFieldInfos.cs
index 9a1ab86..59973e2 100644
--- a/src/Lucene.Net.Tests/core/Index/TestFieldInfos.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestFieldInfos.cs
@@ -49,7 +49,7 @@ namespace Lucene.Net.Index
             FieldInfos.Builder builder = new FieldInfos.Builder();
             foreach (IndexableField field in TestDoc)
             {
-                builder.AddOrUpdate(field.Name(), field.FieldType());
+                builder.AddOrUpdate(field.Name, field.FieldType());
             }
             FieldInfos fieldInfos = builder.Finish();
             //Since the complement is stored as well in the fields map

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Tests/core/Index/TestFieldsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestFieldsReader.cs b/src/Lucene.Net.Tests/core/Index/TestFieldsReader.cs
index 5e5825d..fcaac0d 100644
--- a/src/Lucene.Net.Tests/core/Index/TestFieldsReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestFieldsReader.cs
@@ -53,7 +53,7 @@ namespace Lucene.Net.Index
             DocHelper.SetupDoc(TestDoc);
             foreach (IndexableField field in TestDoc)
             {
-                FieldInfos.AddOrUpdate(field.Name(), field.FieldType());
+                FieldInfos.AddOrUpdate(field.Name, field.FieldType());
             }
             Dir = NewDirectory();
             IndexWriterConfig conf = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMergePolicy(NewLogMergePolicy());
@@ -106,7 +106,7 @@ namespace Lucene.Net.Index
             reader.Document(0, visitor);
             IList<IndexableField> fields = visitor.Document.Fields;
             Assert.AreEqual(1, fields.Count);
-            Assert.AreEqual(DocHelper.TEXT_FIELD_3_KEY, fields[0].Name());
+            Assert.AreEqual(DocHelper.TEXT_FIELD_3_KEY, fields[0].Name);
             reader.Dispose();
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
index 6821109..8e322d0 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
@@ -2004,9 +2004,9 @@ namespace Lucene.Net.Index
                 this.OuterInstance = outerInstance;
             }
 
-            public string Name()
+            public string Name
             {
-                return "foo";
+                get { return "foo"; }
             }
 
             public IndexableFieldType FieldType()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs b/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
index d4afb52..cdb111b 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
@@ -152,9 +152,9 @@ namespace Lucene.Net.Index
                 this.Counter = counter;
             }
 
-            public string Name()
+            public string Name
             {
-                return "f" + Counter;
+                get { return "f" + Counter; }
             }
 
             public float GetBoost()
@@ -222,7 +222,7 @@ namespace Lucene.Net.Index
 
             public TokenStream GetTokenStream(Analyzer analyzer)
             {
-                return ReaderValue != null ? analyzer.TokenStream(Name(), ReaderValue) :
analyzer.TokenStream(Name(), new StringReader(StringValue));
+                return ReaderValue != null ? analyzer.TokenStream(Name, ReaderValue) : analyzer.TokenStream(Name,
new StringReader(StringValue));
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs b/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
index 8805748..2f6d8fb 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
@@ -80,7 +80,7 @@ namespace Lucene.Net.Index
             foreach (IndexableField field in fields)
             {
                 Assert.IsTrue(field != null);
-                Assert.IsTrue(DocHelper.NameValues.ContainsKey(field.Name()));
+                Assert.IsTrue(DocHelper.NameValues.ContainsKey(field.Name));
             }
         }
 
@@ -193,12 +193,12 @@ namespace Lucene.Net.Index
                 IndexableField f = DocHelper.Fields[i];
                 if (f.FieldType().Indexed)
                 {
-                    Assert.AreEqual(reader.GetNormValues(f.Name()) != null, !f.FieldType().OmitNorms);
-                    Assert.AreEqual(reader.GetNormValues(f.Name()) != null, !DocHelper.NoNorms.ContainsKey(f.Name()));
-                    if (reader.GetNormValues(f.Name()) == null)
+                    Assert.AreEqual(reader.GetNormValues(f.Name) != null, !f.FieldType().OmitNorms);
+                    Assert.AreEqual(reader.GetNormValues(f.Name) != null, !DocHelper.NoNorms.ContainsKey(f.Name));
+                    if (reader.GetNormValues(f.Name) == null)
                     {
                         // test for norms of null
-                        NumericDocValues norms = MultiDocValues.GetNormValues(reader, f.Name());
+                        NumericDocValues norms = MultiDocValues.GetNormValues(reader, f.Name);
                         Assert.IsNull(norms);
                     }
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3c2c4f47/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs b/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs
index cc9fc39..2720c7f 100644
--- a/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestStressIndexing2.cs
@@ -158,7 +158,7 @@ namespace Lucene.Net.Index
 
             public virtual int Compare(IndexableField o1, IndexableField o2)
             {
-                return o1.Name().CompareTo(o2.Name());
+                return o1.Name.CompareTo(o2.Name);
             }
         }
 


Mime
View raw message