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

Robert Muir commented on LUCENE-2084:
-------------------------------------

bq. In my opinion in the committed patch and also before there is an error in 
handling the ByteBuffer/CharBuffer arrayOffset() value. It calculated the 
length using limit()-arrayOffset() which is wrong

Uwe, I think you might be wrong here. 
In this class, the javadocs state the buffer must have a backing array.
Therefore, limit - offset is a correct way to calculate length of the entire 
buffer, which is what this class has always used.

bq. The length available in the buffer is simple remaining() - this is how all 
other encoders/decoders in the JDK work (see src).

This is not correct, this is the remaining relative length, as remaining() is 
based upon position: Returns the number of elements between the current 
position and the limit.
Unlike typical jdk code, this code always ignored relative position and instead 
encodes/decodes entire buffers.

We should not change this under this issue... it is unrelated. I do not think 
we should change the semantics of this encode/decode to take any relative 
position into account.


> remove Byte/CharBuffer wrapping for collation key generation
> ------------------------------------------------------------
>
>                 Key: LUCENE-2084
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2084
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: contrib/*
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: collation.benchmark.tar.bz2, LUCENE-2084.patch, 
> LUCENE-2084.patch, TopTFWikipediaWords.tar.bz2
>
>
> We can remove the overhead of ByteBuffer and CharBuffer wrapping in 
> CollationKeyFilter and ICUCollationKeyFilter.
> this patch moves the logic in IndexableBinaryStringTools into char[],int,int 
> and byte[],int,int based methods, with the previous Byte/CharBuffer methods 
> delegating to these.
> Previously, the Byte/CharBuffer methods required a backing array anyway.

-- 
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