Return-Path: X-Original-To: apmail-lucenenet-commits-archive@www.apache.org Delivered-To: apmail-lucenenet-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E83731746E for ; Tue, 3 Feb 2015 23:56:32 +0000 (UTC) Received: (qmail 65276 invoked by uid 500); 3 Feb 2015 23:56:33 -0000 Delivered-To: apmail-lucenenet-commits-archive@lucenenet.apache.org Received: (qmail 65248 invoked by uid 500); 3 Feb 2015 23:56:33 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 65226 invoked by uid 99); 3 Feb 2015 23:56:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 23:56:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A046BE04AF; Tue, 3 Feb 2015 23:56:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: synhershko@apache.org To: commits@lucenenet.apache.org Date: Tue, 03 Feb 2015 23:56:34 -0000 Message-Id: <8999f026ba9949d1a5cd6079161b9f06@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] lucenenet git commit: Missing the IndexWriterConfig was missing SetCheckIntegrityAtMerge method. Missing the IndexWriterConfig was missing SetCheckIntegrityAtMerge method. C# does not have the synthetic flag so I changed it to look at the DeclaringType of the method to understand if it was a method from the LiveIndexWriterConfig. This allowed me to enable the check to ensure all setters are properly overridden. Conflicts: src/Lucene.Net.Tests/core/Index/TestIndexWriterConfig.cs Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/511507fb Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/511507fb Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/511507fb Branch: refs/heads/master Commit: 511507fbb12cc0a34cf34a58a3ef7cecb46cc1e0 Parents: 692b43c Author: Chand2048 Authored: Mon Feb 2 11:33:20 2015 -0800 Committer: Itamar Syn-Hershko Committed: Wed Feb 4 01:49:46 2015 +0200 ---------------------------------------------------------------------- src/Lucene.Net.Core/Index/IndexWriterConfig.cs | 5 +++++ .../core/Index/TestIndexWriterConfig.cs | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/511507fb/src/Lucene.Net.Core/Index/IndexWriterConfig.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Index/IndexWriterConfig.cs b/src/Lucene.Net.Core/Index/IndexWriterConfig.cs index ed6c6e5..cf13334 100644 --- a/src/Lucene.Net.Core/Index/IndexWriterConfig.cs +++ b/src/Lucene.Net.Core/Index/IndexWriterConfig.cs @@ -704,6 +704,11 @@ namespace Lucene.Net.Index return (IndexWriterConfig)base.SetUseCompoundFile(useCompoundFile); } + public IndexWriterConfig SetCheckIntegrityAtMerge(bool checkIntegrityAtMerge) + { + return (IndexWriterConfig)base.SetCheckIntegrityAtMerge(checkIntegrityAtMerge); + } + public override string ToString() { StringBuilder sb = new StringBuilder(base.ToString()); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/511507fb/src/Lucene.Net.Tests/core/Index/TestIndexWriterConfig.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterConfig.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterConfig.cs index 514b7f0..215d1d4 100644 --- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterConfig.cs +++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterConfig.cs @@ -127,28 +127,28 @@ namespace Lucene.Net.Index HashSet allSetters = new HashSet(); foreach (MethodInfo m in typeof(IndexWriterConfig).GetMethods()) { - if (m.Name.StartsWith("set") && !m.IsStatic) + if (m.Name.StartsWith("Set") && !m.IsStatic) { allSetters.Add(m.Name); // setters overridden from LiveIndexWriterConfig are returned twice, once with // IndexWriterConfig return type and second with LiveIndexWriterConfig. The ones // from LiveIndexWriterConfig are marked 'synthetic', so just collect them and // assert in the end that we also received them from IWC. - // LUCENENET TODO - /*if (m.Synthetic) + // In C# we do not have them marked synthetic so we look at the declaring type instead. + if (m.DeclaringType.Name == "LiveIndexWriterConfig") { liveSetters.Add(m.Name); } else - {*/ - Assert.AreEqual(typeof(IndexWriterConfig), m.ReturnType, "method " + m.Name + " does not return IndexWriterConfig"); - //} + { + Assert.AreEqual(typeof(IndexWriterConfig), m.ReturnType, "method " + m.Name + " does not return IndexWriterConfig"); + } } } - /*foreach (string setter in liveSetters) + foreach (string setter in liveSetters) { Assert.IsTrue(allSetters.Contains(setter), "setter method not overridden by IndexWriterConfig: " + setter); - }*/ + } } [Test]