Skip to content

Commit

Permalink
Merge pull request #4349 from DanHeidinga/djh/stringByte
Browse files Browse the repository at this point in the history
Delete package-private getChars( byte[]) method
  • Loading branch information
pshipton authored Jan 18, 2019
2 parents 66df6cf + 049bbd5 commit 162393f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions jcl/src/java.base/share/classes/java/lang/String.java
Original file line number Diff line number Diff line change
Expand Up @@ -1848,14 +1848,6 @@ void getCharsNoBoundChecks(int start, int end, char[] data, int index) {
}
}

void getChars(int start, int end, byte[] data, int index) {
if (0 <= start && start <= end && end <= lengthInternal() && 0 <= index && ((end - start) <= ((data.length / 2) - index))) {
getCharsNoBoundChecks(start, end, data, index);
} else {
throw new StringIndexOutOfBoundsException();
}
}

// This is a package protected method that performs the getChars operation without explicit bound checks.
// Caller of this method must validate bound safety for String indexing and array copying.
void getCharsNoBoundChecks(int start, int end, byte[] data, int index) {
Expand Down

0 comments on commit 162393f

Please sign in to comment.