Skip to content

Commit 8dc6c8a

Browse files
committed
generics break this
1 parent ad8ba17 commit 8dc6c8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/falsepattern/lib/config/ConfigurationManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public static void registerConfig(Class<?> configClass) throws ConfigException {
6666
* @param configClass The class to process.
6767
* @return The configuration elements.
6868
*/
69-
public static List<? extends IConfigElement<?>> getConfigElements(Class<?> configClass) throws ConfigException {
69+
@SuppressWarnings({"rawtypes", "unchecked"})
70+
public static List<IConfigElement> getConfigElements(Class<?> configClass) throws ConfigException {
7071
val cfg = Optional
7172
.ofNullable(configClass.getAnnotation(Config.class))
7273
.orElseThrow(() -> new ConfigException("Class " + configClass.getName() + " does not have a @Config annotation!"));
@@ -78,7 +79,7 @@ public static List<? extends IConfigElement<?>> getConfigElements(Class<?> confi
7879
.orElseThrow(() -> new ConfigException("Tried to get config elements for non-registed config class!"));
7980
val category = cfg.category();
8081
val elements = new ConfigElement<>(rawConfig.getCategory(category)).getChildElements();
81-
return elements.stream().map((element) -> new IConfigElementProxy<>((IConfigElement<?>) element, () -> {
82+
return elements.stream().map((element) -> new IConfigElementProxy(element, () -> {
8283
try {
8384
processConfigInternal(configClass, category, rawConfig);
8485
rawConfig.save();

0 commit comments

Comments
 (0)