[jira] Commented: (LUCENE-1762) Slightly more readable code in TermAttributeImpl

2009-07-27 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12735798#action_12735798
 ] 

Uwe Schindler commented on LUCENE-1762:
---

Eks, the original patch looked good, I did not change anything in your code, I 
only added the above mentioned tests and other changes.

One thing: As TestToken checks the buffer sizes, the test in the 
backwards-branch for Token must also be changed. I will do this before commit.

 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
Affects Versions: 2.9
Reporter: Eks Dev
Assignee: Uwe Schindler
Priority: Trivial
 Fix For: 2.9

 Attachments: LUCENE-1762.patch, 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



[jira] Commented: (LUCENE-1762) Slightly more readable code in TermAttributeImpl

2009-07-27 Thread Eks Dev (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12735809#action_12735809
 ] 

Eks Dev commented on LUCENE-1762:
-

cool, thanks for the review.   

 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
Affects Versions: 2.9
Reporter: Eks Dev
Assignee: Uwe Schindler
Priority: Trivial
 Fix For: 2.9

 Attachments: LUCENE-1762.patch, 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



[jira] Commented: (LUCENE-1762) Slightly more readable code in TermAttributeImpl

2009-07-26 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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



[jira] Commented: (LUCENE-1762) Slightly more readable code in TermAttributeImpl

2009-07-25 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12735275#action_12735275
 ] 

Uwe Schindler commented on LUCENE-1762:
---

As Token is not yet deprecated, I think, this patch should also apply to 
Token.java?
Can you prepare that, too?

 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
Priority: Trivial
 Attachments: 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