Skip to content

Commit

Permalink
always check for @Config.Ignore before processing field (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts authored Sep 13, 2024
1 parent ecd7d92 commit 6a39dbe
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ private static void processConfigInternal(Class<?> configClass, String category,
|| foundCategory && cat.requiresWorldRestart();

for (val field : configClass.getDeclaredFields()) {
if (field.isAnnotationPresent(Config.Ignore.class)) {
continue;
}

if (instance != null && Modifier.isStatic(field.getModifiers())) {
throw new ConfigException(
"Illegal config field: " + field.getName()
Expand All @@ -178,10 +182,6 @@ private static void processConfigInternal(Class<?> configClass, String category,
+ ": Static field in instance context! Did you forget an @Config.Ignore annotation?");
}

if (field.getAnnotation(Config.Ignore.class) != null) {
continue;
}

field.setAccessible(true);

if (!ConfigFieldParser.canParse(field)) {
Expand Down

0 comments on commit 6a39dbe

Please sign in to comment.