NightOwl888 commented on code in PR #1058: URL: https://github.com/apache/lucenenet/pull/1058#discussion_r1997460591
########## src/Lucene.Net/Analysis/TokenStream.cs: ########## @@ -108,8 +130,17 @@ protected TokenStream(AttributeFactory factory) { // LUCENENET: Rather than using AssertFinal() to run Reflection code at runtime, // we are using a Roslyn code analyzer to ensure the rules are followed at compile time. + + // LUCENENET specific - track disposable TokenStreams that are part of the current chain + disposableTracker = new DisposableTracker(This); } + /// <summary> + /// LUCENENET: We cannot access <c>this</c> from the constructor, so this property is used + /// to cheat the compiler. + /// </summary> + private TokenStream This => this; Review Comment: If `this` works in the constructor, I would rather use it that way. When I tried it, it didn't compile, but perhaps I had another issue that was unrelated. -- 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