Cast to string if necessary

This commit is contained in:
Jesse Boyd 2016-06-21 14:23:04 +10:00
parent 718831e8e0
commit 7fb2631421

View file

@ -65,9 +65,13 @@ public class Config {
if (field.getAnnotation(Final.class) != null) {
return;
}
if (field.getType() == String.class && !(value instanceof String)) {
value = value + "";
}
field.set(instance, value);
return;
} catch (IllegalAccessException e) {
} catch (Throwable e) {
PS.debug("Invalid configuration value: " + key + ": " + value + " in " + root.getSimpleName());
e.printStackTrace();
}
}