[ 
https://issues.apache.org/jira/browse/LUCENE-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735358#action_12735358
 ] 

Uwe Schindler commented on LUCENE-1762:
---------------------------------------

bq. setOnlyUseNewAPI(false) does not exist, it was removed with some of the 
patches lately. It gets automatically detected via reflection?

No, this is a static global switch in TokenStream. If you switch it on, 
TokenStreams and Filters use only the new API forcefully and therefore use the 
separate Attribute implementations from o.a.l.analysis.tokenattributes. If it 
is switched off, a old Token instance is used instead, see 
[http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc/core/org/apache/lucene/analysis/TokenStream.html#setOnlyUseNewAPI(boolean)].
 The red color bug is fixed in trunk now :)

There is one problem with the 6 new single attribute instances: They are code 
duplicates from Token but have no Test. I also think, I should add a missing 
test similar to TestToken.java and do the same test with 6 Attribute instances.

I will review the other changes later, I have no time today.

> Slightly more readable code in TermAttributeImpl 
> -------------------------------------------------
>
>                 Key: LUCENE-1762
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1762
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Eks Dev
>            Assignee: Uwe Schindler
>            Priority: Trivial
>         Attachments: LUCENE-1762.patch, LUCENE-1762.patch, LUCENE-1762.patch
>
>
> No big deal. 
> growTermBuffer(int newSize) was using correct, but slightly hard to follow 
> code. 
> the method was returning null as a hint that the current termBuffer has 
> enough space to the upstream code or reallocated buffer.
> this patch simplifies logic   making this method to only reallocate buffer, 
> nothing more.  
> It reduces number of if(null) checks in a few methods and reduces amount of 
> code. 
> all tests pass.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to