laimis commented on code in PR #828:
URL: https://github.com/apache/lucenenet/pull/828#discussion_r1165920038


##########
src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs:
##########
@@ -50,28 +51,40 @@ public class WithinPrefixTreeFilter : 
AbstractVisitingPrefixTreeFilter
         //  minimal query buffer by looking in a DocValues cache holding a 
representative
         //  point of each disjoint component of a document's shape(s).
 
-        private readonly IShape? bufferedQueryShape;//if null then the whole 
world
+        // LUCENENET specific - made protected to allow subclasses to access 
if needed
+        protected readonly IShape? m_bufferedQueryShape;//if null then the 
whole world
 
         /// <summary>
         /// See <see cref="AbstractVisitingPrefixTreeFilter(IShape, string, 
SpatialPrefixTree, int, int)"/>.
         /// <c>queryBuffer</c> is the (minimum) distance beyond the query 
shape edge
         /// where non-matching documents are looked for so they can be 
excluded. If
         /// -1 is used then the whole world is examined (a good default for 
correctness).
         /// </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 WithinPrefixTreeFilter(IShape queryShape, string fieldName, 
SpatialPrefixTree grid, 
                                       int detailLevel, int 
prefixGridScanLevel, double queryBuffer)
-            : base(queryShape, fieldName, grid, detailLevel, 
prefixGridScanLevel)
+            : this(queryShape, fieldName, grid, detailLevel, 
prefixGridScanLevel, bufferShape: null)
         {
             if (queryBuffer == -1)
             {
-                bufferedQueryShape = null;
+                m_bufferedQueryShape = null;
             }
             else
             {
-                bufferedQueryShape = BufferShape(queryShape, queryBuffer);
+                m_bufferedQueryShape = BufferShape(queryShape, queryBuffer);
             }
         }
 
+        // LUCENENET specific - subclasses can use this class to override the 
behavior of
+        // BufferShape method in a way that's safe and called from the 
subclass constructor
+        protected WithinPrefixTreeFilter(IShape queryShape, string fieldName, 
SpatialPrefixTree grid, 
+                                      int detailLevel, int 
prefixGridScanLevel, IShape? bufferShape)

Review Comment:
   done!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to