From f3baf1dfba4bb11c2fac91631dd3933e916195e6 Mon Sep 17 00:00:00 2001 From: Brian Baldino Date: Wed, 23 Sep 2020 09:11:42 -0700 Subject: [PATCH] use ensureClassLoader --- config/src/main/java/com/typesafe/config/ConfigFactory.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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,