[ 
https://issues.apache.org/jira/browse/LUCENE-4671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Muir reassigned LUCENE-4671:
-----------------------------------

    Assignee: Robert Muir
    
> 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
>
> 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-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to