NightOwl888 commented on code in PR #821:
URL: https://github.com/apache/lucenenet/pull/821#discussion_r1165928400


##########
src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs:
##########
@@ -98,7 +99,19 @@ public class PerfRunData : IDisposable
         private readonly IDictionary<string, object> perfObjects = new 
Dictionary<string, object>();
 
         // constructor
-        public PerfRunData(Config config)
+        public PerfRunData(Config config) : this(
+            config,
+            performReinit: true,
+            logQueries: string.Equals(config?.Get("log.queries", "false") ?? 
"false", "true", StringComparison.OrdinalIgnoreCase))
+        {    
+        }
+
+        // LUCENENET specific - added performReinit parameter to allow 
subclasses to skip reinit
+        // since it's a virtual method. Also added logQueries parameter to 
allow to skip calling
+        // virtual GetQueryMarker. Subclass can call these methods itself if 
needed.
+        [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")]
+        protected PerfRunData(Config config, bool performReinit, bool 
logQueries)
         {
             this.config = config;

Review Comment:
   Let's add a `null` coalesce guard clause here.
   
   ```c#
   this.config = config ?? throw new ArgumentNullException(nameof(config));
   ```



-- 
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: dev-unsubscr...@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to