Skip to content

Commit 3d2fe9b

Browse files
committedApr 18, 2022
8284936: Fix Java 7 bootstrap breakage due to use of Arrays.stream
Reviewed-by: mbalao
1 parent c7a735d commit 3d2fe9b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
 

‎jaxp/src/com/sun/java_cup/internal/runtime/lr_parser.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,12 @@ public Symbol scan() throws Exception {
389389
}
390390

391391
private boolean contains(final int[] arr, final int key) {
392-
return Arrays.stream(arr).anyMatch(i -> i == key);
392+
for (int i = 0 ; i < arr.length ; ++i) {
393+
if (arr[i] == key) {
394+
return true;
395+
}
396+
}
397+
return false;
393398
}
394399

395400
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

‎jaxp/src/com/sun/org/apache/xpath/internal/compiler/Token.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ public final class Token {
6767
DDOT, DCOLON, ATTR, CHILD};
6868

6969
public static boolean contains(String str) {
70-
return Arrays.stream(OPERATORS).anyMatch(str::equals);
70+
for (String op : OPERATORS) {
71+
if (op.equals(str)) {
72+
return true;
73+
}
74+
}
75+
return false;
7176
}
7277

7378
private Token() {

0 commit comments

Comments
 (0)
Please sign in to comment.