You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by la...@apache.org on 2023/04/13 20:55:20 UTC

[lucenenet] branch master updated: QueryParserTokenManager suppress sonar errors and add comment on constructors (#833)

This is an automated email from the ASF dual-hosted git repository.

laimis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/master by this push:
     new cbe4333c3 QueryParserTokenManager suppress sonar errors and add comment on constructors (#833)
cbe4333c3 is described below

commit cbe4333c3087096cb414e4d23421e5bb09f67bb5
Author: Laimonas Simutis <la...@gmail.com>
AuthorDate: Thu Apr 13 13:55:15 2023 -0700

    QueryParserTokenManager suppress sonar errors and add comment on constructors (#833)
---
 src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs
index 069879684..7e0061334 100644
--- a/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs
+++ b/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs
@@ -1170,7 +1170,13 @@ namespace Lucene.Net.QueryParsers.Classic
             m_input_stream = stream;
         }
 
-        /// <summary>Constructor. </summary>
+        /// <summary>Constructor. 
+        /// <para>Note that this constructor calls a virtual method <see cref="SwitchTo(int)" />. If you
+        /// are subclassing this class, use <see cref="QueryParserTokenManager(ICharStream)" /> constructor and
+        /// call SwitchTo if needed.</para>
+        /// </summary>
+        [SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "This is a SonarCloud issue")]
+        [SuppressMessage("CodeQuality", "S1699:Constructors should only call non-overridable methods", Justification = "Required for continuity with Lucene's design")]
         public QueryParserTokenManager(ICharStream stream, int lexState):this(stream)
         {
             SwitchTo(lexState);