BUG: Lucene.Net.Index.IndexWriter: Must set test variable outside of Debug.Assert, or property will be null
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ca976561 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ca976561 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ca976561 Branch: refs/heads/api-work Commit: ca9765613837efd00c1cfc064e311080c13c89cc Parents: e35087d Author: Shad Storhaug <[email protected]> Authored: Sun Apr 9 19:50:10 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Sun Apr 9 19:50:10 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net/Index/IndexWriter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ca976561/src/Lucene.Net/Index/IndexWriter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Index/IndexWriter.cs b/src/Lucene.Net/Index/IndexWriter.cs index b93c5d9..618024c 100644 --- a/src/Lucene.Net/Index/IndexWriter.cs +++ b/src/Lucene.Net/Index/IndexWriter.cs @@ -3995,7 +3995,9 @@ namespace Lucene.Net.Index get { bool test = false; - Debug.Assert(test = true); + // LUCENENET NOTE: Must set test outside of Debug.Assert!! + bool isTest = test = true; + Debug.Assert(isTest); return test ? docWriter : null; } }
