Skip to content

Commit

Permalink
Fix failure when system properties modified when loading configuration
Browse files Browse the repository at this point in the history
System properties are global mutable state.  Prevent
`ConfigurationLoader` from throwing (`NullPointerException`) when system
properties are modified during `getSystemProperties()`.
  • Loading branch information
findepi committed May 22, 2024
1 parent 46bf4ac commit b076719
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
249

- Fix failure when system properties modified when loading configuration

248

- Update Jetty to 12.0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public static Map<String, String> loadPropertiesFrom(String path)

public static Map<String, String> getSystemProperties()
{
return fromProperties(System.getProperties());
Properties systemProperties = System.getProperties();
synchronized (systemProperties) {
return fromProperties(systemProperties);
}
}
}

0 comments on commit b076719

Please sign in to comment.