From 8dc6c8aed0390d3fde8a7877d6d6f02706de3b21 Mon Sep 17 00:00:00 2001 From: FalsePattern <30945458+FalsePattern@users.noreply.github.com> Date: Sat, 7 May 2022 16:50:16 +0200 Subject: [PATCH] generics break this --- .../com/falsepattern/lib/config/ConfigurationManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/falsepattern/lib/config/ConfigurationManager.java b/src/main/java/com/falsepattern/lib/config/ConfigurationManager.java index 85a9d78..1119aeb 100644 --- a/src/main/java/com/falsepattern/lib/config/ConfigurationManager.java +++ b/src/main/java/com/falsepattern/lib/config/ConfigurationManager.java @@ -66,7 +66,8 @@ public class ConfigurationManager { * @param configClass The class to process. * @return The configuration elements. */ - public static List> getConfigElements(Class configClass) throws ConfigException { + @SuppressWarnings({"rawtypes", "unchecked"}) + public static List getConfigElements(Class configClass) throws ConfigException { val cfg = Optional .ofNullable(configClass.getAnnotation(Config.class)) .orElseThrow(() -> new ConfigException("Class " + configClass.getName() + " does not have a @Config annotation!")); @@ -78,7 +79,7 @@ public class ConfigurationManager { .orElseThrow(() -> new ConfigException("Tried to get config elements for non-registed config class!")); val category = cfg.category(); val elements = new ConfigElement<>(rawConfig.getCategory(category)).getChildElements(); - return elements.stream().map((element) -> new IConfigElementProxy<>((IConfigElement) element, () -> { + return elements.stream().map((element) -> new IConfigElementProxy(element, () -> { try { processConfigInternal(configClass, category, rawConfig); rawConfig.save();