lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose
Date Thu, 10 Nov 2011 00:31:52 GMT


Michael McCandless commented on LUCENE-3564:

bq. Sorry, I was confused with the IfNeeded from LUCENE-3454. But I don't like 'IfChanged'
too . I think that should be part of the javadocs.

It sounds like we disagree on what's important/salient enough to
warrant inclusion in the name.

I think principle of least surprise applies here: it's surprising that
this API can return null, so the "ifChanged" conveys that there is
something conditional about it.

If anything is off I think it's that the current name (openIfChanged)
fails to convey the "sharing" that happens, ie, that this is a fast
operation because it shares sub-readers with the incoming reader.  But
trying to work that into the name (openSharedIfChanged?) is
awkward... any ideas?

bq. Here's a proposal – if we think our users find these names confusing, why don't we do
a poll on java-user and get people to vote on whether they find these names confusing? Because
it looks to me like it's a flavor thing - some of us prefer to read javadocs while others
prefer methods names that tell us what they do, without reading javadocs.

We can certainly do this but I don't think the results will be very
useful (they will naturally suffer badly from sampling bias).  Ie, the
users who respond are the active ones, the more expert ones, ones
already familiar with the old naming, etc.  The more normal users, the
ones more likely to be trapped, rarely read the list.

I think user polls / focus groups / etc. are rarely useful.

So you're free to send such a poll; the results could be interesting,
but I don't think it's a good way for us to name methods in general.

bq. I don't find that openIfChanged saves me from reading the javadocs, because I still need
to read them in order to know what will be returned if the reader hasn't changed.

Remember code is written only once and the
read/copied/refactored/shared many more times; the initial writing is
much less important than subsequent readability.

> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>                 Key: LUCENE-3564
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected]
closes the IW.
> I think we should rename it to rollbackAndClose.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message