Description
Looks like CharsRef.subSequence() is currently broken
It is implemented as:
@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); }
Since CharsRef constructor is (char[] chars, int offset, int length),
Should Be:
@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); }