lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhershko <...@git.apache.org>
Subject [GitHub] lucenenet pull request #172: Removing/limiting uses of static variables and ...
Date Sat, 16 Jul 2016 21:21:58 GMT
Github user synhershko commented on a diff in the pull request:

    https://github.com/apache/lucenenet/pull/172#discussion_r71072078
  
    --- Diff: src/Lucene.Net.Tests/core/Index/TestBinaryDocValuesUpdates.cs ---
    @@ -1109,25 +1109,55 @@ public virtual void TestUpdateBinaryDVFieldWithSameNameAsPostingField()
             [Test]
             public virtual void TestUpdateOldSegments()
             {
    -            Codec[] oldCodecs = new Codec[] { new Lucene40RWCodec(), new Lucene41RWCodec(),
new Lucene42RWCodec(), new Lucene45RWCodec() };
    +            OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
    +            Codec[] oldCodecs = new Codec[] {
    +                new Lucene40RWCodec(OLD_FORMAT_IMPERSONATION_IS_ACTIVE),
    +                new Lucene41RWCodec(OLD_FORMAT_IMPERSONATION_IS_ACTIVE),
    +                new Lucene42RWCodec(OLD_FORMAT_IMPERSONATION_IS_ACTIVE),
    +                new Lucene45RWCodec(OLD_FORMAT_IMPERSONATION_IS_ACTIVE)
    +            };
                 Directory dir = NewDirectory();
     
    -            bool oldValue = OLD_FORMAT_IMPERSONATION_IS_ACTIVE;
                 // create a segment with an old Codec
                 IndexWriterConfig conf = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
                 conf.SetCodec(oldCodecs[Random().Next(oldCodecs.Length)]);
    -            OLD_FORMAT_IMPERSONATION_IS_ACTIVE = true;
                 IndexWriter writer = new IndexWriter(dir, conf);
                 Document doc = new Document();
                 doc.Add(new StringField("id", "doc", Store.NO));
                 doc.Add(new BinaryDocValuesField("f", ToBytes(5L)));
                 writer.AddDocument(doc);
                 writer.Dispose();
    +            dir.Dispose();
    +
    +            OLD_FORMAT_IMPERSONATION_IS_ACTIVE = false;
    --- End diff --
    
    why do you set this here? If I read the original code correctly, this isn't needed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message