Hi Dima,

On Dec 18, 2012, at 2:32 PM, dokondr <doko...@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-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to