diff --git a/config/src/main/java/com/typesafe/config/ConfigFactory.java b/config/src/main/java/com/typesafe/config/ConfigFactory.java index fa718e640..d519d0c22 100644 --- a/config/src/main/java/com/typesafe/config/ConfigFactory.java +++ b/config/src/main/java/com/typesafe/config/ConfigFactory.java @@ -1123,13 +1123,9 @@ public static java.util.Optional parseApplicationReplacement(ClassLoader * if none was specified. */ public static java.util.Optional 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,