mirror of
https://github.com/lightbend/config.git
synced 2025-03-28 04:50:26 +08:00
use ensureClassLoader
This commit is contained in:
parent
83349ecbfa
commit
f3baf1dfba
@ -1123,13 +1123,9 @@ public final class ConfigFactory {
|
|||||||
* if none was specified.
|
* if none was specified.
|
||||||
*/
|
*/
|
||||||
public static java.util.Optional<Config> parseApplicationReplacement(ConfigParseOptions parseOptions) {
|
public static java.util.Optional<Config> parseApplicationReplacement(ConfigParseOptions parseOptions) {
|
||||||
|
ensureClassLoader(parseOptions, "parseApplicationReplacement");
|
||||||
ClassLoader loader = parseOptions.getClassLoader();
|
ClassLoader loader = parseOptions.getClassLoader();
|
||||||
|
|
||||||
if (loader == null)
|
|
||||||
throw new ConfigException.BugOrBroken(
|
|
||||||
"ClassLoader should have been set here; bug in ConfigFactory. "
|
|
||||||
+ "(You can probably work around this bug by passing in a class loader or calling currentThread().setContextClassLoader() though.)");
|
|
||||||
|
|
||||||
int specified = 0;
|
int specified = 0;
|
||||||
|
|
||||||
// override application.conf with config.file, config.resource,
|
// override application.conf with config.file, config.resource,
|
||||||
|
Loading…
Reference in New Issue
Block a user