未验证 提交 d30ca1ab 编写于 作者: K Kdump 提交者: GitHub

fix TypeParameterUnusedInFormals (#5613)

Co-authored-by: wu-sheng's avatar吴晟 Wu Sheng <wu.sheng@foxmail.com>
上级 6eda8346
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册