use ensureClassLoader

This commit is contained in:
Brian Baldino 2020-09-23 09:11:42 -07:00
parent 83349ecbfa
commit f3baf1dfba

View File

@ -1123,13 +1123,9 @@ public final class ConfigFactory {
* if none was specified.
*/
public static java.util.Optional<Config> parseApplicationReplacement(ConfigParseOptions parseOptions) {
ensureClassLoader(parseOptions, "parseApplicationReplacement");
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;
// override application.conf with config.file, config.resource,