[ https://issues.apache.org/jira/browse/LUCENE-2084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794702#action_12794702 ]
Uwe Schindler commented on LUCENE-2084: --------------------------------------- +1 And please add a note that the Char/ByteBuffer methods are completely broken. I have two test here that broke with negativeArraySize and so on. The person who wrote the orginbal CharBuffer code misunderstood the indeed complicated logic behind ByteBuffers. So the only requirement from my side is to write in the deprecated message or the docs on top: instead: {noformat} * Note that this class calls array() and arrayOffset() * on the CharBuffers and ByteBuffers it uses, so only wrapped arrays may be * used. This class interprets the arrayOffset() and limit() values returned by * its input buffers as beginning and end+1 positions on the wrapped array, * respectively; similarly, on the output buffer, arrayOffset() is the first * position written to, and limit() is set to one past the final output array * position. {noformat} please: {noformat} * The methods operating on CharBuffers and ByteBuffers are * deprecated in favour of methods that directly operate on byte[] and char[] * arrays. Furthermore, the deprecated methods are only working * correctly, if you simply use Buffer.wrap on an array without any offsets != 0 * and not work on buffers that are returned by the slice() method. * Buffers wrapped with an offset completely ignore the offset and transform * limit() bytes. Buffer slices are completely broken and calculate * the length of the buffer as negative. {noformat} Maybe in better english. > 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, 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