Don't use java.util.function.Predicate.

It is a Java-8 addition.
This commit is contained in:
Jonathan Wood 2015-06-24 22:14:42 -07:00
parent bb0d9b1146
commit 9f717384a4

View file

@ -3,7 +3,6 @@ package com.moandjiezana.toml;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.*;
import java.util.function.Predicate;
import static com.moandjiezana.toml.MapSerializer.MAP_SERIALIZER;
@ -42,14 +41,14 @@ class ObjectSerializer implements Serializer {
getSuperClassFields(cls.getSuperclass(), fields);
// Skip final fields
fields.removeIf(new Predicate<Field>() {
@Override
public boolean test(Field field) {
return Modifier.isFinal(field.getModifiers());
Set<Field> prunedFields = new LinkedHashSet<Field>();
for (Field field : fields) {
if (!Modifier.isFinal(field.getModifiers())) {
prunedFields.add(field);
}
});
}
return fields;
return prunedFields;
}
static private void getSuperClassFields(Class cls, Set<Field> fields) {