From d30ca1ab58860b91ef0804299f35c912db35082f Mon Sep 17 00:00:00 2001 From: Kdump Date: Fri, 2 Oct 2020 07:41:17 +0800 Subject: [PATCH] fix TypeParameterUnusedInFormals (#5613) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 吴晟 Wu Sheng --- .../apache/skywalking/apm/agent/test/helper/FieldGetter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apm-sniffer/apm-test-tools/src/main/java/org/apache/skywalking/apm/agent/test/helper/FieldGetter.java b/apm-sniffer/apm-test-tools/src/main/java/org/apache/skywalking/apm/agent/test/helper/FieldGetter.java index 2aa5966f7..aa81ab394 100644 --- a/apm-sniffer/apm-test-tools/src/main/java/org/apache/skywalking/apm/agent/test/helper/FieldGetter.java +++ b/apm-sniffer/apm-test-tools/src/main/java/org/apache/skywalking/apm/agent/test/helper/FieldGetter.java @@ -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 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 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 get2LevelParentFieldValue(Object instance, String fieldName) throws IllegalAccessException, NoSuchFieldException { Field field = instance.getClass().getSuperclass().getSuperclass().getDeclaredField(fieldName);