Skip to content

Don't allow IndexWriterConfig setters to chain [LUCENE-3756] #4829

@asfimport

Description

@asfimport

Spinoff from #4810.

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!).


Migrated from LUCENE-3756 by Michael McCandless (@mikemccand), updated Feb 10 2012

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions