mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
Semantics of getChars was incorrect. It should specify a begin
and end index, not a bunch of lengths
This commit is contained in:
parent
e831a41e90
commit
db2b7e8fa7
@ -301,13 +301,13 @@ public final class String implements Comparable<String> {
|
||||
return getBytes();
|
||||
}
|
||||
|
||||
public void getChars(int srcOffset, int srcLength,
|
||||
public void getChars(int srcOffset, int srcEnd,
|
||||
char[] dst, int dstOffset)
|
||||
{
|
||||
if (srcOffset < 0 || srcOffset + srcLength > length) {
|
||||
if (srcOffset < 0 || srcEnd > length) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
}
|
||||
|
||||
int srcLength = srcEnd-srcOffset;
|
||||
if (data instanceof char[]) {
|
||||
char[] src = (char[]) data;
|
||||
System.arraycopy(src, offset + srcOffset, dst, dstOffset, srcLength);
|
||||
|
Loading…
Reference in New Issue
Block a user