Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3756

Don't allow IndexWriterConfig setters to chain

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • New

    Description

      Spinoff from LUCENE-3736.

      I don't like that IndexWriterConfig's setters are chainable; it
      results in code in our tests like this:

      IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMaxBufferedDocs(2).setMergePolicy(newLogMergePolicy()));
      

      I think in general we should avoid chaining since it encourages hard
      to read code (code is already hard enough to read!).

      Attachments

        Activity

          People

            mikemccand Michael McCandless
            mikemccand Michael McCandless
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: