Skip to content

Commit

Permalink
[SPARK-20922][CORE][HOTFIX] Don't use Java 8 lambdas in older branches.
Browse files Browse the repository at this point in the history
Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes #18178 from vanzin/SPARK-20922-hotfix.
  • Loading branch information
Marcelo Vanzin committed Jun 1, 2017
1 parent 772a9b9 commit 0b25a7d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ class FilteredObjectInputStream extends ObjectInputStream {
protected Class<?> resolveClass(ObjectStreamClass desc)
throws IOException, ClassNotFoundException {

boolean isValid = ALLOWED_PACKAGES.stream().anyMatch(p -> desc.getName().startsWith(p));
boolean isValid = false;
for (String p : ALLOWED_PACKAGES) {
if (desc.getName().startsWith(p)) {
isValid = true;
break;
}
}
if (!isValid) {
throw new IllegalArgumentException(
String.format("Unexpected class in stream: %s", desc.getName()));
Expand Down

0 comments on commit 0b25a7d

Please sign in to comment.