From 36f764110a3861a83fcbfd5c21abadca57bdb58c Mon Sep 17 00:00:00 2001 From: rugmj Date: Sun, 25 Jun 2023 21:19:03 +0100 Subject: [PATCH] Simplifies loadClass types Some weird eclipse language server errors were occuring with the old method, this fixes that --- .../tools/redstone/redstonetools/utils/ReflectionUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/tools/redstone/redstonetools/utils/ReflectionUtils.java b/src/main/java/tools/redstone/redstonetools/utils/ReflectionUtils.java index e80d7ceb..e9c91ff0 100644 --- a/src/main/java/tools/redstone/redstonetools/utils/ReflectionUtils.java +++ b/src/main/java/tools/redstone/redstonetools/utils/ReflectionUtils.java @@ -108,10 +108,9 @@ private static Set serviceLoad(Class clazz) throws IOExcepti .collect(Collectors.toSet()); } - @SuppressWarnings("unchecked") - private static @Nullable Class loadClass(String className) { + private static @Nullable Class loadClass(String className) { try { - return (Class) Class.forName(className); + return Class.forName(className); } catch (ClassNotFoundException e) { throw new RuntimeException("Failed to load class " + className, e); } catch (NoClassDefFoundError e) {