revert LANG-1354; java7 has synthetic fields on Integer, jacoco does not yet work with java9

This commit is contained in:
Chas Honton 2017-10-11 08:50:01 -07:00
parent 0f32b292c2
commit 07f3694a5c
3 changed files with 4 additions and 10 deletions

View File

@ -25,4 +25,4 @@ script:
- mvn
after_success:
- mvn clean test jacoco:report coveralls:report -Ptravis-jacoco
- mvn clean cobertura:cobertura coveralls:report -Ptravis-cobertura

View File

@ -24,6 +24,7 @@ import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
@ -186,7 +187,6 @@ public class FieldUtils {
/**
* Gets all fields of the given class and its parents (if any).
* Does not return any synthetic fields.
*
* @param cls
* the {@link Class} to query
@ -202,7 +202,6 @@ public class FieldUtils {
/**
* Gets all fields of the given class and its parents (if any).
* Does not return any synthetic fields.
*
* @param cls
* the {@link Class} to query
@ -216,11 +215,8 @@ public class FieldUtils {
final List<Field> allFields = new ArrayList<>();
Class<?> currentClass = cls;
while (currentClass != null) {
for(final Field declaredField : currentClass.getDeclaredFields()) {
if(!declaredField.isSynthetic()) {
allFields.add(declaredField);
}
}
final Field[] declaredFields = currentClass.getDeclaredFields();
Collections.addAll(allFields, declaredFields);
currentClass = currentClass.getSuperclass();
}
return allFields;
@ -228,8 +224,6 @@ public class FieldUtils {
/**
* Gets all fields of the given class and its parents (if any) that are annotated with the given annotation.
* Does not return any synthetic fields.
*
* @param cls
* the {@link Class} to query
* @param annotationCls