Skip to content

Commit

Permalink
fixed bug where new config values don't get saved to application.conf…
Browse files Browse the repository at this point in the history
… file when set through System.setProperty(), closes Erudika/scoold#423
  • Loading branch information
albogdano committed Dec 3, 2023
1 parent e579d7c commit bfc16a4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ protected String getConfigParam(String key, String defaultValue) {
public Object getConfigValue(String key, String defaultValue) {
String valString = getConfigParam(key, defaultValue);
try {
if (getConfig().hasPath(key) && getConfig().getValue(key).unwrapped() != null) {
// keep existing values from config file, but if any properties were set through
// System.setProperty() to a new value - skip this step and use the new values
if (getConfig().hasPath(key) && getConfig().getValue(key).unwrapped() != null &&
StringUtils.equals(valString, getConfig().getAnyRef(key).toString())) {
return getConfig().getValue(key).unwrapped();
}
Documented doc = annotatedMethodsMap.get(key);
Expand Down

0 comments on commit bfc16a4

Please sign in to comment.