laimis commented on code in PR #819: URL: https://github.com/apache/lucenenet/pull/819#discussion_r1164399050
########## src/Lucene.Net/Codecs/BlockTreeTermsReader.cs: ########## @@ -114,10 +114,31 @@ public class BlockTreeTermsReader : FieldsProducer private readonly int version; + protected readonly TSubclassState m_subclassState; + /// <summary> /// Sole constructor. </summary> - public BlockTreeTermsReader(Directory dir, FieldInfos fieldInfos, SegmentInfo info, PostingsReaderBase postingsReader, IOContext ioContext, string segmentSuffix, int indexDivisor) + /// <param name="subclassState">LUCENENET specific parameter which allows a subclass + /// to set state. It is *optional* and can be used when overriding the ReadHeader(), + /// ReadIndexHeader() and SeekDir() methods. It only matters in the case where the state + /// is required inside of any of those methods that is passed in to the subclass constructor. + /// + /// When passed to the constructor, it is set to the protected field m_subclassState before + /// any of the above methods are called where it is available for reading when overriding the above methods. + /// + /// If your subclass needs to pass more than one piece of data, you can create a class or struct to do so. + /// All other virtual members of BlockTreeTermsReader are not called in the constructor, + /// so the overrides of those methods won't specifically need to use this field (although they could for consistency). + /// </param> + [SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "This is a SonarCloud issue")] + [SuppressMessage("CodeQuality", "S1699:Required for continuity with Lucene's design", Justification = "Internal class")] Review Comment: Done! -- 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