[
https://issues.apache.org/jira/browse/LUCENE-3756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13204584#comment-13204584
]
Yonik Seeley commented on LUCENE-3756:
--------------------------------------
This is indicative of a larger worrying trend of people thinking of how to do
something the best way and then trying to prohibit all other ways. It
ultimately makes Lucene less flexible.
Was LUCENE-3736 really reverted over this coding style? That's definitely not
something we should make a precedent.
Rather than let this be decided by attrition like LUCENE-2308 (freeze vs
builder vs ???), it would seem fairer to perhaps call a straight up vote. This
isn't a deep technical issue, but rather a style issue that most committers
probably have an opinion on.
> Don't allow IndexWriterConfig setters to chain
> ----------------------------------------------
>
> Key: LUCENE-3756
> URL: https://issues.apache.org/jira/browse/LUCENE-3756
> Project: Lucene - Java
> Issue Type: Improvement
> Reporter: Michael McCandless
> Assignee: Michael McCandless
>
> Spinoff from LUCENE-3736.
> I don't like that IndexWriterConfig's setters are chainable; it
> results in code in our tests like this:
> {noformat}
> IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(
> TEST_VERSION_CURRENT, new
> MockAnalyzer(random)).setMaxBufferedDocs(2).setMergePolicy(newLogMergePolicy()));
> {noformat}
> I think in general we should avoid chaining since it encourages hard
> to read code (code is already hard enough to read!).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]