Fix imports and upgrade gradle to 5.5.1

This commit is contained in:
Prospector
2019-07-26 22:41:28 -07:00
parent e983ab5dee
commit 978380b6fd
7 changed files with 43 additions and 37 deletions

View File

@@ -4,16 +4,16 @@ import java.lang.reflect.Field;
import java.util.Arrays;
public class ReflectionHelper {
@SuppressWarnings("unchecked")
public static <T> T getValue(Class<?> cls, Object instance, String...names) {
public static <T> T getValue(Class<?> cls, Object instance, String... names) {
try {
return (T) getField(cls, names).get(instance);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
public static Field getField(Class<?> cls, String... names) {
for (String name : names) {
Field f = getFieldInternal(cls, name);