mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-12-28 19:24:15 +00:00
Don't use java.util.function.Predicate.
It is a Java-8 addition.
This commit is contained in:
parent
bb0d9b1146
commit
9f717384a4
1 changed files with 6 additions and 7 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue