You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2013/01/09 20:06:13 UTC
[jira] [Updated] (LUCENE-4671) CharsRef.subSequence broken
[ https://issues.apache.org/jira/browse/LUCENE-4671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated LUCENE-4671:
--------------------------------
Attachment: LUCENE-4671.patch
patch
> CharsRef.subSequence broken
> ---------------------------
>
> Key: LUCENE-4671
> URL: https://issues.apache.org/jira/browse/LUCENE-4671
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Tim Smith
> Assignee: Robert Muir
> Attachments: LUCENE-4671.patch
>
>
> Looks like CharsRef.subSequence() is currently broken
> It is implemented as:
> {code}
> @Override
> public CharSequence subSequence(int start, int end) {
> // NOTE: must do a real check here to meet the specs of CharSequence
> if (start < 0 || end > length || start > end) {
> throw new IndexOutOfBoundsException();
> }
> return new CharsRef(chars, offset + start, offset + end);
> }
> {code}
> Since CharsRef constructor is (char[] chars, int offset, int length),
> Should Be:
> {code}
> @Override
> public CharSequence subSequence(int start, int end) {
> // NOTE: must do a real check here to meet the specs of CharSequence
> if (start < 0 || end > length || start > end) {
> throw new IndexOutOfBoundsException();
> }
> return new CharsRef(chars, offset + start, end - start);
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org