paulirwin commented on code in PR #1058:
URL: https://github.com/apache/lucenenet/pull/1058#discussion_r1997677357


##########
src/Lucene.Net.Spatial/Prefix/PrefixTreeStrategy.cs:
##########
@@ -159,14 +159,23 @@ public virtual Field[] CreateIndexableFields(IShape? 
shape, double distErr)
         }.Freeze();
 
         /// <summary>
-        /// Outputs the tokenString of a cell, and if its a leaf, outputs it 
again with the leaf byte.
+        /// Outputs the tokenString of a cell, and if it's a leaf, outputs it 
again with the leaf byte.
         /// </summary>
         /// <remarks>
         /// LUCENENET specific - This class originally took an enumerator, 
which meant that it could not
-        /// be reused (since most IEnumerator implementations can only be 
iterated once and throw on
-        /// <see cref="System.Collections.IEnumerator.Reset()"/>). This class 
has been modified to take an
-        /// <c>IEnumerable&lt;Cell&gt;</c> instead, which allows it to be 
reused, per the TokenStream
-        /// workflow contract of allowing <see cref="TokenStream.Reset()"/> 
after <see cref="TokenStream.Close()"/>.
+        /// be reused after a call to <see cref="TokenStream.Close()"/> (which 
was not present in the Lucene code).
+        /// This class has been modified to take an 
<c>IEnumerable&lt;Cell&gt;</c> instead, which allows it to be
+        /// reused, per the TokenStream workflow contract of allowing <see 
cref="TokenStream.Reset()"/>
+        /// after <see cref="TokenStream.Close()"/>. To accomplish this, it 
takes an enumerable and lazy-initializes
+        /// its enumerator upon the first call to <see 
cref="TokenStream.Reset()"/>. Calling
+        /// <see cref="TokenStream.Close()"/> will dispose of the enumerator, 
but it can be reinitialized by calling
+        /// <see cref="TokenStream.Reset()"/> again.
+        /// <para />
+        /// This implementation also expects that the enumerator will support 
<see cref="IEnumerator{T}.Reset()"/>

Review Comment:
   Nevermind, I see the warning now. We should probably make those warnings be 
errors.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to