Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Lucene.Net.QueryParsers.Classic.QueryParserTokenManager: Removed initialization code that caused writing a BOM to standard out upon creation. Fixes #792. #902

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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