From 43d40c6e9e95ed0d7bb5f1baa932af37d4449189 Mon Sep 17 00:00:00 2001 From: Thad House Date: Sun, 7 Feb 2021 08:20:33 -0800 Subject: [PATCH] [wpiutil] Suppress unchecked cast in CombinedRuntimeLoader (#3155) Because of Java's type system, it is actually literally impossible to check for this cast at runtime. So instead, the only option is to suppress it. Only suppressed for the specific function. --- .../java/edu/wpi/first/wpiutil/CombinedRuntimeLoader.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wpiutil/src/main/java/edu/wpi/first/wpiutil/CombinedRuntimeLoader.java b/wpiutil/src/main/java/edu/wpi/first/wpiutil/CombinedRuntimeLoader.java index a89d0cf941..67354a04d9 100644 --- a/wpiutil/src/main/java/edu/wpi/first/wpiutil/CombinedRuntimeLoader.java +++ b/wpiutil/src/main/java/edu/wpi/first/wpiutil/CombinedRuntimeLoader.java @@ -56,7 +56,11 @@ public final class CombinedRuntimeLoader { * @return List of all libraries that were extracted * @throws IOException Thrown if resource not found or file could not be extracted */ - @SuppressWarnings({"PMD.AvoidInstantiatingObjectsInLoops", "PMD.UnnecessaryCastRule"}) + @SuppressWarnings({ + "PMD.AvoidInstantiatingObjectsInLoops", + "PMD.UnnecessaryCastRule", + "unchecked" + }) public static List extractLibraries(Class clazz, String resourceName) throws IOException { TypeReference> typeRef =