lucenenet-dev mailing list archives

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

    https://github.com/apache/lucenenet/pull/172#discussion_r71187179
  
    --- Diff: src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs ---
    @@ -85,24 +85,24 @@ public static IndexWriter MockIndexWriter(Directory dir, IndexWriterConfig
conf,
     
             /// <summary>
             /// create a RandomIndexWriter with a random config: Uses TEST_VERSION_CURRENT
and MockAnalyzer </summary>
    -        public RandomIndexWriter(Random r, Directory dir)
    -            : this(r, dir, LuceneTestCase.NewIndexWriterConfig(r, LuceneTestCase.TEST_VERSION_CURRENT,
new MockAnalyzer(r)))
    -        {
    -        }
    +        //public RandomIndexWriter(Random r, Directory dir)
    +        //    : this(r, dir, LuceneTestCase.NewIndexWriterConfig(r, LuceneTestCase.TEST_VERSION_CURRENT,
new MockAnalyzer(r)))
    +        //{
    +        //}
     
             /// <summary>
             /// create a RandomIndexWriter with a random config: Uses TEST_VERSION_CURRENT
</summary>
    -        public RandomIndexWriter(Random r, Directory dir, Analyzer a)
    -            : this(r, dir, LuceneTestCase.NewIndexWriterConfig(r, LuceneTestCase.TEST_VERSION_CURRENT,
a))
    -        {
    -        }
    +        //public RandomIndexWriter(Random r, Directory dir, Analyzer a)
    +        //    : this(r, dir, LuceneTestCase.NewIndexWriterConfig(r, LuceneTestCase.TEST_VERSION_CURRENT,
a))
    +        //{
    +        //}
     
             /// <summary>
             /// create a RandomIndexWriter with a random config </summary>
    -        public RandomIndexWriter(Random r, Directory dir, LuceneVersion v, Analyzer a)
    -            : this(r, dir, LuceneTestCase.NewIndexWriterConfig(r, v, a))
    -        {
    -        }
    +        //public RandomIndexWriter(Random r, Directory dir, LuceneVersion v, Analyzer
a)
    +        //    : this(r, dir, LuceneTestCase.NewIndexWriterConfig(r, v, a))
    +        //{
    +        //}
    --- End diff --
    
    Is that sufficient to replace it with a `new IndexWriterConfig`? The original static method
does a lot more set-up.... and since I made LuceneTestCase non-static (since it depends on
the non-static variable ClassEnvRule), I wasn't sure how to incorporate this call.


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