laimis commented on code in PR #837:
URL: https://github.com/apache/lucenenet/pull/837#discussion_r1167991248
##########
src/Lucene.Net/Search/IndexSearcher.cs:
##########
@@ -192,8 +197,13 @@ public IndexSearcher(IndexReaderContext context)
/// Each <see cref="LeafSlice"/> is executed in a single thread. By
default there
/// will be one <see cref="LeafSlice"/> per leaf (<see
cref="AtomicReaderContext"/>).
/// </summary>
+ /// <exception cref="ArgumentNullException"><paramref name="leaves"/>
is <c>null</c>.</exception>
protected virtual LeafSlice[] GetSlices(IList<AtomicReaderContext>
leaves)
{
+ // LUCENENET: Added guard clause
+ if (leaves is null)
+ throw new ArgumentNullException(nameof(leaves));
+
LeafSlice[] slices = new LeafSlice[leaves.Count];
Review Comment:
I am not a fan of these type of additions. This is not present in the
original source, not even in the latest version. We could add a lot of extra
typing/code (that's not even interesting, just copy paste of exception docs and
guar checks). This is why I wasn't sure what you meant by guard clauses as it
seemed excessive.
--
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]