Skip to content

Commit

Permalink
BUG: Lucene.Net.QueryParsers.Classic.QueryParserTokenManager: Removed…
Browse files Browse the repository at this point in the history
… initialization code that caused writing a BOM to standard out upon creation. Fixes #792.
  • Loading branch information
NightOwl888 committed Jan 20, 2024
1 parent 3e23da2 commit 1e6c80a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Console = Lucene.Net.Util.SystemConsole;

namespace Lucene.Net.QueryParsers.Classic
{
Expand All @@ -28,17 +29,9 @@ namespace Lucene.Net.QueryParsers.Classic
[SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "This class is based on generated code")]
public class QueryParserTokenManager //: QueryParserConstants
{
private void InitBlock()
{
StreamWriter temp_writer;
temp_writer = new StreamWriter(Console.OpenStandardOutput(), Console.Out.Encoding);
temp_writer.AutoFlush = true;
debugStream = temp_writer;
}

/// <summary>Debug output. </summary>
#pragma warning disable IDE0052 // Remove unread private members
private TextWriter debugStream; // LUCENENET specific - made private, since we already have a setter
private TextWriter debugStream = Console.Out; // LUCENENET specific - made private, since we already have a setter
#pragma warning restore IDE0052 // Remove unread private members
/// <summary>Set debug output. </summary>
public virtual void SetDebugStream(TextWriter ds)
Expand Down Expand Up @@ -1166,7 +1159,6 @@ private static bool JjCanMove_2(int hiByte, int i1, int i2, ulong l1, ulong l2)
/// <summary>Constructor. </summary>
public QueryParserTokenManager(ICharStream stream)
{
InitBlock();
m_input_stream = stream;
}

Expand Down

0 comments on commit 1e6c80a

Please sign in to comment.