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


##########
src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs:
##########
@@ -98,7 +99,15 @@ 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, true)
+        {    
+        }
+
+        // LUCENENET specific - added performReinit parameter to allow 
subclasses to skip reinit
+        // since it's a virtual method. Subclass can call that method 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)

Review Comment:
   Actually, the `config` value will get a `NullReferenceException` anyway if 
it is `null`. Let's add a guard glause for that (and update the docs that it 
will throw `ArgumentNullException` in this case). This was to allow that `null` 
check to be performed later inside of the constructor, but I forgot to mention 
it previously.
   
   But if you feel this is too much logic to put inside of a constructor 
cascade, we could make it into a private static method instead.



-- 
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