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:15:57 UTC

[lucenenet] branch master updated: Add ignore attributes for JaspellTernarySearchTrie (#824)

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 32971f925 Add ignore attributes for JaspellTernarySearchTrie (#824)
32971f925 is described below

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

    Add ignore attributes for JaspellTernarySearchTrie (#824)
---
 .../Suggest/Jaspell/JaspellTernarySearchTrie.cs                   | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs b/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs
index e6cf45adc..dfad9a8a4 100644
--- a/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs
@@ -30,6 +30,7 @@ using J2N.Text;
 using Lucene.Net.Util;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.Globalization;
 using System.IO;
 using System.IO.Compression;
@@ -266,6 +267,11 @@ namespace Lucene.Net.Search.Suggest.Jaspell
         /// the form "word TAB float".
         /// 
         /// <para>Uses the supplied culture to lowercase words before comparing.</para>
+        /// <para>NOTE for subclasses: this constructor calls a virtual method, which could
+        /// result in your override of it being called before the class is properly initialized.
+        /// To overcome the issue, you could override <see cref="JaspellTernarySearchTrie(CultureInfo)"/>
+        /// constructor and then call the logic in a way that suits your needs.
+        /// </para>
         /// </summary>
         /// <param name="file">
         ///          The <see cref="FileInfo"/> with the data to load into the Trie. </param>
@@ -275,6 +281,8 @@ namespace Lucene.Net.Search.Suggest.Jaspell
         /// <param name="culture">The culture used for lowercasing.</param>
         /// <exception cref="IOException">
         ///              A problem occured while reading the data. </exception>
+        [SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "This is a SonarCloud issue")]
+        [SuppressMessage("CodeQuality", "S1699:Constructors should only call non-overridable methods", Justification = "This class gets deprecated and removed in later versions")]
         public JaspellTernarySearchTrie(FileInfo file, bool compression, CultureInfo culture)
             : this(culture)
         {