Don't use the renamed toList method of the guava library, but create the ImmutableList directly
@@ -22,6 +22,7 @@ package com.thinkbiganalytics.spark.datavalidator.functions;
import com.google.common.base.Predicate;
import com.google.common.collect.FluentIterable;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.thinkbiganalytics.policy.BaseFieldPolicy;
import com.thinkbiganalytics.policy.FieldPolicy;
@@ -331,7 +332,7 @@ public class CleanseAndValidateRow implements Function<Row, CleansedRowResult> {
*/
@Nonnull
private List<String> getPolicyMapFeedFieldNames() {
- return FluentIterable.from(Arrays.asList(policies))
+ return ImmutableList.copyOf(FluentIterable.from(Arrays.asList(policies))
.filter(new Predicate<FieldPolicy>() {
@Override
public boolean apply(@Nullable FieldPolicy input) {
@@ -344,8 +345,7 @@ public class CleanseAndValidateRow implements Function<Row, CleansedRowResult> {
assert input != null;
return input.getFeedField().toLowerCase();
}
- })
- .toList();
+ }));
}
/**
