fix TypeParameterUnusedInFormals (#5613)

Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
Kdump 2020-10-02 07:41:17 +08:00 committed by GitHub
parent 6eda8346bb
commit d30ca1ab58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@ package org.apache.skywalking.apm.agent.test.helper;
import java.lang.reflect.Field;
public class FieldGetter {
@SuppressWarnings("TypeParameterUnusedInFormals")
public static <T> T getValue(Object instance,
String fieldName) throws IllegalAccessException, NoSuchFieldException {
Field field = instance.getClass().getDeclaredField(fieldName);
@ -28,6 +29,7 @@ public class FieldGetter {
return (T) field.get(instance);
}
@SuppressWarnings("TypeParameterUnusedInFormals")
public static <T> T getParentFieldValue(Object instance,
String fieldName) throws IllegalAccessException, NoSuchFieldException {
Field field = instance.getClass().getSuperclass().getDeclaredField(fieldName);
@ -35,6 +37,7 @@ public class FieldGetter {
return (T) field.get(instance);
}
@SuppressWarnings("TypeParameterUnusedInFormals")
public static <T> T get2LevelParentFieldValue(Object instance,
String fieldName) throws IllegalAccessException, NoSuchFieldException {
Field field = instance.getClass().getSuperclass().getSuperclass().getDeclaredField(fieldName);