Skip to content

Commit

Permalink
Leave debugStream as null on construction of StandardSyntaxParserToke…
Browse files Browse the repository at this point in the history
…nManager

* When debugStream is set to Console.Out by default, constructing a StandardQueryParser throws an exception on OSes that do not support Console, such as iOS and Android.
* debugStream can be set later using the setter, if needed.
* See issue apache#936 for details.
  • Loading branch information
JayOfemi committed Jun 11, 2024
1 parent 38a7b53 commit c4a48d2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Lucene.Net.Support.IO;
using Lucene.Net.Support.IO;
using System.Diagnostics.CodeAnalysis;
using System;
using System.IO;
Expand Down Expand Up @@ -32,7 +32,7 @@ public class StandardSyntaxParserTokenManager /*: StandardSyntaxParserConstants*
{
/// <summary>Debug output.</summary>
#pragma warning disable IDE0052 // Remove unread private members
private TextWriter debugStream = Console.Out; // LUCENENET specific - made private, since we already have a setter
private TextWriter debugStream; // LUCENENET specific - made private, since we already have a setter
#pragma warning restore IDE0052 // Remove unread private members
/// <summary>Set debug output.</summary>
public void SetDebugStream(TextWriter ds) { debugStream = new SafeTextWriterWrapper(ds); }
Expand Down

0 comments on commit c4a48d2

Please sign in to comment.