Skip to content

Commit 1deac9e

Browse files
author
Marcelo Vanzin
committed
[SPARK-20922][core][hotfix] Don't use Java 8 lambdas in older branches.
1 parent 772a9b9 commit 1deac9e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

launcher/src/main/java/org/apache/spark/launcher/FilteredObjectInputStream.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ class FilteredObjectInputStream extends ObjectInputStream {
4242
protected Class<?> resolveClass(ObjectStreamClass desc)
4343
throws IOException, ClassNotFoundException {
4444

45-
boolean isValid = ALLOWED_PACKAGES.stream().anyMatch(p -> desc.getName().startsWith(p));
45+
boolean isValid = false;
46+
for (String p : ALLOWED_PACKAGES) {
47+
if (desc.getName().startsWith(p)) {
48+
isValid = true;
49+
break;
50+
}
51+
}
4652
if (!isValid) {
4753
throw new IllegalArgumentException(
4854
String.format("Unexpected class in stream: %s", desc.getName()));

0 commit comments

Comments
 (0)