lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [18/34] lucenenet git commit: Changed IndexableField.FieldType() to IndexableField.FieldType (method into a property) for API consistency.
Date Fri, 12 Aug 2016 13:20:32 GMT
Changed IndexableField.FieldType() to IndexableField.FieldType (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/b83de2cd
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/b83de2cd
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/b83de2cd

Branch: refs/heads/lucenenet-indexablefield-api
Commit: b83de2cdfe86edc1e284121b39afb8ba5ea72be9
Parents: 3c2c4f4
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Fri Jul 29 00:39:13 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Fri Jul 29 00:39:13 2016 +0700

----------------------------------------------------------------------
 .../Codecs/StoredFieldsWriter.cs                |  4 +--
 src/Lucene.Net.Core/Document/Field.cs           | 10 ++++----
 src/Lucene.Net.Core/Index/DocFieldProcessor.cs  |  4 +--
 .../Index/DocInverterPerField.cs                |  2 +-
 src/Lucene.Net.Core/Index/DocValuesProcessor.cs |  2 +-
 .../Index/FreqProxTermsWriterPerField.cs        |  2 +-
 src/Lucene.Net.Core/Index/IndexableField.cs     |  2 +-
 .../Index/StoredFieldsProcessor.cs              |  2 +-
 .../Index/TermVectorsConsumerPerField.cs        | 26 ++++++++++----------
 src/Lucene.Net.Facet/FacetsConfig.cs            |  8 +++---
 .../Analysis/BaseTokenStreamTestCase.cs         |  2 +-
 .../Index/BaseStoredFieldsFormatTestCase.cs     |  4 +--
 src/Lucene.Net.TestFramework/Index/DocHelper.cs | 14 +++++------
 src/Lucene.Net.TestFramework/Util/TestUtil.cs   | 14 +++++------
 .../core/Document/TestDocument.cs               |  4 +--
 .../core/Index/TestBagOfPositions.cs            |  2 +-
 .../core/Index/TestConsistentFieldNumbers.cs    |  4 +--
 .../core/Index/TestDocumentWriter.cs            |  4 +--
 .../core/Index/TestFieldInfos.cs                |  2 +-
 .../core/Index/TestFieldsReader.cs              | 20 +++++++--------
 .../core/Index/TestIndexWriterExceptions.cs     |  8 +++---
 .../core/Index/TestIndexableField.cs            |  4 +--
 .../core/Index/TestSegmentReader.cs             |  4 +--
 23 files changed, 74 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 9a60977..0686d62 100644
--- a/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
@@ -133,7 +133,7 @@ namespace Lucene.Net.Codecs
             int storedCount = 0;
             foreach (IndexableField field in doc)
             {
-                if (field.FieldType().Stored)
+                if (field.FieldType.Stored)
                 {
                     storedCount++;
                 }
@@ -143,7 +143,7 @@ namespace Lucene.Net.Codecs
 
             foreach (IndexableField field in doc)
             {
-                if (field.FieldType().Stored)
+                if (field.FieldType.Stored)
                 {
                     WriteField(fieldInfos.FieldInfo(field.Name), field);
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 d29f8e7..6fcdc2e 100644
--- a/src/Lucene.Net.Core/Document/Field.cs
+++ b/src/Lucene.Net.Core/Document/Field.cs
@@ -571,18 +571,18 @@ namespace Lucene.Net.Documents
 
         /// <summary>
         /// Returns the <seealso cref="FieldType"/> for this field. </summary>
-        public IndexableFieldType FieldType()
+        public IndexableFieldType FieldType
         {
-            return Type;
+            get { return Type; }
         }
 
         public TokenStream GetTokenStream(Analyzer analyzer)
         {
-            if (!((FieldType)FieldType()).Indexed)
+            if (!((FieldType)FieldType).Indexed)
             {
                 return null;
             }
-            FieldType.NumericType? numericType = ((FieldType)FieldType()).NumericTypeValue;
+            FieldType.NumericType? numericType = ((FieldType)FieldType).NumericTypeValue;
             if (numericType != null)
             {
                 if (!(InternalTokenStream is NumericTokenStream))
@@ -618,7 +618,7 @@ namespace Lucene.Net.Documents
                 return InternalTokenStream;
             }
 
-            if (!((FieldType)FieldType()).Tokenized)
+            if (!((FieldType)FieldType).Tokenized)
             {
                 if (StringValue == null)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 301277f..6657d7e 100644
--- a/src/Lucene.Net.Core/Index/DocFieldProcessor.cs
+++ b/src/Lucene.Net.Core/Index/DocFieldProcessor.cs
@@ -225,7 +225,7 @@ namespace Lucene.Net.Index
                     // needs to be more "pluggable" such that if I want
                     // to have a new "thing" my Fields can do, I can
                     // easily add it
-                    FieldInfo fi = fieldInfos.AddOrUpdate(fieldName, field.FieldType());
+                    FieldInfo fi = fieldInfos.AddOrUpdate(fieldName, field.FieldType);
 
                     fp = new DocFieldProcessorPerField(this, fi);
                     fp.Next = FieldHash[hashPos];
@@ -241,7 +241,7 @@ namespace Lucene.Net.Index
                 {
                     // need to addOrUpdate so that FieldInfos can update globalFieldNumbers
                     // with the correct DocValue type (LUCENE-5192)
-                    FieldInfo fi = fieldInfos.AddOrUpdate(fieldName, field.FieldType());
+                    FieldInfo fi = fieldInfos.AddOrUpdate(fieldName, field.FieldType);
                     Debug.Assert(fi == fp.FieldInfo, "should only have updated an existing
FieldInfo instance");
                 }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 808dbda..e6c9ac4 100644
--- a/src/Lucene.Net.Core/Index/DocInverterPerField.cs
+++ b/src/Lucene.Net.Core/Index/DocInverterPerField.cs
@@ -69,7 +69,7 @@ namespace Lucene.Net.Index
             for (int i = 0; i < count; i++)
             {
                 IndexableField field = fields[i];
-                IndexableFieldType fieldType = field.FieldType();
+                IndexableFieldType fieldType = field.FieldType;
 
                 // TODO FI: this should be "genericized" to querying
                 // consumer if it wants to see this particular field

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/src/Lucene.Net.Core/Index/DocValuesProcessor.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/DocValuesProcessor.cs b/src/Lucene.Net.Core/Index/DocValuesProcessor.cs
index 04ccc66..ad4f011 100644
--- a/src/Lucene.Net.Core/Index/DocValuesProcessor.cs
+++ b/src/Lucene.Net.Core/Index/DocValuesProcessor.cs
@@ -53,7 +53,7 @@ namespace Lucene.Net.Index
 
         public override void AddField(int docID, IndexableField field, FieldInfo fieldInfo)
         {
-            DocValuesType_e? dvType = field.FieldType().DocValueType;
+            DocValuesType_e? dvType = field.FieldType.DocValueType;
             if (dvType != null)
             {
                 fieldInfo.DocValuesType = dvType;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs b/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs
index c86d76e..ba24d12 100644
--- a/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs
+++ b/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs
@@ -123,7 +123,7 @@ namespace Lucene.Net.Index
         {
             for (int i = 0; i < count; i++)
             {
-                if (fields[i].FieldType().Indexed)
+                if (fields[i].FieldType.Indexed)
                 {
                     return true;
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 d28f80a..cf4005e 100644
--- a/src/Lucene.Net.Core/Index/IndexableField.cs
+++ b/src/Lucene.Net.Core/Index/IndexableField.cs
@@ -49,7 +49,7 @@ namespace Lucene.Net.Index
         /// <seealso cref="IndexableFieldType"/> describing the properties
         /// of this field.
         /// </summary>
-        IndexableFieldType FieldType();
+        IndexableFieldType FieldType { get; }
 
         /// <summary>
         /// Returns the field's index-time boost.

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/src/Lucene.Net.Core/Index/StoredFieldsProcessor.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/StoredFieldsProcessor.cs b/src/Lucene.Net.Core/Index/StoredFieldsProcessor.cs
index 8c242c5..89a632b 100644
--- a/src/Lucene.Net.Core/Index/StoredFieldsProcessor.cs
+++ b/src/Lucene.Net.Core/Index/StoredFieldsProcessor.cs
@@ -158,7 +158,7 @@ namespace Lucene.Net.Index
 
         public override void AddField(int docID, IndexableField field, FieldInfo fieldInfo)
         {
-            if (field.FieldType().Stored)
+            if (field.FieldType.Stored)
             {
                 if (NumStoredFields == StoredFields.Length)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 fd1b1d3..4bb2e05 100644
--- a/src/Lucene.Net.Core/Index/TermVectorsConsumerPerField.cs
+++ b/src/Lucene.Net.Core/Index/TermVectorsConsumerPerField.cs
@@ -75,18 +75,18 @@ namespace Lucene.Net.Index
             for (int i = 0; i < count; i++)
             {
                 IndexableField field = fields[i];
-                if (field.FieldType().Indexed)
+                if (field.FieldType.Indexed)
                 {
-                    if (field.FieldType().StoreTermVectors)
+                    if (field.FieldType.StoreTermVectors)
                     {
                         DoVectors = true;
-                        DoVectorPositions |= field.FieldType().StoreTermVectorPositions;
-                        DoVectorOffsets |= field.FieldType().StoreTermVectorOffsets;
+                        DoVectorPositions |= field.FieldType.StoreTermVectorPositions;
+                        DoVectorOffsets |= field.FieldType.StoreTermVectorOffsets;
                         if (DoVectorPositions)
                         {
-                            DoVectorPayloads |= field.FieldType().StoreTermVectorPayloads;
+                            DoVectorPayloads |= field.FieldType.StoreTermVectorPayloads;
                         }
-                        else if (field.FieldType().StoreTermVectorPayloads)
+                        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 + "\")");
@@ -94,15 +94,15 @@ namespace Lucene.Net.Index
                     }
                     else
                     {
-                        if (field.FieldType().StoreTermVectorOffsets)
+                        if (field.FieldType.StoreTermVectorOffsets)
                         {
                             throw new System.ArgumentException("cannot index term vector
offsets when term vectors are not indexed (field=\"" + field.Name + "\")");
                         }
-                        if (field.FieldType().StoreTermVectorPositions)
+                        if (field.FieldType.StoreTermVectorPositions)
                         {
                             throw new System.ArgumentException("cannot index term vector
positions when term vectors are not indexed (field=\"" + field.Name + "\")");
                         }
-                        if (field.FieldType().StoreTermVectorPayloads)
+                        if (field.FieldType.StoreTermVectorPayloads)
                         {
                             throw new System.ArgumentException("cannot index term vector
payloads when term vectors are not indexed (field=\"" + field.Name + "\")");
                         }
@@ -110,19 +110,19 @@ namespace Lucene.Net.Index
                 }
                 else
                 {
-                    if (field.FieldType().StoreTermVectors)
+                    if (field.FieldType.StoreTermVectors)
                     {
                         throw new System.ArgumentException("cannot index term vectors when
field is not indexed (field=\"" + field.Name + "\")");
                     }
-                    if (field.FieldType().StoreTermVectorOffsets)
+                    if (field.FieldType.StoreTermVectorOffsets)
                     {
                         throw new System.ArgumentException("cannot index term vector offsets
when field is not indexed (field=\"" + field.Name + "\")");
                     }
-                    if (field.FieldType().StoreTermVectorPositions)
+                    if (field.FieldType.StoreTermVectorPositions)
                     {
                         throw new System.ArgumentException("cannot index term vector positions
when field is not indexed (field=\"" + field.Name + "\")");
                     }
-                    if (field.FieldType().StoreTermVectorPayloads)
+                    if (field.FieldType.StoreTermVectorPayloads)
                     {
                         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/b83de2cd/src/Lucene.Net.Facet/FacetsConfig.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/FacetsConfig.cs b/src/Lucene.Net.Facet/FacetsConfig.cs
index 2539c8b..97ed4cf 100644
--- a/src/Lucene.Net.Facet/FacetsConfig.cs
+++ b/src/Lucene.Net.Facet/FacetsConfig.cs
@@ -290,7 +290,7 @@ namespace Lucene.Net.Facet
 
             foreach (IndexableField field in doc.Fields)
             {
-                if (field.FieldType() == FacetField.TYPE)
+                if (field.FieldType == FacetField.TYPE)
                 {
                     FacetField facetField = (FacetField)field;
                     FacetsConfig.DimConfig dimConfig = GetDimConfig(facetField.dim);
@@ -308,7 +308,7 @@ namespace Lucene.Net.Facet
                     fields.Add(facetField);
                 }
 
-                if (field.FieldType() == SortedSetDocValuesFacetField.TYPE)
+                if (field.FieldType == SortedSetDocValuesFacetField.TYPE)
                 {
                     var facetField = (SortedSetDocValuesFacetField)field;
                     FacetsConfig.DimConfig dimConfig = GetDimConfig(facetField.Dim);
@@ -326,7 +326,7 @@ namespace Lucene.Net.Facet
                     fields.Add(facetField);
                 }
 
-                if (field.FieldType() == AssociationFacetField.TYPE)
+                if (field.FieldType == AssociationFacetField.TYPE)
                 {
                     AssociationFacetField facetField = (AssociationFacetField)field;
                     FacetsConfig.DimConfig dimConfig = GetDimConfig(facetField.dim);
@@ -390,7 +390,7 @@ namespace Lucene.Net.Facet
 
             foreach (IndexableField field in doc.Fields)
             {
-                IndexableFieldType ft = field.FieldType();
+                IndexableFieldType ft = field.FieldType;
                 if (ft != FacetField.TYPE && ft != SortedSetDocValuesFacetField.TYPE
&& ft != AssociationFacetField.TYPE)
                 {
                     result.Add(field);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs b/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
index bb1098c..fc59cec 100644
--- a/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/BaseTokenStreamTestCase.cs
@@ -769,7 +769,7 @@ namespace Lucene.Net.Analysis
                             if (random.Next(7) == 0)
                             {
                                 // pile up a multivalued field
-                                var ft = (FieldType)field.FieldType();
+                                var ft = (FieldType)field.FieldType;
                                 currentField = new Field("dummy", bogus, ft);
                                 doc.Add(currentField);
                             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 38ad4e1..e3f8442 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
@@ -357,8 +357,8 @@ namespace Lucene.Net.Index
             w.AddDocument(doc);
             IndexReader r = w.Reader;
             w.Dispose();
-            Assert.IsFalse(r.Document(0).GetField("field").FieldType().Indexed);
-            Assert.IsTrue(r.Document(0).GetField("field2").FieldType().Indexed);
+            Assert.IsFalse(r.Document(0).GetField("field").FieldType.Indexed);
+            Assert.IsTrue(r.Document(0).GetField("field2").FieldType.Indexed);
             r.Dispose();
             dir.Dispose();
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 e2afbe0..8322dbb 100644
--- a/src/Lucene.Net.TestFramework/Index/DocHelper.cs
+++ b/src/Lucene.Net.TestFramework/Index/DocHelper.cs
@@ -261,7 +261,7 @@ namespace Lucene.Net.Index
             {
                 IndexableField f = Fields[i];
                 Add(All, f);
-                if (f.FieldType().Indexed)
+                if (f.FieldType.Indexed)
                 {
                     Add(Indexed, f);
                 }
@@ -269,15 +269,15 @@ namespace Lucene.Net.Index
                 {
                     Add(Unindexed, f);
                 }
-                if (f.FieldType().StoreTermVectors)
+                if (f.FieldType.StoreTermVectors)
                 {
                     Add(Termvector, f);
                 }
-                if (f.FieldType().Indexed && !f.FieldType().StoreTermVectors)
+                if (f.FieldType.Indexed && !f.FieldType.StoreTermVectors)
                 {
                     Add(Notermvector, f);
                 }
-                if (f.FieldType().Stored)
+                if (f.FieldType.Stored)
                 {
                     Add(Stored, f);
                 }
@@ -285,15 +285,15 @@ namespace Lucene.Net.Index
                 {
                     Add(Unstored, f);
                 }
-                if (f.FieldType().IndexOptions == FieldInfo.IndexOptions.DOCS_ONLY)
+                if (f.FieldType.IndexOptions == FieldInfo.IndexOptions.DOCS_ONLY)
                 {
                     Add(NoTf, f);
                 }
-                if (f.FieldType().OmitNorms)
+                if (f.FieldType.OmitNorms)
                 {
                     Add(NoNorms, f);
                 }
-                if (f.FieldType().IndexOptions == FieldInfo.IndexOptions.DOCS_ONLY)
+                if (f.FieldType.IndexOptions == FieldInfo.IndexOptions.DOCS_ONLY)
                 {
                     Add(NoTf, f);
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 a0c46ac..89f690a 100644
--- a/src/Lucene.Net.TestFramework/Util/TestUtil.cs
+++ b/src/Lucene.Net.TestFramework/Util/TestUtil.cs
@@ -993,8 +993,8 @@ namespace Lucene.Net.Util
             {
                 Field field1 = (Field)f;
                 Field field2;
-                DocValuesType_e? dvType = field1.FieldType().DocValueType;
-                NumericType? numType = field1.FieldType().NumericTypeValue;
+                DocValuesType_e? dvType = field1.FieldType.DocValueType;
+                NumericType? numType = field1.FieldType.NumericTypeValue;
                 if (dvType != null)
                 {
                     switch (dvType)
@@ -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/b83de2cd/src/Lucene.Net.Tests/core/Document/TestDocument.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Document/TestDocument.cs b/src/Lucene.Net.Tests/core/Document/TestDocument.cs
index 8d31bfc..c2700da 100644
--- a/src/Lucene.Net.Tests/core/Document/TestDocument.cs
+++ b/src/Lucene.Net.Tests/core/Document/TestDocument.cs
@@ -69,8 +69,8 @@ namespace Lucene.Net.Document
             Assert.AreEqual(2, doc.Fields.Count);
 
             Assert.IsTrue(binaryFld.BinaryValue() != null);
-            Assert.IsTrue(binaryFld.FieldType().Stored);
-            Assert.IsFalse(binaryFld.FieldType().Indexed);
+            Assert.IsTrue(binaryFld.FieldType.Stored);
+            Assert.IsFalse(binaryFld.FieldType.Indexed);
 
             string binaryTest = doc.GetBinaryValue("binary").Utf8ToString();
             Assert.IsTrue(binaryTest.Equals(BinaryVal));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/src/Lucene.Net.Tests/core/Index/TestBagOfPositions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestBagOfPositions.cs b/src/Lucene.Net.Tests/core/Index/TestBagOfPositions.cs
index 12cdc72..a82e3a6 100644
--- a/src/Lucene.Net.Tests/core/Index/TestBagOfPositions.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestBagOfPositions.cs
@@ -91,7 +91,7 @@ namespace Lucene.Net.Index
             }
 
             Field prototype = NewTextField("field", "", Field.Store.NO);
-            FieldType fieldType = new FieldType((FieldType)prototype.FieldType());
+            FieldType fieldType = new FieldType((FieldType)prototype.FieldType);
             if (Random().NextBoolean())
             {
                 fieldType.OmitNorms = true;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/src/Lucene.Net.Tests/core/Index/TestConsistentFieldNumbers.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestConsistentFieldNumbers.cs b/src/Lucene.Net.Tests/core/Index/TestConsistentFieldNumbers.cs
index f91bda1..c887899 100644
--- a/src/Lucene.Net.Tests/core/Index/TestConsistentFieldNumbers.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestConsistentFieldNumbers.cs
@@ -283,8 +283,8 @@ namespace Lucene.Net.Index
                 foreach (FieldInfo fi in fis)
                 {
                     Field expected = GetField(Convert.ToInt32(fi.Name));
-                    Assert.AreEqual(expected.FieldType().Indexed, fi.Indexed);
-                    Assert.AreEqual(expected.FieldType().StoreTermVectors, fi.HasVectors());
+                    Assert.AreEqual(expected.FieldType.Indexed, fi.Indexed);
+                    Assert.AreEqual(expected.FieldType.StoreTermVectors, fi.HasVectors());
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/src/Lucene.Net.Tests/core/Index/TestDocumentWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDocumentWriter.cs b/src/Lucene.Net.Tests/core/Index/TestDocumentWriter.cs
index dbe3ff5..dbe3e32 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDocumentWriter.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDocumentWriter.cs
@@ -80,12 +80,12 @@ namespace Lucene.Net.Index
             IndexableField[] fields = doc.GetFields("textField2");
             Assert.IsTrue(fields != null && fields.Length == 1);
             Assert.IsTrue(fields[0].StringValue.Equals(DocHelper.FIELD_2_TEXT));
-            Assert.IsTrue(fields[0].FieldType().StoreTermVectors);
+            Assert.IsTrue(fields[0].FieldType.StoreTermVectors);
 
             fields = doc.GetFields("textField1");
             Assert.IsTrue(fields != null && fields.Length == 1);
             Assert.IsTrue(fields[0].StringValue.Equals(DocHelper.FIELD_1_TEXT));
-            Assert.IsFalse(fields[0].FieldType().StoreTermVectors);
+            Assert.IsFalse(fields[0].FieldType.StoreTermVectors);
 
             fields = doc.GetFields("keyField");
             Assert.IsTrue(fields != null && fields.Length == 1);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 59973e2..7453ea9 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/b83de2cd/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 fcaac0d..46aa94b 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());
@@ -85,22 +85,22 @@ namespace Lucene.Net.Index
 
             Field field = (Field)doc.GetField(DocHelper.TEXT_FIELD_2_KEY);
             Assert.IsTrue(field != null);
-            Assert.IsTrue(field.FieldType().StoreTermVectors);
+            Assert.IsTrue(field.FieldType.StoreTermVectors);
 
-            Assert.IsFalse(field.FieldType().OmitNorms);
-            Assert.IsTrue(field.FieldType().IndexOptions == FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+            Assert.IsFalse(field.FieldType.OmitNorms);
+            Assert.IsTrue(field.FieldType.IndexOptions == FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
 
             field = (Field)doc.GetField(DocHelper.TEXT_FIELD_3_KEY);
             Assert.IsTrue(field != null);
-            Assert.IsFalse(field.FieldType().StoreTermVectors);
-            Assert.IsTrue(field.FieldType().OmitNorms);
-            Assert.IsTrue(field.FieldType().IndexOptions == FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+            Assert.IsFalse(field.FieldType.StoreTermVectors);
+            Assert.IsTrue(field.FieldType.OmitNorms);
+            Assert.IsTrue(field.FieldType.IndexOptions == FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
 
             field = (Field)doc.GetField(DocHelper.NO_TF_KEY);
             Assert.IsTrue(field != null);
-            Assert.IsFalse(field.FieldType().StoreTermVectors);
-            Assert.IsFalse(field.FieldType().OmitNorms);
-            Assert.IsTrue(field.FieldType().IndexOptions == FieldInfo.IndexOptions.DOCS_ONLY);
+            Assert.IsFalse(field.FieldType.StoreTermVectors);
+            Assert.IsFalse(field.FieldType.OmitNorms);
+            Assert.IsTrue(field.FieldType.IndexOptions == FieldInfo.IndexOptions.DOCS_ONLY);
 
             DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor(DocHelper.TEXT_FIELD_3_KEY);
             reader.Document(0, visitor);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 8e322d0..a80f4ee 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
@@ -1628,7 +1628,7 @@ namespace Lucene.Net.Index
                         try
                         {
                             w.AddDocument(doc);
-                            Assert.IsFalse(field.FieldType().StoreTermVectors);
+                            Assert.IsFalse(field.FieldType.StoreTermVectors);
                         }
                         catch (Exception e)
                         {
@@ -1653,7 +1653,7 @@ namespace Lucene.Net.Index
                         try
                         {
                             w.AddDocument(doc);
-                            Assert.IsFalse(field.FieldType().StoreTermVectors);
+                            Assert.IsFalse(field.FieldType.StoreTermVectors);
                         }
                         catch (Exception e)
                         {
@@ -2009,9 +2009,9 @@ namespace Lucene.Net.Index
                 get { return "foo"; }
             }
 
-            public IndexableFieldType FieldType()
+            public IndexableFieldType FieldType
             {
-                return StringField.TYPE_NOT_STORED;
+                get { return StringField.TYPE_NOT_STORED; }
             }
 
             public float GetBoost()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 cdb111b..6da64d2 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
@@ -215,9 +215,9 @@ namespace Lucene.Net.Index
                 get { return null; }
             }
 
-            public IndexableFieldType FieldType()
+            public IndexableFieldType FieldType
             {
-                return fieldType;
+                get { return fieldType; }
             }
 
             public TokenStream GetTokenStream(Analyzer analyzer)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b83de2cd/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 2f6d8fb..d7c3711 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
@@ -191,9 +191,9 @@ namespace Lucene.Net.Index
             for (int i = 0; i < DocHelper.Fields.Length; i++)
             {
                 IndexableField f = DocHelper.Fields[i];
-                if (f.FieldType().Indexed)
+                if (f.FieldType.Indexed)
                 {
-                    Assert.AreEqual(reader.GetNormValues(f.Name) != null, !f.FieldType().OmitNorms);
+                    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)
                     {


Mime
View raw message