lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Rowe <sar...@gmail.com>
Subject Re: Some fixes to typos in documentation
Date Tue, 18 Dec 2012 22:39:26 GMT
Hi Dima,

On Dec 18, 2012, at 2:32 PM, dokondr <dokondr@gmail.com> wrote:
> Hi,
> Found some typos.  In package description:
> http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/analysis/package-summary.html?is-external=true#package_description

Thanks for reporting these.

> OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
> *** Should be:
> OffsetAttribute offsetAtt = ts.addAttribute(OffsetAttribute.class);

This one is already fixed in branch_4x (future v4.X):

<http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/analysis/package.html?diff_format=f&view=markup#l186>

and trunk (future v5.X):

<http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/analysis/package.html?diff_format=f&view=markup#l186>

>   } finally {
>      ts.close(); // Release resources associated with this stream.
>    }
> *** Should be:
>   } finally {
> analyzer.close();
>      ts.close(); // Release resources associated with this stream.
>    }

Although this is technically correct, I see very few actual uses of Analyzer.close() in Lucene's
tests.

Ordinarily, Analyzers are reused, so you wouldn't want to close them unless your program is
going to exit, in which case resources will be released anyway?  (I guess apps running in
resource constrained environments might choose to reclaim resources and then re-initialize
on each use.) 

Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message