mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-09 21:19:38 +00:00
8383630: Fix iteration in tests doing class redefinition
Reviewed-by: shade, mbaesken
This commit is contained in:
parent
d81632a11e
commit
a2e271969d
@ -193,7 +193,7 @@ public class DefineClass {
|
||||
|
||||
private static int getStringIndex(String needle, byte[] buf, int offset) {
|
||||
outer:
|
||||
for (int i = offset; i < buf.length - offset - needle.length(); i++) {
|
||||
for (int i = offset; i <= buf.length - needle.length(); i++) {
|
||||
for (int j = 0; j < needle.length(); j++) {
|
||||
if (buf[i + j] != (byte)needle.charAt(j)) continue outer;
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ public class RedefineClass {
|
||||
|
||||
private static int getStringIndex(String needle, byte[] buf, int offset) {
|
||||
outer:
|
||||
for (int i = offset; i < buf.length - offset - needle.length(); i++) {
|
||||
for (int i = offset; i <= buf.length - needle.length(); i++) {
|
||||
for (int j = 0; j < needle.length(); j++) {
|
||||
if (buf[i + j] != (byte)needle.charAt(j)) continue outer;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user